Examples of toByteString()


Examples of com.taobao.zeus.socket.protocol.Protocol.WebRequest.toByteString()

 
  public Future<WebResponse> send(final WorkerContext context,ExecuteKind kind,String id){
   
    final WebRequest req=WebRequest.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(WebOperate.ExecuteJob)
      .setEk(kind).setId(id).build();
    SocketMessage sm=SocketMessage.newBuilder().setKind(Kind.WEB_REUQEST).setBody(req.toByteString()).build();
   
    Future<WebResponse> f=context.getThreadPool().submit(new Callable<WebResponse>() {
      private WebResponse response;
      public WebResponse call() throws Exception {
        final CountDownLatch latch=new CountDownLatch(1);
View Full Code Here

Examples of echo.EchoProto.EchoRequest.toByteString()

        RpcEncoder encoder = new RpcEncoder();
        EchoRequest request = EchoRequest.newBuilder().setPayload("Hello").build();
        RpcMessage message = RpcMessage.newBuilder().setType(MessageType.REQUEST).setId(1)
                .setService(EchoService.getDescriptor().getFullName())
                .setMethod(EchoService.getDescriptor().getMethods().get(0).getName())
                .setRequest(request.toByteString()).build();
        encoder.encode(null, null, message);
    }

    @Test
    public void testDecoder() throws Exception {
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.toByteString()

                                    BlockingRpcCallback<MetaDataResponse> rpcCallback =
                                            new BlockingRpcCallback<MetaDataResponse>();
                                    UpdateIndexStateRequest.Builder builder = UpdateIndexStateRequest.newBuilder();
                                    for (Mutation m : tableMetadata) {
                                        MutationProto mp = ProtobufUtil.toProto(m);
                                        builder.addTableMetadataMutations(mp.toByteString());
                                    }
                                    instance.updateIndexState(controller, builder.build(), rpcCallback);
                                    if(controller.getFailedOn() != null) {
                                        throw controller.getFailedOn();
                                    }
View Full Code Here

Examples of org.apache.tez.dag.recovery.records.RecoveryProtos.VertexFinishStateProto.toByteString()

    SummaryEventProto.Builder builder = RecoveryProtos.SummaryEventProto.newBuilder()
        .setDagId(vertexID.getDAGId().toString())
        .setTimestamp(finishTime)
        .setEventType(getEventType().ordinal())
        .setEventPayload(finishStateProto.toByteString());
    builder.build().writeDelimitedTo(outputStream);

  }

  @Override
View Full Code Here

Examples of org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRInputUserPayloadProto.toByteString()

      // This assumes that Grouping will always be used.
      // Enabling grouping on the payload.
      MRInputUserPayloadProto updatedPayload =
          MRInputUserPayloadProto.newBuilder(protoPayload).setGroupingEnabled(true).build();
      inputDescriptor.setUserPayload(UserPayload.create(updatedPayload.toByteString().asReadOnlyByteBuffer()));
    } catch (IOException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRSplitProto.toByteString()

    assertEquals(1, splits.length);

    MRSplitProto splitProto = MRInputHelpers.createSplitProto(splits[0]);
    InputDataInformationEvent event =
        InputDataInformationEvent.createWithSerializedPayload(0,
            splitProto.toByteString().asReadOnlyByteBuffer());

    eventList.clear();
    eventList.add(event);
    input.handleEvents(eventList);
View Full Code Here

Examples of org.apache.tez.runtime.library.shuffle.impl.ShuffleUserPayloads.DataMovementEventPayloadProto.toByteString()

      payloadBuilder.setPathComponent(getContext().getUniqueIdentifier());
    }

    payloadBuilder.setRunDuration((int) ((endTime - startTime) / 1000));
    DataMovementEventPayloadProto payloadProto = payloadBuilder.build();
    ByteBuffer payload = payloadProto.toByteString().asReadOnlyByteBuffer();

    long outputSize = getContext().getCounters()
        .findCounter(TaskCounter.OUTPUT_BYTES).getValue();
    VertexManagerEventPayloadProto.Builder vmBuilder = VertexManagerEventPayloadProto
        .newBuilder();
View Full Code Here

Examples of org.apache.yoko.rmi.util.ByteBuffer.toByteString()

    static ByteString fixName(ByteString name) {
        if (keyWords.contains(name)) {
            ByteBuffer buf = new ByteBuffer();
            buf.append('_');
            buf.append(name);
            return buf.toByteString();
        }

        ByteString result = name;
        ByteString current = name;
View Full Code Here

Examples of org.apache.yoko.rmi.util.ByteBuffer.toByteString()

            for (int i = 0; i < reservedPostfixes.length; i++) {
                if (current.endsWith(reservedPostfixes[i])) {
                    ByteBuffer buf = new ByteBuffer();
                    buf.append('_');
                    buf.append(result);
                    result = buf.toByteString();

                    int resultLen = reservedPostfixes[i].length();
                    if (len > resultLen)
                        current = current.substring(0, len - resultLen);
                    else
View Full Code Here

Examples of org.nasutekds.server.types.ByteStringBuilder.toByteString()

      }


      ExtendedRequestProtocolOp extendedRequest =
           new ExtendedRequestProtocolOp(OID_PASSWORD_POLICY_STATE_EXTOP,
                                         builder.toByteString());

      LDAPMessage requestMessage =
           new LDAPMessage(nextMessageID.getAndIncrement(), extendedRequest);

      try
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.