use of uk.gov.gchq.gaffer.data.element.LazyEntity in project Gaffer by gchq.
the class AbstractElementFilter method accept.
@Override
public boolean accept(final Key key, final Value value) {
final String group = elementConverter.getGroupFromColumnFamily(key.getColumnFamilyData().getBackingArray());
if (groupsWithoutFilters.contains(group)) {
return true;
}
final Element element;
if (schema.isEntity(group)) {
element = new LazyEntity(new Entity(group), new AccumuloEntityValueLoader(group, key, value, elementConverter, schema));
} else {
element = new LazyEdge(new Edge(group, null, null, false), new AccumuloEdgeValueLoader(group, key, value, elementConverter, schema, true));
}
return elementPredicate.test(element);
}
use of uk.gov.gchq.gaffer.data.element.LazyEntity in project Gaffer by gchq.
the class StoreTest method shouldFullyLoadLazyElement.
@Test
public void shouldFullyLoadLazyElement() throws StoreException {
// Given
final StoreProperties properties = mock(StoreProperties.class);
final LazyEntity lazyElement = mock(LazyEntity.class);
final Entity entity = mock(Entity.class);
final Store store = new StoreImpl();
given(lazyElement.getGroup()).willReturn(TestGroups.ENTITY);
given(lazyElement.getElement()).willReturn(entity);
given(properties.getJobExecutorThreadCount()).willReturn(1);
store.initialise("graphId", schema, properties);
// When
final Element result = store.populateElement(lazyElement);
// Then
assertSame(entity, result);
verify(lazyElement).getGroup();
verify(lazyElement).getProperty(TestPropertyNames.PROP_1);
verify(lazyElement).getIdentifier(IdentifierType.VERTEX);
}
Aggregations