Package org.apache.hadoop.hdfs
Class ClientGSIContext
java.lang.Object
org.apache.hadoop.hdfs.ClientGSIContext
- All Implemented Interfaces:
org.apache.hadoop.ipc.AlignmentContext
@Private
@Evolving
public class ClientGSIContext
extends Object
implements org.apache.hadoop.ipc.AlignmentContext
Global State Id context for the client.
This is the client side implementation responsible for receiving state alignment info from server(s).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongorg.apache.hadoop.thirdparty.protobuf.ByteStringgetRouterFederatedStateMap(org.apache.hadoop.thirdparty.protobuf.ByteString byteString) Utility function to parse routerFederatedState field in RPC headers.booleanisCoordinatedCall(String protocolName, String method) static org.apache.hadoop.thirdparty.protobuf.ByteStringmergeRouterFederatedState(org.apache.hadoop.thirdparty.protobuf.ByteString state1, org.apache.hadoop.thirdparty.protobuf.ByteString state2) Merge state1 and state2 to get the max value for each namespace.longreceiveRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto header, long threshold) Client side implementation only provides state alignment info in requests.voidreceiveResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto header) Client side implementation for receiving state alignment info in responses.voidupdateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header) Client side implementation for providing state alignment info in requests.voidupdateResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.Builder header) Client side implementation only receives state alignment info.
-
Constructor Details
-
ClientGSIContext
public ClientGSIContext() -
ClientGSIContext
-
-
Method Details
-
getLastSeenStateId
public long getLastSeenStateId()- Specified by:
getLastSeenStateIdin interfaceorg.apache.hadoop.ipc.AlignmentContext
-
isCoordinatedCall
- Specified by:
isCoordinatedCallin interfaceorg.apache.hadoop.ipc.AlignmentContext
-
updateResponseState
public void updateResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.Builder header) Client side implementation only receives state alignment info. It does not provide state alignment info therefore this does nothing.- Specified by:
updateResponseStatein interfaceorg.apache.hadoop.ipc.AlignmentContext
-
receiveResponseState
public void receiveResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto header) Client side implementation for receiving state alignment info in responses.- Specified by:
receiveResponseStatein interfaceorg.apache.hadoop.ipc.AlignmentContext
-
getRouterFederatedStateMap
public static Map<String,Long> getRouterFederatedStateMap(org.apache.hadoop.thirdparty.protobuf.ByteString byteString) Utility function to parse routerFederatedState field in RPC headers. -
mergeRouterFederatedState
public static org.apache.hadoop.thirdparty.protobuf.ByteString mergeRouterFederatedState(org.apache.hadoop.thirdparty.protobuf.ByteString state1, org.apache.hadoop.thirdparty.protobuf.ByteString state2) Merge state1 and state2 to get the max value for each namespace.- Parameters:
state1- input ByteString.state2- input ByteString.- Returns:
- one ByteString object which contains the max value of each namespace.
-
updateRequestState
public void updateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header) Client side implementation for providing state alignment info in requests.- Specified by:
updateRequestStatein interfaceorg.apache.hadoop.ipc.AlignmentContext
-
receiveRequestState
public long receiveRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto header, long threshold) throws IOException Client side implementation only provides state alignment info in requests. Client does not receive RPC requests therefore this does nothing.- Specified by:
receiveRequestStatein interfaceorg.apache.hadoop.ipc.AlignmentContext- Throws:
IOException
-
getRouterFederatedState
@VisibleForTesting public org.apache.hadoop.thirdparty.protobuf.ByteString getRouterFederatedState()
-