use of uk.gov.gchq.gaffer.accumulostore.retriever.impl.AccumuloRangeIDRetriever in project Gaffer by gchq.
the class SummariseGroupOverRangesHandler method doOperation.
public CloseableIterable<Element> doOperation(final SummariseGroupOverRanges<Pair<ElementSeed>, Element> operation, final User user, final AccumuloStore store) throws OperationException {
final int numEdgeGroups = operation.getView().getEdgeGroups().size();
final int numEntityGroups = operation.getView().getEntityGroups().size();
if ((numEdgeGroups + numEntityGroups) != 1) {
throw new OperationException("You may only set one Group in your view for this operation.");
}
final String columnFamily;
if (numEdgeGroups == 1) {
columnFamily = (String) operation.getView().getEdgeGroups().toArray()[0];
} else {
columnFamily = (String) operation.getView().getEntityGroups().toArray()[0];
}
final IteratorSettingFactory itrFactory = store.getKeyPackage().getIteratorFactory();
try {
return new AccumuloRangeIDRetriever(store, operation, user, itrFactory.getElementPreAggregationFilterIteratorSetting(operation.getView(), store), itrFactory.getElementPostAggregationFilterIteratorSetting(operation.getView(), store), itrFactory.getEdgeEntityDirectionFilterIteratorSetting(operation), itrFactory.getElementPropertyRangeQueryFilter(operation), itrFactory.getRowIDAggregatorIteratorSetting(store, columnFamily));
} catch (IteratorSettingException | StoreException e) {
throw new OperationException("Failed to get elements", e);
}
}
use of uk.gov.gchq.gaffer.accumulostore.retriever.impl.AccumuloRangeIDRetriever in project Gaffer by gchq.
the class SummariseGroupOverRangesHandler method doOperation.
public CloseableIterable<? extends Element> doOperation(final SummariseGroupOverRanges operation, final User user, final AccumuloStore store) throws OperationException {
final int numEdgeGroups = operation.getView().getEdgeGroups().size();
final int numEntityGroups = operation.getView().getEntityGroups().size();
if ((numEdgeGroups + numEntityGroups) != 1) {
throw new OperationException("You may only set one Group in your view for this operation.");
}
final String columnFamily;
if (numEdgeGroups == 1) {
columnFamily = (String) operation.getView().getEdgeGroups().toArray()[0];
} else {
columnFamily = (String) operation.getView().getEntityGroups().toArray()[0];
}
final IteratorSettingFactory itrFactory = store.getKeyPackage().getIteratorFactory();
try {
return new AccumuloRangeIDRetriever<>(store, operation, user, itrFactory.getElementPreAggregationFilterIteratorSetting(operation.getView(), store), itrFactory.getElementPostAggregationFilterIteratorSetting(operation.getView(), store), itrFactory.getEdgeEntityDirectionFilterIteratorSetting(operation), itrFactory.getElementPropertyRangeQueryFilter(operation), itrFactory.getRowIDAggregatorIteratorSetting(store, columnFamily));
} catch (final IteratorSettingException | StoreException e) {
throw new OperationException("Failed to get elements", e);
}
}
Aggregations