Apache9 commented on a change in pull request #673: HBASE-23093 : Avoid 
Optional Anti-Pattern where possible
URL: https://github.com/apache/hbase/pull/673#discussion_r332387562
 
 

 ##########
 File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncTableImpl.java
 ##########
 @@ -220,7 +220,8 @@ private static Result toResult(HBaseRpcController 
controller, MutateResponse res
   public CompletableFuture<Result> get(Get get) {
     return timelineConsistentRead(conn.getLocator(), tableName, get, 
get.getRow(),
       RegionLocateType.CURRENT, replicaId -> get(get, replicaId), 
readRpcTimeoutNs,
-      conn.connConf.getPrimaryCallTimeoutNs(), retryTimer, 
conn.getConnectionMetrics());
+      conn.connConf.getPrimaryCallTimeoutNs(), retryTimer,
+      conn.getConnectionMetrics().orElse(null));
 
 Review comment:
   This is what I mean, we unwrap the Optional, and then check if it is null, 
this does not make sense...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to