重构YSP分析代码。

This commit is contained in:
wanglihui
2020-07-21 19:41:17 +08:00
parent 2db192629a
commit b3ec0bdfbf
21 changed files with 283 additions and 466 deletions

View File

@@ -29,6 +29,7 @@ public class BaseClickhouseData {
static HashMap<Integer, HashMap<String, ArrayList<BaseEdgeDocument>>> newRelationFqdnAddressIpMap = new HashMap<>();
static HashMap<Integer, HashMap<String, ArrayList<BaseEdgeDocument>>> newRelationIpVisitFqdnMap = new HashMap<>();
static HashMap<Integer, HashMap<String, ArrayList<BaseEdgeDocument>>> newRelationSubsciberLocateIpMap = new HashMap<>();
static HashMap<Integer, HashMap<String, ArrayList<BaseEdgeDocument>>> newRelationFqdnSameFqdnMap = new HashMap<>();
private DruidPooledConnection connection;
private Statement statement;
@@ -148,6 +149,28 @@ public class BaseClickhouseData {
}
}
void baseRelationshipFqdnSameFqdn(){
initializeMap(newRelationFqdnSameFqdnMap);
LOG.info("R_SAME_ORIGIN_FQDN2FQDN resultMap初始化完成");
String sql = getRelationshipFqdnSameFqdnSql();
long start = System.currentTimeMillis();
try {
connection = manger.getConnection();
statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(sql);
while (resultSet.next()) {
BaseEdgeDocument newDoc = getRelationshipFqdnSameFqdnDocument(resultSet);
putMapByHashcode(newDoc, newRelationFqdnSameFqdnMap);
}
long last = System.currentTimeMillis();
LOG.info(sql + "\n读取clickhouse EIpVisitFqdn时间" + (last - start));
}catch (Exception e){
e.printStackTrace();
}finally {
manger.clear(statement,connection);
}
}
void baseRelationshipIpVisitFqdn() {
initializeMap(newRelationIpVisitFqdnMap);
LOG.info("R_VISIT_IP2FQDN resultMap初始化完成");