keith-turner commented on code in PR #3292:
URL: https://github.com/apache/accumulo/pull/3292#discussion_r1170646911
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletLocator.java:
##########
@@ -58,33 +61,81 @@ boolean isValid() {
return isValid;
}
+ /**
+ * Used to indicate if a user of this interface needs a tablet hosted or
not. This simple enum was
+ * created instead of using a boolean for code clarity.
+ */
+ public enum HostingNeed {
+ HOSTED, NONE
+ }
+
+ // ELASTICITY_TODO rename to findTablet
+ /**
+ * Finds the tablet that contains the given row.
+ *
+ * @param hostingNeed When {@link HostingNeed#HOSTED} is passed will only
return a tablet if it
+ * has location. When {@link HostingNeed#NONE} is passed will return
the tablet that
+ * overlaps the row.
+ *
+ * @return overlapping tablet. If no overlapping tablet exists, returns
null. If hosting is
+ * required and the tablet currently has no location ,returns null.
+ */
public abstract TabletLocation locateTablet(ClientContext context, Text row,
boolean skipRow,
- boolean retry) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException;
+ HostingNeed hostingNeed)
+ throws AccumuloException, AccumuloSecurityException,
TableNotFoundException;
+
+ public TabletLocation locateTabletWithRetry(ClientContext context, Text row,
boolean skipRow,
Review Comment:
There were many (maybe 11) cases passing false for retry and a few (maybe 2)
passing true. So when I was making changes I decided pulling the retry out
simplified the code. The code that was passing false for retry was doing its
own thing and in some cases did not want to retry forever (like scan timeout
setting) or wanted to do other stuff in the retry loop.
--
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]