diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java index 13119212ef44..79fd6b7343c3 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/stat/HbaseAgentStatDaoOperations.java @@ -90,7 +90,7 @@ boolean agentStatExists(AgentStatType agentStatTy } int resultLimit = 20; - Scan scan = this.createScan(agentStatType, agentId, range, resultLimit); + Scan scan = this.checkExist(agentStatType, agentId, range, resultLimit); TableName agentStatTableName = tableNameProvider.getTableName(columnFamily.getTable()); List> result = hbaseOperations.findParallel(agentStatTableName, scan, this.operationFactory.getRowKeyDistributor(), resultLimit, mapper, AGENT_STAT_VER2_NUM_PARTITIONS); @@ -130,5 +130,12 @@ private Scan createScan(AgentStatType agentStatType, String agentId, Range range return scan; } - + private Scan checkExist(AgentStatType agentStatType, String agentId, Range range, int scanCacheSize) { + Scan scan = this.operationFactory.createScan(agentId, agentStatType, range.getFrom(), range.getTo()); + scan.setCaching(scanCacheSize); + scan.setOneRowLimit(); + scan.setId(agentStatType.getChartType()); + scan.addFamily(columnFamily.getName()); + return scan; + } }