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_r332386239
########## File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java ########## @@ -50,10 +49,17 @@ static boolean canUpdateOnError(HRegionLocation loc, HRegionLocation oldLoc) { oldLoc.getServerName().equals(loc.getServerName()); } + static void updateCachedLocationOnError(HRegionLocation loc, Throwable exception, + Function<HRegionLocation, HRegionLocation> cachedLocationSupplier, + Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache) { + updateCachedLocationOnError(loc, exception, cachedLocationSupplier, addToCache, + removeFromCache, null); + } + static void updateCachedLocationOnError(HRegionLocation loc, Throwable exception, Function<HRegionLocation, HRegionLocation> cachedLocationSupplier, Consumer<HRegionLocation> addToCache, Consumer<HRegionLocation> removeFromCache, - Optional<MetricsConnection> metrics) { + MetricsConnection metrics) { Review comment: If the metrics could be null then I do not think it is necessary to provide the method above? Just pass null when calling. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services