Search in sources :

Example 16 with IteratorSettingBuilder

use of uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder in project Gaffer by gchq.

the class AbstractCoreKeyIteratorSettingsFactory method getRowIDAggregatorIteratorSetting.

@Override
public IteratorSetting getRowIDAggregatorIteratorSetting(final AccumuloStore store, final String columnFamily) throws IteratorSettingException {
    if (!store.getSchema().isAggregationEnabled()) {
        LOGGER.debug("Returning null from getRowIDAggregatorIteratorSetting as store.getSchema().isAggregationEnabled() = {}", store.getSchema().isAggregationEnabled());
        return null;
    }
    final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.ROW_ID_AGGREGATOR_ITERATOR_PRIORITY, AccumuloStoreConstants.ROW_ID_AGGREGATOR_ITERATOR_NAME, RowIDAggregator.class).combinerColumnFamilies(store.getSchema().getAggregatedGroups()).columnFamily(columnFamily).schema(store.getSchema()).keyConverter(store.getKeyPackage().getKeyConverter()).build();
    LOGGER.debug("Creating IteratorSetting for iterator class {} with priority = {}, " + "combinerColumnFamilies = {}, columnFamily = {}, " + "schema = {}, view = {}, keyConverter = {}", RowIDAggregator.class.getName(), AccumuloStoreConstants.ROW_ID_AGGREGATOR_ITERATOR_PRIORITY, store.getSchema().getAggregatedGroups(), columnFamily, store.getSchema(), store.getKeyPackage().getKeyConverter());
    return is;
}
Also used : IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) RowIDAggregator(uk.gov.gchq.gaffer.accumulostore.key.impl.RowIDAggregator) IteratorSettingBuilder(uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder)

Example 17 with IteratorSettingBuilder

use of uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder in project Gaffer by gchq.

the class AbstractCoreKeyIteratorSettingsFactory method getAggregatorIteratorSetting.

@Override
public IteratorSetting getAggregatorIteratorSetting(final AccumuloStore store) throws IteratorSettingException {
    final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.AGGREGATOR_ITERATOR_PRIORITY, AccumuloStoreConstants.AGGREGATOR_ITERATOR_NAME, AggregatorIterator.class).combinerColumnFamilies(store.getSchema().getAggregatedGroups()).schema(store.getSchema()).keyConverter(store.getKeyPackage().getKeyConverter()).build();
    LOGGER.debug("Creating IteratorSetting for iterator class {} with priority = {}, " + "combinerColumnFamilies = {}, schema = {}, keyConverter = {}", AggregatorIterator.class.getName(), AccumuloStoreConstants.AGGREGATOR_ITERATOR_PRIORITY, store.getSchema().getAggregatedGroups(), store.getSchema(), store.getKeyPackage().getKeyConverter());
    return is;
}
Also used : IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) IteratorSettingBuilder(uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder) CoreKeyGroupByAggregatorIterator(uk.gov.gchq.gaffer.accumulostore.key.core.impl.CoreKeyGroupByAggregatorIterator) AggregatorIterator(uk.gov.gchq.gaffer.accumulostore.key.impl.AggregatorIterator)

Example 18 with IteratorSettingBuilder

use of uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder in project Gaffer by gchq.

the class AbstractCoreKeyIteratorSettingsFactory method getValidatorIteratorSetting.

@Override
public IteratorSetting getValidatorIteratorSetting(final AccumuloStore store) {
    if (!store.getSchema().hasValidation()) {
        LOGGER.debug("Returning null from getValidatorIteratorSetting as store.getSchema().hasValidation() = {}", store.getSchema().hasValidation());
        return null;
    }
    final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.VALIDATOR_ITERATOR_PRIORITY, AccumuloStoreConstants.VALIDATOR_ITERATOR_NAME, ValidatorFilter.class).schema(store.getSchema()).keyConverter(store.getKeyPackage().getKeyConverter()).build();
    LOGGER.debug("Creating IteratorSetting for iterator class {} with priority = {}, " + "schema = {}, keyConverter = {}", ValidatorFilter.class.getName(), AccumuloStoreConstants.VALIDATOR_ITERATOR_PRIORITY, store.getSchema(), store.getKeyPackage().getKeyConverter());
    return is;
}
Also used : IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) IteratorSettingBuilder(uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder) ValidatorFilter(uk.gov.gchq.gaffer.accumulostore.key.impl.ValidatorFilter)

