Class PoolAlignmentContext
java.lang.Object
org.apache.hadoop.hdfs.server.federation.router.PoolAlignmentContext
- All Implemented Interfaces:
org.apache.hadoop.ipc.AlignmentContext
An alignment context shared by all connections in a
ConnectionPool.
There is a distinct connection pool for each [namespace,UGI] pairing.
sharedGlobalStateId is a reference to a
shared LongAccumulator object in the RouterStateIdContext.
poolLocalStateId is specific to each PoolAlignmentContext.
The shared sharedGlobalStateId is updated only using
responses from NameNodes, so clients cannot poison it.
poolLocalStateId is used to propagate client observed
state into NameNode requests. A misbehaving client can poison this but the effect is only
visible to other clients with the same UGI and accessing the same namespace.
-
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceClientStateId(Long clientStateId) longlongbooleanisCoordinatedCall(String protocolName, String method) 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) Router updates a globally shared value using response from namenodes.voidupdateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header) Client side implementation for routers to provide state info in requests to namenodes.voidupdateResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.Builder header) Client side implementation only receives state alignment info.
-
Method Details
-
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) Router updates a globally shared value using response from namenodes.- Specified by:
receiveResponseStatein interfaceorg.apache.hadoop.ipc.AlignmentContext
-
updateRequestState
public void updateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header) Client side implementation for routers to provide state info in requests to namenodes.- 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
-
getLastSeenStateId
public long getLastSeenStateId()- Specified by:
getLastSeenStateIdin interfaceorg.apache.hadoop.ipc.AlignmentContext
-
isCoordinatedCall
- Specified by:
isCoordinatedCallin interfaceorg.apache.hadoop.ipc.AlignmentContext
-
advanceClientStateId
-
getPoolLocalStateId
@VisibleForTesting public long getPoolLocalStateId()
-