org.apache.avro.Protocol.getMD5()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.apache.avro.Protocol.getMD5()方法的一些代码示例,展示了Protocol.getMD5()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getMD5()方法的具体详情如下:
包路径:org.apache.avro.Protocol
类名称:Protocol
方法名:getMD5

Protocol.getMD5介绍

[英]Return the MD5 hash of the text of this protocol.
[中]返回此协议文本的MD5哈希。

代码示例

代码示例来源:origin: apache/avro

protected Responder(Protocol local) {
 this.local = local;
 this.localHash = new MD5();
 localHash.bytes(local.getMD5());
 protocols.put(localHash, local);
 this.rpcMetaPlugins =
  new CopyOnWriteArrayList<>();
}

代码示例来源:origin: apache/avro

private void writeHandshake(Encoder out) throws IOException {
 if (getTransceiver().isConnected()) return;
 MD5 localHash = new MD5();
 localHash.bytes(local.getMD5());
 String remoteName = transceiver.getRemoteName();
 MD5 remoteHash = REMOTE_HASHES.get(remoteName);
 if (remoteHash == null) {                     // guess remote is local
  remoteHash = localHash;
  remote = local;
 } else {
  remote = REMOTE_PROTOCOLS.get(remoteHash);
 }
 HandshakeRequest handshake = new HandshakeRequest();
 handshake.clientHash = localHash;
 handshake.serverHash = remoteHash;
 if (sendLocalText)
  handshake.clientProtocol = local.toString();
 RPCContext context = new RPCContext();
 context.setHandshakeRequest(handshake);
 for (RPCPlugin plugin : rpcMetaPlugins) {
  plugin.clientStartConnect(context);
 }
 handshake.meta = context.requestHandshakeMeta();
 HANDSHAKE_WRITER.write(handshake, out);
}

代码示例来源:origin: org.apache.cassandra.deps/avro

protected Responder(Protocol local) {
 this.local = local;
 this.localHash = new MD5();
 localHash.bytes(local.getMD5());
 protocols.put(localHash, local);
 this.rpcMetaPlugins =
  Collections.synchronizedList(new ArrayList<RPCPlugin>());
}

代码示例来源:origin: org.apache.hadoop/avro

protected Responder(Protocol local) {
 this.local = local;
 this.localHash = new MD5();
 localHash.bytes(local.getMD5());
 protocols.put(localHash, local);
 this.rpcMetaPlugins =
  Collections.synchronizedList(new ArrayList<RPCPlugin>());
}

代码示例来源:origin: org.apache.avro/avro-ipc

protected Responder(Protocol local) {
 this.local = local;
 this.localHash = new MD5();
 localHash.bytes(local.getMD5());
 protocols.put(localHash, local);
 this.rpcMetaPlugins =
  new CopyOnWriteArrayList<RPCPlugin>();
}

代码示例来源:origin: org.apache.hadoop/avro

private void writeHandshake(Encoder out) throws IOException {
 MD5 localHash = new MD5();
 localHash.bytes(local.getMD5());
 String remoteName = transceiver.getRemoteName();
 MD5 remoteHash = REMOTE_HASHES.get(remoteName);
 remote = REMOTE_PROTOCOLS.get(remoteHash);
 if (remoteHash == null) {                     // guess remote is local
  remoteHash = localHash;
  remote = local;
 }
 HandshakeRequest handshake = new HandshakeRequest();
 handshake.clientHash = localHash;
 handshake.serverHash = remoteHash;
 if (sendLocalText)
  handshake.clientProtocol = new Utf8(local.toString());
 
 RPCContext context = new RPCContext();
 for (RPCPlugin plugin : rpcMetaPlugins) {
  plugin.clientStartConnect(context);
 }
 handshake.meta = context.requestHandshakeMeta();
 
 HANDSHAKE_WRITER.write(handshake, out);
}

代码示例来源:origin: org.apache.cassandra.deps/avro

private void writeHandshake(Encoder out) throws IOException {
 if (getTransceiver().isConnected()) return;
 MD5 localHash = new MD5();
 localHash.bytes(local.getMD5());
 String remoteName = transceiver.getRemoteName();
 MD5 remoteHash = REMOTE_HASHES.get(remoteName);
 remote = REMOTE_PROTOCOLS.get(remoteHash);
 if (remoteHash == null) {                     // guess remote is local
  remoteHash = localHash;
  remote = local;
 }
 HandshakeRequest handshake = new HandshakeRequest();
 handshake.clientHash = localHash;
 handshake.serverHash = remoteHash;
 if (sendLocalText)
  handshake.clientProtocol = new Utf8(local.toString());
 
 RPCContext context = new RPCContext();
 for (RPCPlugin plugin : rpcMetaPlugins) {
  plugin.clientStartConnect(context);
 }
 handshake.meta = context.requestHandshakeMeta();
 
 HANDSHAKE_WRITER.write(handshake, out);
}

代码示例来源:origin: org.apache.avro/avro-ipc

private void writeHandshake(Encoder out) throws IOException {
 if (getTransceiver().isConnected()) return;
 MD5 localHash = new MD5();
 localHash.bytes(local.getMD5());
 String remoteName = transceiver.getRemoteName();
 MD5 remoteHash = REMOTE_HASHES.get(remoteName);
 if (remoteHash == null) {                     // guess remote is local
  remoteHash = localHash;
  remote = local;
 } else {
  remote = REMOTE_PROTOCOLS.get(remoteHash);
 }
 HandshakeRequest handshake = new HandshakeRequest();
 handshake.clientHash = localHash;
 handshake.serverHash = remoteHash;
 if (sendLocalText)
  handshake.clientProtocol = local.toString();
 RPCContext context = new RPCContext();
 context.setHandshakeRequest(handshake);
 for (RPCPlugin plugin : rpcMetaPlugins) {
  plugin.clientStartConnect(context);
 }
 handshake.meta = context.requestHandshakeMeta();
 HANDSHAKE_WRITER.write(handshake, out);
}

相关文章