Ejemplo n.º 1
0
 public Operator createAlignmentOperator(
     OperatorContext operatorContext,
     List<ConnectorColumnHandle> columns,
     RaptorSplit raptorSplit) {
   ImmutableList.Builder<Type> types = ImmutableList.builder();
   ImmutableList.Builder<Iterable<Block>> channels = ImmutableList.builder();
   for (ConnectorColumnHandle column : columns) {
     RaptorColumnHandle raptorColumnHandle = checkType(column, RaptorColumnHandle.class, "column");
     types.add(raptorColumnHandle.getColumnType());
     channels.add(storageManager.getBlocks(raptorSplit.getShardUuid(), column));
   }
   return new AlignmentOperator(operatorContext, types.build(), channels.build());
 }
Ejemplo n.º 2
0
 public Operator createNoColumnsOperator(
     OperatorContext operatorContext, RaptorSplit raptorSplit) {
   RaptorColumnHandle countColumnHandle = raptorSplit.getCountColumnHandle();
   Iterable<Block> blocks =
       storageManager.getBlocks(raptorSplit.getShardUuid(), countColumnHandle);
   return new NoColumnsOperator(
       operatorContext,
       Iterables.transform(
           blocks,
           new Function<Block, Integer>() {
             @Override
             public Integer apply(Block input) {
               return input.getPositionCount();
             }
           }));
 }