ivandika3 commented on code in PR #11289:
URL: https://github.com/apache/ozone/pull/11289#discussion_r4068091295
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/HadoopRpcOMFollowerReadFailoverProxyProvider.java:
##########
@@ -148,34 +144,56 @@ public RetryPolicy getRetryPolicy(int maxFailovers) {
// for a few reasons
// 1. We want to ensure that the retry policy behavior remains the same
when we use the leader proxy
// (when follower read is disabled or using write request)
- // 2. The FollowerInvocationHandler is also written so that the thrown
exception is handled by the
+ // 2. The FollowerReadProxy is also written so that the thrown exception
is handled by the
// OMFailoverProxyProviderbase's RetryPolicy
return leaderProxy.getRetryPolicy(maxFailovers);
}
/**
- * Parse the OM request from the request args.
- *
- * @return parsed OM request.
+ * Create a client that applies the default consistency hint once, before
entering the retry loop.
*/
- private static OMRequest parseOMRequest(Object[] args) throws
ServiceException {
- String error = null;
- if (args == null) {
- error = "args == null";
- } else if (args.length < 2) {
- error = "args.length == " + args.length + " < 2";
- } else if (args[1] == null) {
- error = "args[1] == null";
- } else if (!(args[1] instanceof OMRequest)) {
- error = "Non-OMRequest: " + args[1].getClass();
+ public OzoneManagerProtocolPB newProxy(int maxFailovers) {
+ OzoneManagerProtocolPB retryProxy = (OzoneManagerProtocolPB)
RetryProxy.create(
+ OzoneManagerProtocolPB.class, this, getRetryPolicy(maxFailovers));
+ return new ReadConsistencyProxy(retryProxy);
+ }
Review Comment:
Let's document the multiple layer of proxy wrappings.
My understanding is now it's
- `ReadConsistencyProxy`
- `RetryProxy`
- `HadoopRpcOMFollowerReadFailoverProxyProvider`
- `HadoopRpcOMFailoverProxyProvider`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]