本文整理汇总了Java中org.apache.hadoop.ipc.ClientId类的典型用法代码示例。如果您正苦于以下问题:Java ClientId类的具体用法?Java ClientId怎么用?Java ClientId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientId类属于org.apache.hadoop.ipc包,在下文中一共展示了ClientId类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRpcClientId
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
@Test
public void testRpcClientId() {
byte[] uuid = ClientId.getClientId();
RpcRequestHeaderProto header = ProtoUtil.makeRpcRequestHeader(
RpcKind.RPC_PROTOCOL_BUFFER, OperationProto.RPC_FINAL_PACKET, 0,
RpcConstants.INVALID_RETRY_COUNT, uuid);
assertTrue(Arrays.equals(uuid, header.getClientId().toByteArray()));
}
示例2: readRpcIdsFromXml
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
void readRpcIdsFromXml(Stanza st) {
this.rpcClientId = st.hasChildren("RPC_CLIENTID") ?
ClientId.toBytes(st.getValue("RPC_CLIENTID"))
: RpcConstants.DUMMY_CLIENT_ID;
this.rpcCallId = st.hasChildren("RPC_CALLID") ?
Integer.parseInt(st.getValue("RPC_CALLID"))
: RpcConstants.INVALID_CALL_ID;
}
示例3: appendRpcIdsToString
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
private static void appendRpcIdsToString(final StringBuilder builder,
final byte[] clientId, final int callId) {
builder.append(", RpcClientId=");
builder.append(ClientId.toString(clientId));
builder.append(", RpcCallId=");
builder.append(callId);
}
示例4: appendRpcIdsToXml
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
private static void appendRpcIdsToXml(ContentHandler contentHandler,
final byte[] clientId, final int callId) throws SAXException {
XMLUtils.addSaxString(contentHandler, "RPC_CLIENTID",
ClientId.toString(clientId));
XMLUtils.addSaxString(contentHandler, "RPC_CALLID",
Integer.toString(callId));
}
示例5: readRpcIdsFromXml
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
void readRpcIdsFromXml(Stanza st) {
this.rpcClientId = st.hasChildren("RPC_CLIENTID") ?
ClientId.toBytes(st.getValue("RPC_CLIENTID"))
: RpcConstants.DUMMY_CLIENT_ID;
this.rpcCallId = st.hasChildren("RPC_CALLID") ?
Integer.valueOf(st.getValue("RPC_CALLID"))
: RpcConstants.INVALID_CALL_ID;
}
示例6: appendRpcIdsToXml
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
private static void appendRpcIdsToXml(ContentHandler contentHandler,
final byte[] clientId, final int callId) throws SAXException {
XMLUtils.addSaxString(contentHandler, "RPC_CLIENTID",
ClientId.toString(clientId));
XMLUtils.addSaxString(contentHandler, "RPC_CALLID",
Integer.valueOf(callId).toString());
}
示例7: ping
import org.apache.hadoop.ipc.ClientId; //导入依赖的package包/类
@Override
public TestProtos.EmptyResponseProto ping(
RpcController unused, TestProtos.EmptyRequestProto request)
throws ServiceException {
// Ensure clientId is received
byte[] clientId = Server.getClientId();
Assert.assertNotNull(clientId);
Assert.assertEquals(ClientId.BYTE_LENGTH, clientId.length);
// test with ip set
testSuccessLogFormat(true);
testFailureLogFormat(true);
return TestProtos.EmptyResponseProto.newBuilder().build();
}