本文整理汇总了Java中org.apache.hadoop.ipc.RpcConstants类的典型用法代码示例。如果您正苦于以下问题:Java RpcConstants类的具体用法?Java RpcConstants怎么用?Java RpcConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RpcConstants类属于org.apache.hadoop.ipc包,在下文中一共展示了RpcConstants类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRpcClientId
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的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.RpcConstants; //导入依赖的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: readRpcIdsFromXml
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的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;
}
示例4: reset
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
final void reset() {
txid = HdfsConstants.INVALID_TXID;
rpcClientId = RpcConstants.DUMMY_CLIENT_ID;
rpcCallId = RpcConstants.INVALID_CALL_ID;
resetSubFields();
}
示例5: hasRpcIds
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
public boolean hasRpcIds() {
return rpcClientId != RpcConstants.DUMMY_CLIENT_ID
&& rpcCallId != RpcConstants.INVALID_CALL_ID;
}
示例6: getClientId
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
/** this has to be called after calling {@link #hasRpcIds()} */
public byte[] getClientId() {
Preconditions.checkState(rpcClientId != RpcConstants.DUMMY_CLIENT_ID);
return rpcClientId;
}
示例7: getCallId
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
/** this has to be called after calling {@link #hasRpcIds()} */
public int getCallId() {
Preconditions.checkState(rpcCallId != RpcConstants.INVALID_CALL_ID);
return rpcCallId;
}
示例8: resetCall
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
public static void resetCall() {
Server.Call call = new Server.Call(RpcConstants.INVALID_CALL_ID, 1, null,
null, RpcKind.RPC_PROTOCOL_BUFFER, RpcConstants.DUMMY_CLIENT_ID);
Server.getCurCall().set(call);
}
示例9: reset
import org.apache.hadoop.ipc.RpcConstants; //导入依赖的package包/类
final void reset() {
txid = HdfsServerConstants.INVALID_TXID;
rpcClientId = RpcConstants.DUMMY_CLIENT_ID;
rpcCallId = RpcConstants.INVALID_CALL_ID;
resetSubFields();
}