dlmarion commented on code in PR #3292:
URL: https://github.com/apache/accumulo/pull/3292#discussion_r1170066848


##########
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:
   I'm curious about the use case where `HostingNeed.HOSTED` is passed to 
`locateTablet` and the Tablet is not hosted and the method returns null. To me, 
`locateTabletWithRetry` should not be necessary. `locateTablet` should 
internally retry when `HOSTED` is specified. 



-- 
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]

Reply via email to