Search in sources :

Example 1 with AccumuloRangeIDRetriever

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);
    }
}
Also used : IteratorSettingFactory(uk.gov.gchq.gaffer.accumulostore.key.IteratorSettingFactory) AccumuloRangeIDRetriever(uk.gov.gchq.gaffer.accumulostore.retriever.impl.AccumuloRangeIDRetriever) IteratorSettingException(uk.gov.gchq.gaffer.accumulostore.key.exception.IteratorSettingException) OperationException(uk.gov.gchq.gaffer.operation.OperationException) StoreException(uk.gov.gchq.gaffer.store.StoreException)

Example 2 with AccumuloRangeIDRetriever

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);
    }
}
Also used : IteratorSettingFactory(uk.gov.gchq.gaffer.accumulostore.key.IteratorSettingFactory) AccumuloRangeIDRetriever(uk.gov.gchq.gaffer.accumulostore.retriever.impl.AccumuloRangeIDRetriever) IteratorSettingException(uk.gov.gchq.gaffer.accumulostore.key.exception.IteratorSettingException) OperationException(uk.gov.gchq.gaffer.operation.OperationException) StoreException(uk.gov.gchq.gaffer.store.StoreException)

Aggregations

IteratorSettingFactory (uk.gov.gchq.gaffer.accumulostore.key.IteratorSettingFactory)2 IteratorSettingException (uk.gov.gchq.gaffer.accumulostore.key.exception.IteratorSettingException)2 AccumuloRangeIDRetriever (uk.gov.gchq.gaffer.accumulostore.retriever.impl.AccumuloRangeIDRetriever)2 OperationException (uk.gov.gchq.gaffer.operation.OperationException)2 StoreException (uk.gov.gchq.gaffer.store.StoreException)2