Search in sources :

Example 1 with RecordFilter

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);
}
Also used : RecordFilter(org.apache.hadoop.hbase.hbtop.RecordFilter)

Example 2 with RecordFilter

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());
}
Also used : RecordFilter(org.apache.hadoop.hbase.hbtop.RecordFilter) Arrays(java.util.Arrays) ServerMetrics(org.apache.hadoop.hbase.ServerMetrics) ClusterMetrics(org.apache.hadoop.hbase.ClusterMetrics) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) List(java.util.List) InterfaceAudience(org.apache.yetus.audience.InterfaceAudience) Field(org.apache.hadoop.hbase.hbtop.field.Field) FieldInfo(org.apache.hadoop.hbase.hbtop.field.FieldInfo) Map(java.util.Map) Record(org.apache.hadoop.hbase.hbtop.Record) Collections(java.util.Collections) ArrayList(java.util.ArrayList) Record(org.apache.hadoop.hbase.hbtop.Record) ServerMetrics(org.apache.hadoop.hbase.ServerMetrics)

Example 3 with RecordFilter

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;
}
Also used : RecordFilter(org.apache.hadoop.hbase.hbtop.RecordFilter)

Aggregations

RecordFilter (org.apache.hadoop.hbase.hbtop.RecordFilter)3 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 ClusterMetrics (org.apache.hadoop.hbase.ClusterMetrics)1 ServerMetrics (org.apache.hadoop.hbase.ServerMetrics)1 Record (org.apache.hadoop.hbase.hbtop.Record)1 Field (org.apache.hadoop.hbase.hbtop.field.Field)1 FieldInfo (org.apache.hadoop.hbase.hbtop.field.FieldInfo)1 InterfaceAudience (org.apache.yetus.audience.InterfaceAudience)1