Example 19 with IteratorSettingBuilder

use of uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder in project Gaffer by gchq.

the class ClassicIteratorSettingsFactory method getEdgeEntityDirectionFilterIteratorSetting.

@Override
public IteratorSetting getEdgeEntityDirectionFilterIteratorSetting(final GraphFilters operation) {
    final boolean includeEntities = operation.getView().hasEntities();
    final boolean includeEdges = operation.getView().hasEdges();
    final DirectedType directedType = operation.getDirectedType();
    final IncludeIncomingOutgoingType inOutType;
    if (operation instanceof SeededGraphFilters) {
        inOutType = ((SeededGraphFilters) operation).getIncludeIncomingOutGoing();
    } else {
        inOutType = IncludeIncomingOutgoingType.OUTGOING;
    }
    final boolean deduplicateUndirectedEdges = operation instanceof GetAllElements;
    if ((null == inOutType || inOutType == IncludeIncomingOutgoingType.EITHER) && includeEdges && (DirectedType.isEither(directedType)) && !deduplicateUndirectedEdges) {
        LOGGER.debug("Returning null from getEdgeEntityDirectionFilterIteratorSetting (" + "inOutType = {}, includeEdges = {}, directedType = {}, deduplicateUndirectedEdges = {})", inOutType, includeEdges, directedType, deduplicateUndirectedEdges);
        return null;
    }
    final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_PRIORITY, AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_NAME, EDGE_DIRECTED_UNDIRECTED_FILTER).includeIncomingOutgoing(inOutType).directedType(directedType).includeEdges(includeEdges).includeEntities(includeEntities).deduplicateUndirectedEdges(deduplicateUndirectedEdges).build();
    LOGGER.debug("Creating IteratorSetting for iterator class {} with " + "priority = {}, includeIncomingOutgoing = {}, directedType = {}, " + "includeEdges = {}, includeEntities = {}, deduplicateUndirectedEdges = {}", EDGE_DIRECTED_UNDIRECTED_FILTER, AccumuloStoreConstants.EDGE_ENTITY_DIRECTED_UNDIRECTED_INCOMING_OUTGOING_FILTER_ITERATOR_PRIORITY, inOutType, directedType, includeEdges, includeEntities, deduplicateUndirectedEdges);
    return is;
}
Also used : IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) IncludeIncomingOutgoingType(uk.gov.gchq.gaffer.operation.graph.SeededGraphFilters.IncludeIncomingOutgoingType) GetAllElements(uk.gov.gchq.gaffer.operation.impl.get.GetAllElements) DirectedType(uk.gov.gchq.gaffer.data.element.id.DirectedType) SeededGraphFilters(uk.gov.gchq.gaffer.operation.graph.SeededGraphFilters) IteratorSettingBuilder(uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder)

Aggregations

IteratorSettingBuilder (uk.gov.gchq.gaffer.accumulostore.utils.IteratorSettingBuilder)19 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)16 Entry (java.util.Map.Entry)6 AccumuloException (org.apache.accumulo.core.client.AccumuloException)6 BatchWriter (org.apache.accumulo.core.client.BatchWriter)6 BatchWriterConfig (org.apache.accumulo.core.client.BatchWriterConfig)6 Scanner (org.apache.accumulo.core.client.Scanner)6 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)6 Key (org.apache.accumulo.core.data.Key)6 Mutation (org.apache.accumulo.core.data.Mutation)6 Value (org.apache.accumulo.core.data.Value)6 Authorizations (org.apache.accumulo.core.security.Authorizations)6 ColumnVisibility (org.apache.accumulo.core.security.ColumnVisibility)6 Edge (uk.gov.gchq.gaffer.data.element.Edge)6 Element (uk.gov.gchq.gaffer.data.element.Element)6 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)4 IncludeEdgeType (uk.gov.gchq.gaffer.operation.GetOperation.IncludeEdgeType)3 CoreKeyGroupByAggregatorIterator (uk.gov.gchq.gaffer.accumulostore.key.core.impl.CoreKeyGroupByAggregatorIterator)2 DirectedType (uk.gov.gchq.gaffer.data.element.id.DirectedType)2 IncludeIncomingOutgoingType (uk.gov.gchq.gaffer.operation.GetOperation.IncludeIncomingOutgoingType)2