Search in sources :

Example 1 with ExportToSetHandler

use of uk.gov.gchq.gaffer.store.operation.handler.export.set.ExportToSetHandler in project Gaffer by gchq.

the class Store method addCoreOpHandlers.

private void addCoreOpHandlers() {
    // Add elements
    addOperationHandler(AddElements.class, getAddElementsHandler());
    // Get Elements
    addOperationHandler(GetElements.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetEntities.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetEdges.class, (OperationHandler) getGetElementsHandler());
    // Get Adjacent
    addOperationHandler(GetAdjacentEntitySeeds.class, (OperationHandler) getAdjacentEntitySeedsHandler());
    // Get All Elements
    addOperationHandler(GetAllElements.class, (OperationHandler) getGetAllElementsHandler());
    addOperationHandler(GetAllEntities.class, (OperationHandler) getGetAllElementsHandler());
    addOperationHandler(GetAllEdges.class, (OperationHandler) getGetAllElementsHandler());
    // Deprecated Get operations
    addOperationHandler(GetEdgesBySeed.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetElementsBySeed.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetEntitiesBySeed.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetRelatedEdges.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetRelatedElements.class, (OperationHandler) getGetElementsHandler());
    addOperationHandler(GetRelatedEntities.class, (OperationHandler) getGetElementsHandler());
    // Export
    addOperationHandler(ExportToSet.class, new ExportToSetHandler());
    addOperationHandler(GetSetExport.class, new GetSetExportHandler());
    addOperationHandler(GetExports.class, new GetExportsHandler());
    // Jobs
    addOperationHandler(GetJobDetails.class, new GetJobDetailsHandler());
    addOperationHandler(GetAllJobDetails.class, new GetAllJobDetailsHandler());
    addOperationHandler(GetJobResults.class, new GetJobResultsHandler());
    // Other
    addOperationHandler(GenerateElements.class, new GenerateElementsHandler<>());
    addOperationHandler(GenerateObjects.class, new GenerateObjectsHandler<>());
    addOperationHandler(Validate.class, new ValidateHandler());
    addOperationHandler(Deduplicate.class, new DeduplicateHandler());
    addOperationHandler(CountGroups.class, new CountGroupsHandler());
    addOperationHandler(Limit.class, new LimitHandler());
}
Also used : GetAllJobDetailsHandler(uk.gov.gchq.gaffer.store.operation.handler.job.GetAllJobDetailsHandler) LimitHandler(uk.gov.gchq.gaffer.store.operation.handler.LimitHandler) DeduplicateHandler(uk.gov.gchq.gaffer.store.operation.handler.DeduplicateHandler) GetJobDetailsHandler(uk.gov.gchq.gaffer.store.operation.handler.job.GetJobDetailsHandler) CountGroupsHandler(uk.gov.gchq.gaffer.store.operation.handler.CountGroupsHandler) GetExportsHandler(uk.gov.gchq.gaffer.store.operation.handler.export.GetExportsHandler) ValidateHandler(uk.gov.gchq.gaffer.store.operation.handler.ValidateHandler) GetJobResultsHandler(uk.gov.gchq.gaffer.store.operation.handler.job.GetJobResultsHandler) ExportToSetHandler(uk.gov.gchq.gaffer.store.operation.handler.export.set.ExportToSetHandler) GetSetExportHandler(uk.gov.gchq.gaffer.store.operation.handler.export.set.GetSetExportHandler)

Example 2 with ExportToSetHandler

use of uk.gov.gchq.gaffer.store.operation.handler.export.set.ExportToSetHandler in project Gaffer by gchq.

the class StoreTest method shouldCreateStoreWithValidSchemasAndRegisterOperations.

