use of org.apache.accumulo.core.iterators.conf.ColumnSet in project teiid by teiid.
the class BaseFilterIterator method init.
@Override
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) throws IOException {
super.init(source, options, env);
String cf = options.get(AccumuloMetadataProcessor.CF);
String cq = options.get(AccumuloMetadataProcessor.CQ);
if (options.get(AccumuloMetadataProcessor.VALUE_IN) != null) {
String value = options.get(AccumuloMetadataProcessor.VALUE_IN);
this.valueIn = AccumuloMetadataProcessor.ValueIn.valueOf(value.substring(1, value.length() - 1));
} else {
this.valueIn = AccumuloMetadataProcessor.ValueIn.VALUE;
}
if (cq != null) {
// $NON-NLS-1$
this.columnFilter = new ColumnSet(Arrays.asList(cf + ":" + cq));
} else {
this.columnFilter = new ColumnSet(Arrays.asList(cf));
}
this.negate = false;
if (options.get(NEGATE) != null) {
this.negate = Boolean.parseBoolean(options.get(NEGATE));
}
}
use of org.apache.accumulo.core.iterators.conf.ColumnSet in project Gaffer by gchq.
the class CoreKeyGroupByCombiner method init.
@Override
public void init(final SortedKeyValueIterator<Key, Value> source, final Map<String, String> options, final IteratorEnvironment env) throws IOException {
super.init(source, options, env);
try {
schema = Schema.fromJson(options.get(AccumuloStoreConstants.SCHEMA).getBytes(CommonConstants.UTF_8));
} catch (final UnsupportedEncodingException e) {
throw new SchemaException("Unable to deserialise the schema", e);
}
LOGGER.debug("Initialising CoreKeyGroupByCombiner with schema {}", schema);
try {
view = View.fromJson(options.get(AccumuloStoreConstants.VIEW).getBytes(CommonConstants.UTF_8));
} catch (final UnsupportedEncodingException e) {
throw new SchemaException("Unable to deserialise the view", e);
}
LOGGER.debug("Initialising CoreKeyGroupByCombiner with view {}", view);
final String elementConverterClass = options.get(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS);
try {
elementConverter = Class.forName(elementConverterClass).asSubclass(AccumuloElementConverter.class).getConstructor(Schema.class).newInstance(schema);
LOGGER.debug("Creating AccumuloElementConverter of class {}", elementConverterClass);
} catch (final ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
throw new AggregationException("Failed to create element converter of the class name provided (" + elementConverterClass + ")", e);
}
final String encodedColumns = options.get(COLUMNS_OPTION);
if (StringUtils.isNotEmpty(encodedColumns)) {
aggregatedGroups = new ColumnSet(Lists.newArrayList(Splitter.on(",").split(encodedColumns)));
LOGGER.debug("Setting aggregatedGroups to {}", aggregatedGroups);
}
}
Aggregations