use of org.apache.hadoop.hbase.hbtop.RecordFilter in project hbase by apache.
the class TopScreenModel method decomposePushDownFilter.
private void decomposePushDownFilter() {
pushDownFilters.clear();
for (RecordFilter filter : filters) {
if (!fields.contains(filter.getField())) {
pushDownFilters.add(filter);
}
}
filters.removeAll(pushDownFilters);
}
use of org.apache.hadoop.hbase.hbtop.RecordFilter in project hbase by apache.
the class RegionServerModeStrategy method getRecords.
@Override
public List<Record> getRecords(ClusterMetrics clusterMetrics, List<RecordFilter> pushDownFilters) {
// Get records from RegionModeStrategy and add REGION_COUNT field
List<Record> records = regionModeStrategy.selectModeFieldsAndAddCountField(fieldInfos, regionModeStrategy.getRecords(clusterMetrics, pushDownFilters), Field.REGION_COUNT);
// Aggregation by LONG_REGION_SERVER field
Map<String, Record> retMap = ModeStrategyUtils.aggregateRecords(records, Field.LONG_REGION_SERVER).stream().collect(Collectors.toMap(r -> r.get(Field.LONG_REGION_SERVER).asString(), r -> r));
// Add USED_HEAP_SIZE field and MAX_HEAP_SIZE field
for (ServerMetrics sm : clusterMetrics.getLiveServerMetrics().values()) {
Record record = retMap.get(sm.getServerName().getServerName());
if (record == null) {
continue;
}
Record newRecord = Record.builder().putAll(record).put(Field.USED_HEAP_SIZE, sm.getUsedHeapSize()).put(Field.MAX_HEAP_SIZE, sm.getMaxHeapSize()).build();
retMap.put(sm.getServerName().getServerName(), newRecord);
}
return new ArrayList<>(retMap.values());
}
use of org.apache.hadoop.hbase.hbtop.RecordFilter in project hbase by apache.
the class TopScreenModel method addFilter.
public boolean addFilter(String filterString, boolean ignoreCase) {
RecordFilter filter = RecordFilter.parse(filterString, fields, ignoreCase);
if (filter == null) {
return false;
}
filters.add(filter);
filterHistories.add(filterString);
return true;
}
Aggregations