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);
}
Aggregations