Search in sources :

Example 1 with TCompactionType

use of org.apache.accumulo.core.tabletserver.thrift.TCompactionType in project accumulo by apache.

the class CompactionInfo method toThrift.

public ActiveCompaction toThrift() {
    TCompactionType type;
    if (compactor.hasIMM())
        if (!compactor.getFilesToCompact().isEmpty())
            type = TCompactionType.MERGE;
        else
            type = TCompactionType.MINOR;
    else if (!compactor.willPropagateDeletes())
        type = TCompactionType.FULL;
    else
        type = TCompactionType.MAJOR;
    List<IterInfo> iiList = new ArrayList<>();
    Map<String, Map<String, String>> iterOptions = new HashMap<>();
    for (IteratorSetting iterSetting : compactor.getIterators()) {
        iiList.add(new IterInfo(iterSetting.getPriority(), iterSetting.getIteratorClass(), iterSetting.getName()));
        iterOptions.put(iterSetting.getName(), iterSetting.getOptions());
    }
    List<String> files = compactor.getFilesToCompact().stream().map(StoredTabletFile::getPathStr).collect(Collectors.toList());
    return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.getStartTime(), files, compactor.getOutputFile(), type, reason, localityGroup, entriesRead, entriesWritten, iiList, iterOptions);
}
Also used : ActiveCompaction(org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction) IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IterInfo(org.apache.accumulo.core.dataImpl.thrift.IterInfo) Map(java.util.Map) HashMap(java.util.HashMap) TCompactionType(org.apache.accumulo.core.tabletserver.thrift.TCompactionType)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)1 IterInfo (org.apache.accumulo.core.dataImpl.thrift.IterInfo)1 ActiveCompaction (org.apache.accumulo.core.tabletserver.thrift.ActiveCompaction)1 TCompactionType (org.apache.accumulo.core.tabletserver.thrift.TCompactionType)1