org.apache.hadoop.ipc.AlignmentContextpublic class PoolAlignmentContext
extends java.lang.Object
implements org.apache.hadoop.ipc.AlignmentContext
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.
| Modifier and Type | Method | Description |
|---|---|---|
void |
advanceClientStateId(java.lang.Long clientStateId) |
|
long |
getLastSeenStateId() |
|
long |
getPoolLocalStateId() |
|
boolean |
isCoordinatedCall(java.lang.String protocolName,
java.lang.String method) |
|
long |
receiveRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto header,
long threshold) |
Client side implementation only provides state alignment info in requests.
|
void |
receiveResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto header) |
Router updates a globally shared value using response from
namenodes.
|
void |
updateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header) |
Client side implementation for routers to provide state info in requests to
namenodes.
|
void |
updateResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.Builder header) |
Client side implementation only receives state alignment info.
|
public void updateResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.Builder header)
updateResponseState in interface org.apache.hadoop.ipc.AlignmentContextpublic void receiveResponseState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto header)
receiveResponseState in interface org.apache.hadoop.ipc.AlignmentContextpublic void updateRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.Builder header)
updateRequestState in interface org.apache.hadoop.ipc.AlignmentContextpublic long receiveRequestState(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto header,
long threshold)
throws java.io.IOException
receiveRequestState in interface org.apache.hadoop.ipc.AlignmentContextjava.io.IOExceptionpublic long getLastSeenStateId()
getLastSeenStateId in interface org.apache.hadoop.ipc.AlignmentContextpublic boolean isCoordinatedCall(java.lang.String protocolName,
java.lang.String method)
isCoordinatedCall in interface org.apache.hadoop.ipc.AlignmentContextpublic void advanceClientStateId(java.lang.Long clientStateId)
@VisibleForTesting public long getPoolLocalStateId()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.