Examples of writeDelimitedTo()


Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

          final DataOutputBuffer buf = new DataOutputBuffer();
          rv.write(buf);
          byte[] data = buf.getData();
          fullLength += buf.getLength();
          out.writeInt(fullLength);
          header.writeDelimitedTo(out);
          out.write(data, 0, buf.getLength());
        }
      } catch (Throwable t) {
        LOG.warn("Error serializing call response for call " + call, t);
        // Call back to same function - this is OK since the
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

      RpcResponseHeaderProto header = headerBuilder.build();
      int headerLen = header.getSerializedSize();
      final int fullLength  =
          CodedOutputStream.computeRawVarint32Size(headerLen) + headerLen;
      out.writeInt(fullLength);
      header.writeDelimitedTo(out);
    }
    if (call.connection.useWrap) {
      wrapWithSasl(responseBuf, call);
    }
    call.setResponse(ByteBuffer.wrap(responseBuf.toByteArray()));
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

        if (rv instanceof ProtobufRpcEngine.RpcWrapper) {
          ProtobufRpcEngine.RpcWrapper resWrapper =
              (ProtobufRpcEngine.RpcWrapper) rv;
          fullLength += resWrapper.getLength();
          out.writeInt(fullLength);
          header.writeDelimitedTo(out);
          rv.write(out);
        } else { // Have to serialize to buffer to get len
          final DataOutputBuffer buf = new DataOutputBuffer();
          rv.write(buf);
          byte[] data = buf.getData();
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

          final DataOutputBuffer buf = new DataOutputBuffer();
          rv.write(buf);
          byte[] data = buf.getData();
          fullLength += buf.getLength();
          out.writeInt(fullLength);
          header.writeDelimitedTo(out);
          out.write(data, 0, buf.getLength());
        }
      } catch (Throwable t) {
        LOG.warn("Error serializing call response for call " + call, t);
        // Call back to same function - this is OK since the
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

      RpcResponseHeaderProto header = headerBuilder.build();
      int headerLen = header.getSerializedSize();
      final int fullLength  =
          CodedOutputStream.computeRawVarint32Size(headerLen) + headerLen;
      out.writeInt(fullLength);
      header.writeDelimitedTo(out);
    }
    if (call.connection.useWrap) {
      wrapWithSasl(responseBuf, call);
    }
    call.setResponse(ByteBuffer.wrap(responseBuf.toByteArray()));
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.writeDelimitedTo()

        if (rv instanceof ProtobufRpcEngine.RpcWrapper) {
          ProtobufRpcEngine.RpcWrapper resWrapper =
              (ProtobufRpcEngine.RpcWrapper) rv;
          fullLength += resWrapper.getLength();
          out.writeInt(fullLength);
          header.writeDelimitedTo(out);
          rv.write(out);
        } else { // Have to serialize to buffer to get len
          final DataOutputBuffer buf = new DataOutputBuffer();
          rv.write(buf);
          byte[] data = buf.getData();
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcPayloadHeaderProtos.RpcPayloadHeaderProto.writeDelimitedTo()

          // 2) the Payload - the RpcRequest
          //
          d = new DataOutputBuffer();
          RpcPayloadHeaderProto header = ProtoUtil.makeRpcPayloadHeader(
             call.rpcKind, RpcPayloadOperationProto.RPC_FINAL_PAYLOAD, call.id);
          header.writeDelimitedTo(d);
          call.rpcRequest.write(d);
          byte[] data = d.getData();
  
          int totalLength = d.getLength();
          out.writeInt(totalLength); // Total Length
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcPayloadHeaderProtos.RpcPayloadHeaderProto.writeDelimitedTo()

          // 2) the Payload - the RpcRequest
          //
          d = new DataOutputBuffer();
          RpcPayloadHeaderProto header = ProtoUtil.makeRpcPayloadHeader(
             call.rpcKind, RpcPayloadOperationProto.RPC_FINAL_PAYLOAD, call.id);
          header.writeDelimitedTo(d);
          call.rpcRequest.write(d);
          byte[] data = d.getData();
  
          int totalLength = d.getLength();
          out.writeInt(totalLength); // Total Length
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.RpcPayloadHeaderProtos.RpcPayloadHeaderProto.writeDelimitedTo()

      //
      // Items '1' and '2' are prepared here.
      final DataOutputBuffer d = new DataOutputBuffer();
      RpcPayloadHeaderProto header = ProtoUtil.makeRpcPayloadHeader(
         call.rpcKind, RpcPayloadOperationProto.RPC_FINAL_PAYLOAD, call.id);
      header.writeDelimitedTo(d);
      call.rpcRequest.write(d);

      synchronized (sendParamsLock) {
        Future<?> senderFuture = SEND_PARAMS_EXECUTOR.submit(new Runnable() {
          @Override
View Full Code Here

Examples of protobuf_unittest.UnittestProto.TestAllTypes.writeDelimitedTo()

  public void testParseDelimitedTo() throws Exception {
    // Write normal Message.
    TestAllTypes normalMessage = TestUtil.getAllSet();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    normalMessage.writeDelimitedTo(output);

    // Write MessageLite with packed extension fields.
    TestPackedExtensionsLite packedMessage =
        TestUtil.getLitePackedExtensionsSet();
    packedMessage.writeDelimitedTo(output);
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.