未验证 提交 f987d699 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Rename `isPhysicalTable` to `isMergedTable`. The latter represents the correct meaning. (#9973)

上级 94cf9238
......@@ -175,7 +175,7 @@ public enum IndexController {
}
public static boolean isPhysicalTable(String logicName) {
public static boolean isMergedTable(String logicName) {
return !getPhysicalTableName(logicName).equals(logicName);
}
......
......@@ -57,7 +57,7 @@ public class NetworkAddressAliasEsDAO extends EsDAO implements INetworkAddressAl
try {
final int batchSize = Math.min(resultWindowMaxSize, scrollingBatchSize);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(NetworkAddressAlias.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(NetworkAddressAlias.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, NetworkAddressAlias.INDEX_NAME));
}
query.must(Query.range(NetworkAddressAlias.LAST_UPDATE_TIME_BUCKET)
......
......@@ -62,7 +62,7 @@ public class AggregationQueryEsDAO extends EsDAO implements IAggregationQueryDAO
final boolean asc = condition.getOrder().equals(Order.ASC);
if (CollectionUtils.isEmpty(additionalConditions)
&& IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
&& IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
final BoolQueryBuilder boolQuery =
Query.bool()
.must(basicQuery)
......@@ -74,7 +74,7 @@ public class AggregationQueryEsDAO extends EsDAO implements IAggregationQueryDAO
} else if (CollectionUtils.isEmpty(additionalConditions)) {
search.query(basicQuery);
} else if (CollectionUtils.isNotEmpty(additionalConditions)
&& IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
&& IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
final BoolQueryBuilder boolQuery =
Query.bool()
.must(Query.term(
......
......@@ -60,7 +60,7 @@ public class AlarmQueryEsDAO extends EsDAO implements IAlarmQueryDAO {
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(AlarmRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(AlarmRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(AlarmRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, AlarmRecord.INDEX_NAME));
}
......
......@@ -57,7 +57,7 @@ public class BrowserLogQueryEsDAO extends EsDAO implements IBrowserLogQueryDAO {
endSecondTB = duration.getEndTimeBucketInSec();
}
final BoolQueryBuilder boolQueryBuilder = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(BrowserErrorLogRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(BrowserErrorLogRecord.INDEX_NAME)) {
boolQueryBuilder.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, BrowserErrorLogRecord.INDEX_NAME));
}
......
......@@ -53,7 +53,7 @@ public class EBPFProfilingDataEsDAO extends EsDAO implements IEBPFProfilingDataD
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(EBPFProfilingDataRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(EBPFProfilingDataRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(EBPFProfilingDataRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, EBPFProfilingDataRecord.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(scrollingBatchSize);
......
......@@ -50,7 +50,7 @@ public class EBPFProfilingScheduleEsDAO extends EsDAO implements IEBPFProfilingS
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(EBPFProfilingScheduleRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(EBPFProfilingScheduleRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(EBPFProfilingScheduleRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, EBPFProfilingScheduleRecord.INDEX_NAME));
}
query.must(Query.term(EBPFProfilingScheduleRecord.TASK_ID, taskId));
......
......@@ -62,7 +62,7 @@ public class EBPFProfilingTaskEsDAO extends EsDAO implements IEBPFProfilingTaskD
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(EBPFProfilingTaskRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(EBPFProfilingTaskRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(EBPFProfilingTaskRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, EBPFProfilingTaskRecord.INDEX_NAME));
}
......
......@@ -78,7 +78,7 @@ public class ESEventQueryDAO extends EsDAO implements IEventQueryDAO {
private void buildMustQueryListByCondition(final EventQueryCondition condition,
final BoolQueryBuilder query) {
if (IndexController.LogicIndicesRegister.isPhysicalTable(Event.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(Event.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, Event.INDEX_NAME));
}
......
......@@ -79,7 +79,7 @@ public class LogQueryEsDAO extends EsDAO implements ILogQueryDAO {
endSecondTB = duration.getEndTimeBucketInSec();
}
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(LogRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(LogRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, LogRecord.INDEX_NAME));
}
if (startSecondTB != 0 && endSecondTB != 0) {
......
......@@ -96,7 +96,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
if (StringUtil.isNotEmpty(group)) {
query.must(Query.term(ServiceTraffic.GROUP, group));
}
if (IndexController.LogicIndicesRegister.isPhysicalTable(ServiceTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ServiceTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ServiceTraffic.INDEX_NAME));
}
final SearchParams params = new SearchParams().scroll(SCROLL_CONTEXT_RETENTION);
......@@ -136,7 +136,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
final BoolQueryBuilder query =
Query.bool()
.must(Query.term(ServiceTraffic.SERVICE_ID, serviceId));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ServiceTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ServiceTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ServiceTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(layerSize);
......@@ -156,7 +156,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
Query.bool()
.must(Query.range(InstanceTraffic.LAST_PING_TIME_BUCKET).gte(minuteTimeBucket))
.must(Query.term(InstanceTraffic.SERVICE_ID, serviceId));
if (IndexController.LogicIndicesRegister.isPhysicalTable(InstanceTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(InstanceTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, InstanceTraffic.INDEX_NAME));
}
final int batchSize = Math.min(queryMaxSize, scrollingBatchSize);
......@@ -183,7 +183,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(InstanceTraffic.INDEX_NAME);
String id = instanceId;
if (IndexController.LogicIndicesRegister.isPhysicalTable(InstanceTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(InstanceTraffic.INDEX_NAME)) {
id = IndexController.INSTANCE.generateDocId(InstanceTraffic.INDEX_NAME, instanceId);
}
final BoolQueryBuilder query =
......@@ -212,7 +212,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
query.must(Query.match(matchCName, keyword));
}
if (IndexController.LogicIndicesRegister.isPhysicalTable(EndpointTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(EndpointTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, EndpointTraffic.INDEX_NAME));
}
......@@ -242,7 +242,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(queryMaxSize);
......@@ -260,7 +260,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(queryMaxSize);
......@@ -276,7 +276,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(queryMaxSize);
......@@ -292,7 +292,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(0);
......@@ -309,7 +309,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(0);
......@@ -351,7 +351,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
IndexController.LogicIndicesRegister.getPhysicalTableName(ProcessTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool()
.must(Query.term("_id", processId));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProcessTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProcessTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ProcessTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(queryMaxSize);
......
......@@ -111,7 +111,7 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
final List<String> ids = pointOfTimes.stream().map(pointOfTime -> {
String id = pointOfTime.id(condition.getEntity().buildId());
if (IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
if (IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
id = IndexController.INSTANCE.generateDocId(condition.getName(), id);
}
String indexName = TimeSeriesUtils.queryIndexName(
......@@ -262,7 +262,7 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
final String entityId = condition.getEntity().buildId();
if (entityId == null &&
IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
sourceBuilder.query(
Query.bool()
.must(rangeQueryBuilder)
......@@ -273,7 +273,7 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
);
} else if (entityId == null) {
sourceBuilder.query(rangeQueryBuilder);
} else if (IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
} else if (IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
sourceBuilder.query(
Query.bool()
.must(rangeQueryBuilder)
......
......@@ -51,7 +51,7 @@ public class ProfileTaskLogEsDAO extends EsDAO implements IProfileTaskLogQueryDA
final String index = IndexController.LogicIndicesRegister.getPhysicalTableName(
ProfileTaskLogRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProfileTaskLogRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProfileTaskLogRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, ProfileTaskLogRecord.INDEX_NAME));
}
final SearchBuilder search =
......
......@@ -53,7 +53,7 @@ public class ProfileTaskQueryEsDAO extends EsDAO implements IProfileTaskQueryDAO
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(ProfileTaskRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProfileTaskRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProfileTaskRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, ProfileTaskRecord.INDEX_NAME));
}
......
......@@ -66,7 +66,7 @@ public class ProfileThreadSnapshotQueryEsDAO extends EsDAO
Query.bool()
.must(Query.term(ProfileThreadSnapshotRecord.TASK_ID, taskId))
.must(Query.term(ProfileThreadSnapshotRecord.SEQUENCE, 0));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ProfileThreadSnapshotRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ProfileThreadSnapshotRecord.INDEX_NAME)) {
segmentIdQuery.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, ProfileThreadSnapshotRecord.INDEX_NAME));
}
......
......@@ -55,7 +55,7 @@ public class RecordsQueryEsDAO extends EsDAO implements IRecordsQueryDAO {
.must(Query.range(TopN.TIME_BUCKET)
.gte(duration.getStartTimeBucketInSec())
.lte(duration.getEndTimeBucketInSec()));
if (IndexController.LogicIndicesRegister.isPhysicalTable(condition.getName())) {
if (IndexController.LogicIndicesRegister.isMergedTable(condition.getName())) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, condition.getName()));
}
......
......@@ -46,7 +46,7 @@ public class ServiceLabelEsDAO extends EsDAO implements IServiceLabelDAO {
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(ServiceLabelRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ServiceLabelRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ServiceLabelRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ServiceLabelRecord.INDEX_NAME));
}
query.must(Query.term(ServiceLabelRecord.SERVICE_ID, serviceId));
......
......@@ -55,7 +55,7 @@ public class SpanAttachedEventEsDAO extends EsDAO implements ISpanAttachedEventQ
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(SpanAttachedEventRecord.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(SpanAttachedEventRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(SpanAttachedEventRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, SpanAttachedEventRecord.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(scrollingBatchSize);
......
......@@ -62,7 +62,7 @@ public class TagAutoCompleteQueryDAO extends EsDAO implements ITagAutoCompleteQu
}
BoolQueryBuilder query = Query.bool();
query.must(Query.term(TagAutocompleteData.TAG_TYPE, tagType.name()));
if (IndexController.LogicIndicesRegister.isPhysicalTable(TagAutocompleteData.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(TagAutocompleteData.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, TagAutocompleteData.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query);
......@@ -103,7 +103,7 @@ public class TagAutoCompleteQueryDAO extends EsDAO implements ITagAutoCompleteQu
}
BoolQueryBuilder query = Query.bool().must(Query.term(TagAutocompleteData.TAG_KEY, tagKey));
query.must(Query.term(TagAutocompleteData.TAG_TYPE, tagType.name()));
if (IndexController.LogicIndicesRegister.isPhysicalTable(TagAutocompleteData.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(TagAutocompleteData.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, TagAutocompleteData.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(limit);
......
......@@ -87,7 +87,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
.must(Query.range(ServiceRelationServerSideMetrics.TIME_BUCKET)
.gte(duration.getStartTimeBucket())
.lte(duration.getEndTimeBucket()));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ServiceRelationServerSideMetrics.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ServiceRelationServerSideMetrics.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ServiceRelationServerSideMetrics.INDEX_NAME));
}
sourceBuilder.query(query).size(0);
......@@ -103,7 +103,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
.must(Query.range(ServiceRelationClientSideMetrics.TIME_BUCKET)
.gte(duration.getStartTimeBucket())
.lte(duration.getEndTimeBucket()));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ServiceRelationClientSideMetrics.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ServiceRelationClientSideMetrics.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ServiceRelationClientSideMetrics.INDEX_NAME));
}
sourceBuilder.query(query).size(0);
......@@ -173,7 +173,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
.gte(duration.getStartTimeBucket())
.lte(duration.getEndTimeBucket()))
.must(serviceIdBoolQuery);
if (IndexController.LogicIndicesRegister.isPhysicalTable(indexName)) {
if (IndexController.LogicIndicesRegister.isMergedTable(indexName)) {
boolQuery.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, indexName));
}
search.query(boolQuery);
......@@ -199,7 +199,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
Query.term(
EndpointRelationServerSideMetrics.DEST_ENDPOINT, destEndpointId
));
if (IndexController.LogicIndicesRegister.isPhysicalTable(EndpointRelationServerSideMetrics.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(EndpointRelationServerSideMetrics.INDEX_NAME)) {
boolQuery.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, EndpointRelationServerSideMetrics.INDEX_NAME));
}
sourceBuilder.query(boolQuery);
......@@ -242,7 +242,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
ProcessRelationServerSideMetrics.INDEX_NAME : ProcessRelationClientSideMetrics.INDEX_NAME;
final String index = IndexController.LogicIndicesRegister.getPhysicalTableName(indexName);
if (IndexController.LogicIndicesRegister.isPhysicalTable(indexName)) {
if (IndexController.LogicIndicesRegister.isMergedTable(indexName)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, indexName));
}
final SearchResponse response = getClient().search(index, sourceBuilder.build());
......@@ -385,7 +385,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
final BoolQueryBuilder serviceIdBoolQuery = Query.bool();
query.must(serviceIdBoolQuery);
if (IndexController.LogicIndicesRegister.isPhysicalTable(indexName)) {
if (IndexController.LogicIndicesRegister.isMergedTable(indexName)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, indexName));
}
if (serviceIds.size() == 1) {
......
......@@ -81,7 +81,7 @@ public class TraceQueryEsDAO extends EsDAO implements ITraceQueryDAO {
endSecondTB = duration.getEndTimeBucketInSec();
}
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(SegmentRecord.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(SegmentRecord.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.RECORD_TABLE_NAME, SegmentRecord.INDEX_NAME));
}
......
......@@ -67,7 +67,7 @@ public class ZipkinQueryEsDAO extends EsDAO implements IZipkinQueryDAO {
final String index =
IndexController.LogicIndicesRegister.getPhysicalTableName(ZipkinServiceTraffic.INDEX_NAME);
final BoolQueryBuilder query = Query.bool();
if (IndexController.LogicIndicesRegister.isPhysicalTable(ZipkinServiceTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ZipkinServiceTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ZipkinServiceTraffic.INDEX_NAME));
}
final SearchBuilder search = Search.builder().query(query).size(SCROLLING_BATCH_SIZE);
......@@ -102,7 +102,7 @@ public class ZipkinQueryEsDAO extends EsDAO implements IZipkinQueryDAO {
String index = IndexController.LogicIndicesRegister.getPhysicalTableName(
ZipkinServiceRelationTraffic.INDEX_NAME);
BoolQueryBuilder query = Query.bool().must(Query.term(ZipkinServiceRelationTraffic.SERVICE_NAME, serviceName));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ZipkinServiceRelationTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ZipkinServiceRelationTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ZipkinServiceRelationTraffic.INDEX_NAME));
}
SearchBuilder search = Search.builder().query(query).size(NAME_QUERY_MAX_SIZE);
......@@ -121,7 +121,7 @@ public class ZipkinQueryEsDAO extends EsDAO implements IZipkinQueryDAO {
public List<String> getSpanNames(final String serviceName) {
String index = IndexController.LogicIndicesRegister.getPhysicalTableName(ZipkinServiceSpanTraffic.INDEX_NAME);
BoolQueryBuilder query = Query.bool().must(Query.term(ZipkinServiceSpanTraffic.SERVICE_NAME, serviceName));
if (IndexController.LogicIndicesRegister.isPhysicalTable(ZipkinServiceSpanTraffic.INDEX_NAME)) {
if (IndexController.LogicIndicesRegister.isMergedTable(ZipkinServiceSpanTraffic.INDEX_NAME)) {
query.must(Query.term(IndexController.LogicIndicesRegister.METRIC_TABLE_NAME, ZipkinServiceSpanTraffic.INDEX_NAME));
}
SearchBuilder search = Search.builder().query(query).size(NAME_QUERY_MAX_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册