当前位置: 首页>>代码示例>>Java>>正文


Java RpcRequestMessageWrapper类代码示例

本文整理汇总了Java中org.apache.hadoop.ipc.ProtobufRpcEngine.RpcRequestMessageWrapper的典型用法代码示例。如果您正苦于以下问题:Java RpcRequestMessageWrapper类的具体用法?Java RpcRequestMessageWrapper怎么用?Java RpcRequestMessageWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RpcRequestMessageWrapper类属于org.apache.hadoop.ipc.ProtobufRpcEngine包,在下文中一共展示了RpcRequestMessageWrapper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.apache.hadoop.ipc.ProtobufRpcEngine.RpcRequestMessageWrapper; //导入依赖的package包/类
@Override
public void write(byte[] buf, int off, int len) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("wrapping token of length:" + len);
  }
  buf = saslClient.wrap(buf, off, len);
  RpcSaslProto saslMessage = RpcSaslProto.newBuilder()
      .setState(SaslState.WRAP)
      .setToken(ByteString.copyFrom(buf, 0, buf.length))
      .build();
  RpcRequestMessageWrapper request =
      new RpcRequestMessageWrapper(saslHeader, saslMessage);
  DataOutputStream dob = new DataOutputStream(out);
  dob.writeInt(request.getLength());
  request.write(dob);
 }
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:SaslRpcClient.java

示例2: writeConnectionContext

import org.apache.hadoop.ipc.ProtobufRpcEngine.RpcRequestMessageWrapper; //导入依赖的package包/类
private void writeConnectionContext(ConnectionId remoteId,
                                    AuthMethod authMethod)
                                        throws IOException {
  // Write out the ConnectionHeader
  IpcConnectionContextProto message = ProtoUtil.makeIpcConnectionContext(
      RPC.getProtocolName(remoteId.getProtocol()),
      remoteId.getTicket(),
      authMethod);
  RpcRequestHeaderProto connectionContextHeader = ProtoUtil
      .makeRpcRequestHeader(RpcKind.RPC_PROTOCOL_BUFFER,
          OperationProto.RPC_FINAL_PACKET, CONNECTION_CONTEXT_CALL_ID,
          RpcConstants.INVALID_RETRY_COUNT, clientId);
  RpcRequestMessageWrapper request =
      new RpcRequestMessageWrapper(connectionContextHeader, message);
  
  // Write out the packet length
  out.writeInt(request.getLength());
  request.write(out);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:20,代码来源:Client.java

示例3: sendSaslMessage

import org.apache.hadoop.ipc.ProtobufRpcEngine.RpcRequestMessageWrapper; //导入依赖的package包/类
private void sendSaslMessage(DataOutputStream out, RpcSaslProto message)
    throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Sending sasl message "+message);
  }
  RpcRequestMessageWrapper request =
      new RpcRequestMessageWrapper(saslHeader, message);
  out.writeInt(request.getLength());
  request.write(out);
  out.flush();    
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:SaslRpcClient.java


注:本文中的org.apache.hadoop.ipc.ProtobufRpcEngine.RpcRequestMessageWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。