use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class CoreKeyGroupByAggregatorIteratorTest method setup.
@BeforeClass
public static void setup() throws StoreException, AccumuloException, AccumuloSecurityException, IOException {
byteEntityStore = new SingleUseMockAccumuloStore();
gaffer1KeyStore = new SingleUseMockAccumuloStore();
gaffer1ElementConverter = new ClassicAccumuloElementConverter(schema);
byteEntityElementConverter = new ByteEntityAccumuloElementConverter(schema);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class BloomFilterIT method setup.
@Before
public void setup() {
Schema schema = new Schema.Builder().type(TestTypes.PROP_INTEGER, Integer.class).vertexSerialiser(new JavaSerialiser()).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().property(AccumuloPropertyNames.INT, TestTypes.PROP_INTEGER).build()).entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().property(AccumuloPropertyNames.INT, TestTypes.PROP_INTEGER).build()).build();
byteEntityRangeFactory = new ByteEntityRangeFactory(schema);
byteEntityElementConverter = new ByteEntityAccumuloElementConverter(schema);
Gaffer1RangeFactory = new ClassicRangeFactory(schema);
gafferV1ElementConverter = new ClassicAccumuloElementConverter(schema);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class ElementPostAggregationFilterTest method shouldAcceptElementWhenViewValidatorAcceptsElement.
@Test
public void shouldAcceptElementWhenViewValidatorAcceptsElement() throws Exception {
// Given
final AbstractElementFilter filter = new ElementPostAggregationFilter();
final Map<String, String> options = new HashMap<>();
options.put(AccumuloStoreConstants.SCHEMA, getSchemaJson());
options.put(AccumuloStoreConstants.VIEW, getViewJson());
options.put(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS, ByteEntityAccumuloElementConverter.class.getName());
filter.validateOptions(options);
final ByteEntityAccumuloElementConverter converter = new ByteEntityAccumuloElementConverter(getSchema());
final Element element = new Edge(TestGroups.EDGE, "source", "dest", true);
final Pair<Key> key = converter.getKeysFromElement(element);
final Value value = converter.getValueFromElement(element);
// When
final boolean accept = filter.accept(key.getFirst(), value);
// Then
assertTrue(accept);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class ElementPostAggregationFilterTest method shouldNotAcceptElementWhenViewValidatorDoesNotAcceptElement.
@Test
public void shouldNotAcceptElementWhenViewValidatorDoesNotAcceptElement() throws Exception {
// Given
final AbstractElementFilter filter = new ElementPostAggregationFilter();
final Map<String, String> options = new HashMap<>();
options.put(AccumuloStoreConstants.SCHEMA, getSchemaJson());
options.put(AccumuloStoreConstants.VIEW, getEmptyViewJson());
options.put(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS, ByteEntityAccumuloElementConverter.class.getName());
filter.validateOptions(options);
final ByteEntityAccumuloElementConverter converter = new ByteEntityAccumuloElementConverter(getSchema());
final Element element = new Edge(TestGroups.EDGE, "source", "dest", true);
final Pair<Key> key = converter.getKeysFromElement(element);
final Value value = converter.getValueFromElement(element);
// When
final boolean accept = filter.accept(key.getFirst(), value);
// Then
assertFalse(accept);
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.byteEntity.ByteEntityAccumuloElementConverter in project Gaffer by gchq.
the class ElementPreAggregationFilterTest method shouldAcceptElementWhenViewValidatorAcceptsElement.
@Test
public void shouldAcceptElementWhenViewValidatorAcceptsElement() throws Exception {
// Given
final AbstractElementFilter filter = new ElementPreAggregationFilter();
final Map<String, String> options = new HashMap<>();
options.put(AccumuloStoreConstants.SCHEMA, getSchemaJson());
options.put(AccumuloStoreConstants.VIEW, getViewJson());
options.put(AccumuloStoreConstants.ACCUMULO_ELEMENT_CONVERTER_CLASS, ByteEntityAccumuloElementConverter.class.getName());
filter.validateOptions(options);
final ByteEntityAccumuloElementConverter converter = new ByteEntityAccumuloElementConverter(getSchema());
final Element element = new Edge(TestGroups.EDGE, "source", "dest", true);
final Pair<Key> key = converter.getKeysFromElement(element);
final Value value = converter.getValueFromElement(element);
// When
final boolean accept = filter.accept(key.getFirst(), value);
// Then
assertTrue(accept);
}
Aggregations