use of org.apache.accumulo.core.client.summary.SummarizerConfiguration.Builder in project accumulo by apache.
the class SummarizerConfigurationUtil method getSummarizerConfigsFiltered.
private static List<SummarizerConfiguration> getSummarizerConfigsFiltered(SortedMap<String, String> sprops) {
if (sprops.size() == 0) {
return Collections.emptyList();
}
SummarizerConfiguration.Builder builder = null;
List<SummarizerConfiguration> configs = new ArrayList<>();
final int preLen = Property.TABLE_SUMMARIZER_PREFIX.getKey().length();
for (Entry<String, String> entry : sprops.entrySet()) {
String k = entry.getKey().substring(preLen);
String[] tokens = k.split("\\.");
String id = tokens[0];
if (tokens.length == 1) {
if (builder != null) {
configs.add(builder.build());
}
builder = SummarizerConfiguration.builder(entry.getValue()).setPropertyId(id);
} else if (tokens.length == 3 || tokens[1].equals("opt")) {
builder.addOption(tokens[2], entry.getValue());
} else {
throw new IllegalArgumentException("Unable to parse summarizer property : " + k);
}
}
configs.add(builder.build());
return configs;
}
use of org.apache.accumulo.core.client.summary.SummarizerConfiguration.Builder in project accumulo by apache.
the class SummarizerConfigurationUtil method fromThrift.
public static SummarizerConfiguration fromThrift(TSummarizerConfiguration config) {
Builder builder = SummarizerConfiguration.builder(config.getClassname());
builder.setPropertyId(config.getConfigId());
builder.addOptions(config.getOptions());
return builder.build();
}
Aggregations