@Test public void testWrongRouting() throws Exception { expectedException.expect(UnhandledServerException.class); expectedException.expectMessage("unsupported routing"); CollectPhase collectNode = new CollectPhase( UUID.randomUUID(), 0, "wrong", new Routing( TreeMapBuilder.<String, Map<String, List<Integer>>>newMapBuilder() .put( "bla", TreeMapBuilder.<String, List<Integer>>newMapBuilder() .put("my_index", Arrays.asList(1)) .put("my_index", Arrays.asList(1)) .map()) .map()), ImmutableList.<Symbol>of(), EMPTY_PROJECTIONS); collectNode.maxRowGranularity(RowGranularity.DOC); operation.collect(collectNode, new CollectingProjector(), null); }
private Bucket getBucket(CollectPhase collectNode) throws InterruptedException, ExecutionException { CollectingProjector cd = new CollectingProjector(); JobExecutionContext.Builder builder = jobContextService.newBuilder(collectNode.jobId()); JobCollectContext jobCollectContext = new JobCollectContext( collectNode.jobId(), collectNode, operation, RAM_ACCOUNTING_CONTEXT, cd); builder.addSubContext(collectNode.executionPhaseId(), jobCollectContext); JobExecutionContext context = jobContextService.createContext(builder); cd.startProjection(jobCollectContext); operation.collect(collectNode, cd, jobCollectContext); return cd.result().get(); }