Search in sources :

Example 1 with OperatorCreatorRegistry

use of org.apache.drill.exec.physical.impl.OperatorCreatorRegistry in project drill by apache.

the class ExecTest method mockDrillbitContext.

protected void mockDrillbitContext(final DrillbitContext bitContext) throws Exception {
    new NonStrictExpectations() {

        {
            bitContext.getMetrics();
            result = new MetricRegistry();
            bitContext.getAllocator();
            result = RootAllocatorFactory.newRoot(c);
            bitContext.getOperatorCreatorRegistry();
            result = new OperatorCreatorRegistry(ClassPathScanner.fromPrescan(c));
            bitContext.getConfig();
            result = c;
            bitContext.getOptionManager();
            result = optionManager;
            bitContext.getCompiler();
            result = CodeCompilerTestFactory.getTestCompiler(c);
        }
    };
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) NonStrictExpectations(mockit.NonStrictExpectations) OperatorCreatorRegistry(org.apache.drill.exec.physical.impl.OperatorCreatorRegistry)

Example 2 with OperatorCreatorRegistry

use of org.apache.drill.exec.physical.impl.OperatorCreatorRegistry in project drill by axbaretto.

the class ExecTest method mockDrillbitContext.

protected DrillbitContext mockDrillbitContext() throws Exception {
    final DrillbitContext context = mock(DrillbitContext.class);
    when(context.getMetrics()).thenReturn(new MetricRegistry());
    when(context.getAllocator()).thenReturn(RootAllocatorFactory.newRoot(c));
    when(context.getOperatorCreatorRegistry()).thenReturn(new OperatorCreatorRegistry(ClassPathScanner.fromPrescan(c)));
    when(context.getConfig()).thenReturn(c);
    when(context.getOptionManager()).thenReturn(optionManager);
    when(context.getCompiler()).thenReturn(CodeCompilerTestFactory.getTestCompiler(c));
    return context;
}
Also used : DrillbitContext(org.apache.drill.exec.server.DrillbitContext) MetricRegistry(com.codahale.metrics.MetricRegistry) OperatorCreatorRegistry(org.apache.drill.exec.physical.impl.OperatorCreatorRegistry)

Example 3 with OperatorCreatorRegistry

use of org.apache.drill.exec.physical.impl.OperatorCreatorRegistry in project drill by apache.

the class ExecTest method mockDrillbitContext.

protected DrillbitContext mockDrillbitContext() throws Exception {
    final DrillbitContext context = mock(DrillbitContext.class);
    when(context.getMetrics()).thenReturn(new MetricRegistry());
    when(context.getAllocator()).thenReturn(RootAllocatorFactory.newRoot(c));
    when(context.getOperatorCreatorRegistry()).thenReturn(new OperatorCreatorRegistry(ClassPathScanner.fromPrescan(c)));
    when(context.getConfig()).thenReturn(c);
    when(context.getOptionManager()).thenReturn(optionManager);
    when(context.getCompiler()).thenReturn(CodeCompilerTestFactory.getTestCompiler(c));
    return context;
}
Also used : DrillbitContext(org.apache.drill.exec.server.DrillbitContext) MetricRegistry(com.codahale.metrics.MetricRegistry) OperatorCreatorRegistry(org.apache.drill.exec.physical.impl.OperatorCreatorRegistry)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)3 OperatorCreatorRegistry (org.apache.drill.exec.physical.impl.OperatorCreatorRegistry)3 DrillbitContext (org.apache.drill.exec.server.DrillbitContext)2 NonStrictExpectations (mockit.NonStrictExpectations)1