Search in sources :

Example 1 with IdAndConfGenerator

use of edu.snu.mist.core.task.utils.IdAndConfGenerator in project mist by snuspl.

the class ImmediateQueryMergingStarterTest method setUp.

@Before
public void setUp() throws InjectionException, IOException {
    final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
    jcb.bindImplementation(ExecutionDags.class, MergingExecutionDags.class);
    jcb.bindImplementation(QueryStarter.class, ImmediateQueryMergingStarter.class);
    idAndConfGenerator = new IdAndConfGenerator();
    executionVertexGenerator = mock(ExecutionVertexGenerator.class);
    final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
    injector.bindVolatileInstance(ExecutionVertexGenerator.class, executionVertexGenerator);
    configExecutionVertexMap = injector.getInstance(ConfigExecutionVertexMap.class);
    executionVertexCountMap = injector.getInstance(ExecutionVertexCountMap.class);
    executionVertexDagMap = injector.getInstance(ExecutionVertexDagMap.class);
    executionDags = injector.getInstance(ExecutionDags.class);
    queryIdConfigDagMap = injector.getInstance(QueryIdConfigDagMap.class);
    srcAndDagMap = injector.getInstance(SrcAndDagMap.class);
    queryStarter = injector.getInstance(QueryStarter.class);
    configVertexId = new AtomicLong();
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) Injector(org.apache.reef.tang.Injector) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) IdAndConfGenerator(edu.snu.mist.core.task.utils.IdAndConfGenerator) Before(org.junit.Before)

Example 2 with IdAndConfGenerator

use of edu.snu.mist.core.task.utils.IdAndConfGenerator in project mist by snuspl.

the class MergeAwareQueryRemoverTest method setUp.

@Before
public void setUp() throws InjectionException, IOException {
    final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder();
    jcb.bindImplementation(ExecutionDags.class, MergingExecutionDags.class);
    final Injector injector = Tang.Factory.getTang().newInjector(jcb.build());
    queryRemover = injector.getInstance(MergeAwareQueryRemover.class);
    srcAndDagMap = injector.getInstance(SrcAndDagMap.class);
    executionVertexCountMap = injector.getInstance(ExecutionVertexCountMap.class);
    executionDags = injector.getInstance(ExecutionDags.class);
    executionVertexDagMap = injector.getInstance(ExecutionVertexDagMap.class);
    configExecutionVertexMap = injector.getInstance(ConfigExecutionVertexMap.class);
    queryIdConfigDagMap = injector.getInstance(QueryIdConfigDagMap.class);
    idAndConfGenerator = new IdAndConfGenerator();
    configVertexId = new AtomicLong();
}
Also used : AtomicLong(java.util.concurrent.atomic.AtomicLong) Injector(org.apache.reef.tang.Injector) JavaConfigurationBuilder(org.apache.reef.tang.JavaConfigurationBuilder) IdAndConfGenerator(edu.snu.mist.core.task.utils.IdAndConfGenerator) Before(org.junit.Before)

Aggregations

IdAndConfGenerator (edu.snu.mist.core.task.utils.IdAndConfGenerator)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)2 Injector (org.apache.reef.tang.Injector)2 JavaConfigurationBuilder (org.apache.reef.tang.JavaConfigurationBuilder)2 Before (org.junit.Before)2