rmdmattingly commented on code in PR #6722:
URL: https://github.com/apache/hbase/pull/6722#discussion_r1971666785
##########
hbase-balancer/src/test/java/org/apache/hadoop/hbase/master/balancer/CandidateGeneratorTestUtil.java:
##########
@@ -233,6 +233,41 @@ static boolean
areAllReplicasDistributed(BalancerClusterState cluster) {
return true;
}
+ /**
+ * Generic method to validate table isolation.
+ */
+ static boolean isTableIsolated(BalancerClusterState cluster, TableName
tableName,
+ String tableType) {
+ for (int i = 0; i < cluster.numServers; i++) {
+ int[] regionsOnServer = cluster.regionsPerServer[i];
+ if (regionsOnServer == null || regionsOnServer.length == 0) {
+ continue; // Skip empty servers
+ }
+
+ boolean hasTargetTableRegion = false;
+ boolean hasOtherTableRegion = false;
+
+ for (int regionIndex : regionsOnServer) {
+ RegionInfo regionInfo = cluster.regions[regionIndex];
+ if (regionInfo.getTable().equals(tableName)) {
+ hasTargetTableRegion = true;
+ } else {
+ hasOtherTableRegion = true;
+ }
+
+ // If the target table and any other table are on the same server,
isolation is violated
+ if (hasTargetTableRegion && hasOtherTableRegion) {
+ LOG.warn(
Review Comment:
No good reason, I think debug would make sense
--
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]