public AbstractCoreKeyAccumuloElementConverter(final Schema schema) { this.schema = schema; this.timestampProperty = null != schema ? schema.getConfig(AccumuloStoreConstants.TIMESTAMP_PROPERTY) : null; this.aggregatedGroups = null != schema ? Sets.newHashSet(schema.getAggregatedGroups()) : Collections.emptySet(); }
public MapImpl(final Schema schema, final MapStoreProperties mapStoreProperties) { this.schema = schema; propertyAggregator = new AggregatorUtil.IngestPropertiesBinaryOperator(schema); mapFactory = createMapFactory(schema, mapStoreProperties); maintainIndex = mapStoreProperties.getCreateIndex(); for (final String group : schema.getGroups()) { aggElements.put(group, mapFactory.getMap(group + "|" + AGG_ELEMENTS, Element.class, GroupedProperties.class)); nonAggElements.put(group, mapFactory.getMap(group + "|" + NON_AGG_ELEMENTS, Element.class, Long.class)); } if (maintainIndex) { entityIdToElements = mapFactory.getMultiMap(ENTITY_ID_TO_ELEMENTS, EntityId.class, Element.class); edgeIdToElements = mapFactory.getMultiMap(EDGE_ID_TO_ELEMENTS, EdgeId.class, Element.class); } else { entityIdToElements = null; edgeIdToElements = null; } this.aggregatedGroups = schema.getAggregatedGroups(); schema.getEntityGroups().forEach(this::addToGroupByMap); schema.getEdgeGroups().forEach(this::addToGroupByMap); }
@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; }
@Override public IteratorSetting getQueryTimeAggregatorIteratorSetting(final View view, final AccumuloStore store) throws IteratorSettingException { if (!queryTimeAggregatorRequired(view, store)) { LOGGER.debug("Returning null from getQueryTimeAggregatorIteratorSetting as queryTimeAggregatorRequired(view, store) = {}", queryTimeAggregatorRequired(view, store)); return null; } final IteratorSetting is = new IteratorSettingBuilder(AccumuloStoreConstants.COLUMN_QUALIFIER_AGGREGATOR_ITERATOR_PRIORITY, AccumuloStoreConstants.COLUMN_QUALIFIER_AGGREGATOR_ITERATOR_NAME, CoreKeyGroupByAggregatorIterator.class) .combinerColumnFamilies(store.getSchema().getAggregatedGroups()) .schema(store.getSchema()) .view(view) .keyConverter(store.getKeyPackage().getKeyConverter()) .build(); LOGGER.debug("Creating IteratorSetting for iterator class {} with priority = {}, " + "combinerColumnFamilies = {}, schema = {}, view = {}, keyConverter = {}", CoreKeyGroupByAggregatorIterator.class.getName(), AccumuloStoreConstants.COLUMN_QUALIFIER_AGGREGATOR_ITERATOR_PRIORITY, store.getSchema().getAggregatedGroups(), store.getSchema(), view, store.getKeyPackage().getKeyConverter()); return is; }
@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; }