Search in sources :

Example 1 with InMemoryStoreExecutor

use of org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor in project legend-engine by finos.

the class TestPlanExecutor method testPlanExecutorConstructionWithNoConfig.

@Test
public void testPlanExecutorConstructionWithNoConfig() {
    // assert that we construct a plan executor with all known store executors even when no configuration is supplied
    PlanExecutor planExecutor = PlanExecutor.newPlanExecutorWithConfigurations();
    ImmutableList<StoreExecutor> extraExecutors = planExecutor.getExtraExecutors();
    StoreExecutor relationalExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof FakeRelationalStoreExecutorBuilder.Executor);
    assertNotNull("failed to locate relational executor", relationalExecutor);
    StoreExecutor serviceStoreExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof FakeServiceStoreExecutorBuilder.Executor);
    assertNotNull("failed to locate service store executor", serviceStoreExecutor);
    StoreExecutor inmemoryExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof InMemoryStoreExecutor);
    assertNotNull("failed to locate inmemory executor", inmemoryExecutor);
}
Also used : InMemoryStoreExecutor(org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor) FakeServiceStoreExecutorBuilder(org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeServiceStoreExecutorBuilder) PlanExecutor(org.finos.legend.engine.plan.execution.PlanExecutor) InMemoryStoreExecutor(org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor) StoreExecutor(org.finos.legend.engine.plan.execution.stores.StoreExecutor) FakeRelationalStoreExecutorBuilder(org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeRelationalStoreExecutorBuilder) Test(org.junit.Test)

Example 2 with InMemoryStoreExecutor

use of org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor in project legend-engine by finos.

the class TestPlanExecutor method testPlanExecutorConstructionWithConfig.

@Test
public void testPlanExecutorConstructionWithConfig() {
    // assert that we construct a plan executor with the proper configs
    PlanExecutor planExecutor = PlanExecutor.newPlanExecutorWithConfigurations(new FakeRelationalStoreExecutorBuilder.Configuration(), new FakeServiceStoreExecutorBuilder.Configuration());
    ImmutableList<StoreExecutor> extraExecutors = planExecutor.getExtraExecutors();
    StoreExecutor relationalExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof FakeRelationalStoreExecutorBuilder.Executor);
    assertNotNull("failed to locate relational executor", relationalExecutor);
    StoreExecutorConfiguration relationalConfiguration = ((FakeRelationalStoreExecutorBuilder.Executor) relationalExecutor).getConfiguration();
    assertNotNull("builder not invoked with config", relationalConfiguration);
    StoreExecutor serviceStoreExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof FakeServiceStoreExecutorBuilder.Executor);
    assertNotNull("failed to locate service store executor", serviceStoreExecutor);
    StoreExecutorConfiguration serviceStoreConfiguration = ((FakeServiceStoreExecutorBuilder.Executor) serviceStoreExecutor).getConfiguration();
    assertNotNull("builder not invoked with config", serviceStoreConfiguration);
    StoreExecutor inmemoryExecutor = extraExecutors.detect(storeExecutor -> storeExecutor instanceof InMemoryStoreExecutor);
    assertNotNull("failed to locate inmemory executor", inmemoryExecutor);
}
Also used : InMemoryStoreExecutor(org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor) StoreExecutor(org.finos.legend.engine.plan.execution.stores.StoreExecutor) PlanExecutor(org.finos.legend.engine.plan.execution.PlanExecutor) InMemoryStoreExecutor(org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor) FakeServiceStoreExecutorBuilder(org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeServiceStoreExecutorBuilder) PlanExecutor(org.finos.legend.engine.plan.execution.PlanExecutor) InMemoryStoreExecutor(org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor) StoreExecutor(org.finos.legend.engine.plan.execution.stores.StoreExecutor) StoreExecutorConfiguration(org.finos.legend.engine.plan.execution.stores.StoreExecutorConfiguration) FakeRelationalStoreExecutorBuilder(org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeRelationalStoreExecutorBuilder) Test(org.junit.Test)

Aggregations

PlanExecutor (org.finos.legend.engine.plan.execution.PlanExecutor)2 StoreExecutor (org.finos.legend.engine.plan.execution.stores.StoreExecutor)2 InMemoryStoreExecutor (org.finos.legend.engine.plan.execution.stores.inMemory.plugin.InMemoryStoreExecutor)2 FakeRelationalStoreExecutorBuilder (org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeRelationalStoreExecutorBuilder)2 FakeServiceStoreExecutorBuilder (org.finos.legend.engine.plan.execution.stores.relational.plugin.FakeServiceStoreExecutorBuilder)2 Test (org.junit.Test)2 StoreExecutorConfiguration (org.finos.legend.engine.plan.execution.stores.StoreExecutorConfiguration)1