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


##########
core/src/main/java/org/apache/accumulo/core/spi/balancer/TabletBalancer.java:
##########
@@ -138,4 +133,15 @@ interface BalanceParameters {
    * @return the time, in milliseconds, to wait before re-balancing.
    */
   long balance(BalanceParameters params);
+
+  /**
+   * Ask the balancer if the tablet is hosted by a TabletServer in the defined 
resource group
+   *
+   * @return true if TabletServer is in the configured resource group, false 
otherwise
+   * @since 4.0.0
+   */
+  default boolean isHostedInResourceGroup(Configuration conf, TabletServerId 
currentLocation,
+      Map<String,Set<TabletServerId>> currentTServerGrouping) {
+    return true;
+  }

Review Comment:
   IIRC you suggested that we perform this check in TabletManagementIterator 
(TMI). I can't call `balancer.init()`from the iterator because I don't have 
access to `ServerContext` to construct a `BalancerEnvironmentImpl`. If someone 
can point me to a way around this, then I should be able to simplify the method 
API. I don't think `getDesiredResourceGroup` is a good name as one of the 
earlier suggestions was to *not* fall back to using the `default` group if the 
specified group did not have any servers.
   
   This method is called from `TabletMetadata.getTabletState` as it's common to 
both TGW and TMI, and it seems appropriate because it returns 
`TabletState.ASSIGNED_TO_WRONG_GROUP`.
   
   I'm not sure how to implement your suggestion.



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