use of org.apache.accumulo.core.client.admin.compaction.CompactionConfigurer in project accumulo by apache.
the class CompactableUtils method computeOverrides.
static Map<String, String> computeOverrides(Tablet tablet, Set<CompactableFile> files, PluginConfig cfg) {
CompactionConfigurer configurer = CompactableUtils.newInstance(tablet.getTableConfiguration(), cfg.getClassName(), CompactionConfigurer.class);
final ServiceEnvironment senv = new ServiceEnvironmentImpl(tablet.getContext());
configurer.init(new CompactionConfigurer.InitParameters() {
@Override
public Map<String, String> getOptions() {
return cfg.getOptions();
}
@Override
public PluginEnvironment getEnvironment() {
return senv;
}
@Override
public TableId getTableId() {
return tablet.getExtent().tableId();
}
});
var overrides = configurer.override(new CompactionConfigurer.InputParameters() {
@Override
public Collection<CompactableFile> getInputFiles() {
return files;
}
@Override
public PluginEnvironment getEnvironment() {
return senv;
}
@Override
public TableId getTableId() {
return tablet.getExtent().tableId();
}
});
if (overrides.getOverrides().isEmpty()) {
return null;
}
return overrides.getOverrides();
}
Aggregations