@Test
public void shouldCreateStoreWithValidSchemasAndRegisterOperations() throws StoreException {
    // Given
    final StoreProperties properties = mock(StoreProperties.class);
    final StoreImpl store = new StoreImpl();
    final OperationHandler<AddElements, Void> addElementsHandlerOverridden = mock(OperationHandler.class);
    final OperationDeclarations opDeclarations = new OperationDeclarations.Builder().declaration(new OperationDeclaration.Builder().operation(AddElements.class).handler(addElementsHandlerOverridden).build()).build();
    given(properties.getOperationDeclarations()).willReturn(opDeclarations);
    // When
    store.initialise(schema, properties);
    // Then
    assertNotNull(store.getOperationHandlerExposed(Validate.class));
    assertSame(addElementsHandlerOverridden, store.getOperationHandlerExposed(AddElements.class));
    assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllElements.class));
    assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllEntities.class));
    assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllEdges.class));
    assertTrue(store.getOperationHandlerExposed(GenerateElements.class) instanceof GenerateElementsHandler);
    assertTrue(store.getOperationHandlerExposed(GenerateObjects.class) instanceof GenerateObjectsHandler);
    assertTrue(store.getOperationHandlerExposed(CountGroups.class) instanceof CountGroupsHandler);
    assertTrue(store.getOperationHandlerExposed(Deduplicate.class) instanceof DeduplicateHandler);
    assertTrue(store.getOperationHandlerExposed(ExportToSet.class) instanceof ExportToSetHandler);
    assertTrue(store.getOperationHandlerExposed(GetSetExport.class) instanceof GetSetExportHandler);
    assertEquals(1, store.getCreateOperationHandlersCallCount());
    assertSame(schema, store.getSchema());
    assertSame(properties, store.getProperties());
    verify(schemaOptimiser).optimise(schema, true);
}
Also used : AddElements(uk.gov.gchq.gaffer.operation.impl.add.AddElements) GetAllEntities(uk.gov.gchq.gaffer.operation.impl.get.GetAllEntities) CountGroupsHandler(uk.gov.gchq.gaffer.store.operation.handler.CountGroupsHandler) GenerateObjectsHandler(uk.gov.gchq.gaffer.store.operation.handler.generate.GenerateObjectsHandler) OperationDeclaration(uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclaration) ExportToSetHandler(uk.gov.gchq.gaffer.store.operation.handler.export.set.ExportToSetHandler) GetSetExportHandler(uk.gov.gchq.gaffer.store.operation.handler.export.set.GetSetExportHandler) DeduplicateHandler(uk.gov.gchq.gaffer.store.operation.handler.DeduplicateHandler) Validate(uk.gov.gchq.gaffer.operation.impl.Validate) GetAllEdges(uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges) GetAllElements(uk.gov.gchq.gaffer.operation.impl.get.GetAllElements) GenerateElementsHandler(uk.gov.gchq.gaffer.store.operation.handler.generate.GenerateElementsHandler) OperationDeclarations(uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclarations) Test(org.junit.Test)

Aggregations

CountGroupsHandler (uk.gov.gchq.gaffer.store.operation.handler.CountGroupsHandler)2 DeduplicateHandler (uk.gov.gchq.gaffer.store.operation.handler.DeduplicateHandler)2 ExportToSetHandler (uk.gov.gchq.gaffer.store.operation.handler.export.set.ExportToSetHandler)2 GetSetExportHandler (uk.gov.gchq.gaffer.store.operation.handler.export.set.GetSetExportHandler)2 Test (org.junit.Test)1 Validate (uk.gov.gchq.gaffer.operation.impl.Validate)1 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)1 GetAllEdges (uk.gov.gchq.gaffer.operation.impl.get.GetAllEdges)1 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)1 GetAllEntities (uk.gov.gchq.gaffer.operation.impl.get.GetAllEntities)1 LimitHandler (uk.gov.gchq.gaffer.store.operation.handler.LimitHandler)1 ValidateHandler (uk.gov.gchq.gaffer.store.operation.handler.ValidateHandler)1 GetExportsHandler (uk.gov.gchq.gaffer.store.operation.handler.export.GetExportsHandler)1 GenerateElementsHandler (uk.gov.gchq.gaffer.store.operation.handler.generate.GenerateElementsHandler)1 GenerateObjectsHandler (uk.gov.gchq.gaffer.store.operation.handler.generate.GenerateObjectsHandler)1 GetAllJobDetailsHandler (uk.gov.gchq.gaffer.store.operation.handler.job.GetAllJobDetailsHandler)1 GetJobDetailsHandler (uk.gov.gchq.gaffer.store.operation.handler.job.GetJobDetailsHandler)1 GetJobResultsHandler (uk.gov.gchq.gaffer.store.operation.handler.job.GetJobResultsHandler)1 OperationDeclaration (uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclaration)1 OperationDeclarations (uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclarations)1