keith-turner commented on code in PR #3496:
URL: https://github.com/apache/accumulo/pull/3496#discussion_r1259876937


##########
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:
   > I can't call balancer.init()from the iterator because I don't have access 
to ServerContext to construct a BalancerEnvironmentImpl
   
   Could add a constructor like the following.  I think this is ok as this is 
internal Accumulo code and we know the actual type behind the ServiceEnv 
interface.
   
   ```java
   public BalancerEnvironmentImpl(ServiceEnvironment env) {
       super(((ServiceEnvironmentImpl) env).getContext());
     }
   ```
   
   > 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.
   
   Thats a good point, maybe `getRequiredResourceGroup` is a better name.



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