Examples of FragmentHandle


Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  @Override
  protected void handle(BitServerConnection connection, int rpcType, ByteBuf pBody, ByteBuf body, ResponseSender sender) throws RpcException {
    assert rpcType == RpcType.REQ_RECORD_BATCH_VALUE;

    FragmentRecordBatch fragmentBatch = get(pBody, FragmentRecordBatch.PARSER);
    FragmentHandle handle = fragmentBatch.getHandle();

    try {
      FragmentManager manager = workBus.getOrCreateFragmentManager(fragmentBatch.getHandle());
      if (manager == null) {
        if (body != null) {
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

    if(RpcConstants.EXTRA_DEBUGGING) logger.debug("Received bit com message of type {}", rpcType);

    switch (rpcType) {

    case RpcType.REQ_CANCEL_FRAGMENT_VALUE:
      FragmentHandle handle = get(pBody, FragmentHandle.PARSER);
      cancelFragment(handle);
      return DataRpcConfig.OK;

    case RpcType.REQ_RECEIVER_FINISHED_VALUE:
      FinishedReceiver finishedReceiver = get(pBody, FinishedReceiver.PARSER);
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

        if(context.getFailureCause() != null){
            throw context.getFailureCause();
        }
        assertTrue(!context.isFailed());

        FragmentHandle handle = context.getHandle();

        /* Form the file name to which the trace output will dump the record batches */
        String qid = QueryIdHelper.getQueryId(handle.getQueryId());

        int majorFragmentId = handle.getMajorFragmentId();
        int minorFragmentId = handle.getMinorFragmentId();

        String logLocation = c.getString(ExecConstants.TRACE_DUMP_DIRECTORY);

        System.out.println("Found log location: " + logLocation);

View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

      super(context, config);
      this.incoming = batch;
      assert(incoming != null);
      this.handle = context.getHandle();
      this.recMajor = config.getOppositeMajorFragmentId();
      FragmentHandle opposite = handle.toBuilder().setMajorFragmentId(config.getOppositeMajorFragmentId()).setMinorFragmentId(0).build();
      this.tunnel = context.getDataTunnel(config.getDestination(), opposite);
      this.context = context;
    }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  private static final DrillConfig CONFIG = DrillConfig.create();

  @Test
  public void protobufSerialization() throws Exception {
    DistributedMap<String, FragmentHandle> map = ICACHE.getMap(CacheConfig.newBuilder(FragmentHandle.class).proto().build());
    FragmentHandle s = FragmentHandle.newBuilder().setMajorFragmentId(1).setMinorFragmentId(1).setQueryId(QueryId.newBuilder().setPart1(74).setPart2(66).build()).build();
    map.put("1", s).get();
    for(int i =0; i < 2; i++){
      FragmentHandle s2 = map.get("1");
      Assert.assertEquals(s, s2);
    }
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

          optionsData = reader.writeJson(options);
        } catch (JsonProcessingException e) {
          throw new FragmentSetupException("Failure while trying to convert fragment into json.", e);
        }

        FragmentHandle handle = FragmentHandle //
            .newBuilder() //
            .setMajorFragmentId(wrapper.getMajorFragmentId()) //
            .setMinorFragmentId(minorFragmentId) //
            .setQueryId(queryId) //
            .build();
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  public WriterRecordBatch(Writer writer, RecordBatch incoming, FragmentContext context, RecordWriter recordWriter) throws OutOfMemoryException {
    super(writer, context);
    this.incoming = incoming;

    FragmentHandle handle = context.getHandle();
    fragmentUniqueId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
    this.recordWriter = recordWriter;
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

  public RecordWriter getRecordWriter(FragmentContext context, ParquetWriter writer) throws IOException {
    Map<String, String> options = Maps.newHashMap();

    options.put("location", writer.getLocation());

    FragmentHandle handle = context.getHandle();
    String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
    options.put("prefix", fragmentId);

    options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

    options.put(ExecConstants.PARQUET_BLOCK_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_BLOCK_SIZE).num_val.toString());
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

    oContext.close();
    incoming.cleanup();
  }

  public void sendEmptyBatch() {
    FragmentHandle handle = context.getHandle();
    int fieldId = 0;
    StatusHandler statusHandler = new StatusHandler(sendCount, context);
    for (DrillbitEndpoint endpoint : popConfig.getDestinations()) {
      FragmentHandle opposite = context.getHandle().toBuilder().setMajorFragmentId(popConfig.getOppositeMajorFragmentId()).setMinorFragmentId(fieldId).build();
      DataTunnel tunnel = context.getDataTunnel(endpoint, opposite);
      FragmentWritableBatch writableBatch = FragmentWritableBatch.getEmptyLastWithSchema(
              handle.getQueryId(),
              handle.getMajorFragmentId(),
              handle.getMinorFragmentId(),
View Full Code Here

Examples of org.apache.drill.exec.proto.ExecProtos.FragmentHandle

      }
    }
  }

  private void informSenders() {
    FragmentHandle handlePrototype = FragmentHandle.newBuilder()
            .setMajorFragmentId(config.getOppositeMajorFragmentId())
            .setQueryId(context.getHandle().getQueryId())
            .build();
    for (int i = 0; i < config.getNumSenders(); i++) {
      FragmentHandle sender = FragmentHandle.newBuilder(handlePrototype)
              .setMinorFragmentId(i)
              .build();
      FinishedReceiver finishedReceiver = FinishedReceiver.newBuilder()
              .setReceiver(context.getHandle())
              .setSender(sender)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.