use of uk.gov.gchq.gaffer.store.schema.SchemaOptimiser in project Gaffer by gchq.
the class StoreTest method setup.
@BeforeEach
public void setup() {
System.clearProperty(JSONSerialiser.JSON_SERIALISER_CLASS_KEY);
System.clearProperty(JSONSerialiser.JSON_SERIALISER_MODULES);
JSONSerialiser.update();
schemaOptimiser = mock(SchemaOptimiser.class);
operationChainValidator = mock(OperationChainValidator.class);
store = new StoreImpl();
given(operationChainValidator.validate(any(OperationChain.class), any(User.class), any(Store.class))).willReturn(new ValidationResult());
addElementsHandler = mock(OperationHandler.class);
getElementsHandler = mock(OutputOperationHandler.class);
getAllElementsHandler = mock(OutputOperationHandler.class);
getAdjacentIdsHandler = mock(OutputOperationHandler.class);
validateHandler = mock(OperationHandler.class);
exportToGafferResultCacheHandler = mock(OperationHandler.class);
getGafferResultCacheExportHandler = mock(OperationHandler.class);
jobTracker = mock(JobTracker.class);
schema = new Schema.Builder().edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source("string").destination("string").directed("true").property(TestPropertyNames.PROP_1, "string").property(TestPropertyNames.PROP_2, "string").build()).edge(TestGroups.EDGE_2, new SchemaEdgeDefinition.Builder().source("string").destination("string").directed("true").property(TestPropertyNames.PROP_1, "string").property(TestPropertyNames.PROP_2, "string").build()).entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex("string").property(TestPropertyNames.PROP_1, "string").property(TestPropertyNames.PROP_2, "string").build()).entity(TestGroups.ENTITY_2, new SchemaEntityDefinition.Builder().vertex("string").property(TestPropertyNames.PROP_1, "string").property(TestPropertyNames.PROP_2, "string").build()).type("string", new TypeDefinition.Builder().clazz(String.class).serialiser(new StringSerialiser()).aggregateFunction(new StringConcat()).build()).type("true", Boolean.class).build();
}
use of uk.gov.gchq.gaffer.store.schema.SchemaOptimiser in project Gaffer by gchq.
the class TestUtils method gafferSchema.
public static Schema gafferSchema(final String schemaFolder) {
final Schema schema = Schema.fromJson(StreamUtil.openStreams(TestUtils.class, schemaFolder));
final SchemaOptimiser schemaOptimiser = new SchemaOptimiser(new SerialisationFactory(ParquetStore.SERIALISERS));
return schemaOptimiser.optimise(schema, true);
}
Aggregations