@@ -577,7 +577,7 @@ public void checkIfShouldMoveSystemRegionAsync() {
577
577
List <RegionPlan > plans = new ArrayList <>();
578
578
// TODO: I don't think this code does a good job if all servers in cluster have same
579
579
// version. It looks like it will schedule unnecessary moves.
580
- for (ServerName server : getExcludedServersForSystemTable (true )) {
580
+ for (ServerName server : getExcludedServersForSystemTable ()) {
581
581
if (master .getServerManager ().isServerDead (server )) {
582
582
// TODO: See HBASE-18494 and HBASE-18495. Though getExcludedServersForSystemTable()
583
583
// considers only online servers, the server could be queued for dead server
@@ -2302,16 +2302,6 @@ private void addToPendingAssignment(final HashMap<RegionInfo, RegionStateNode> r
2302
2302
}
2303
2303
}
2304
2304
2305
- /**
2306
- * For a given cluster with mixed versions of servers, get a list of
2307
- * servers with lower versions, where system table regions should not be
2308
- * assigned to.
2309
- * For system table, we must assign regions to a server with highest version.
2310
- */
2311
- public List <ServerName > getExcludedServersForSystemTable () {
2312
- return getExcludedServersForSystemTable (false );
2313
- }
2314
-
2315
2305
/**
2316
2306
* For a given cluster with mixed versions of servers, get a list of
2317
2307
* servers with lower versions, where system table regions should not be
@@ -2321,15 +2311,9 @@ public List<ServerName> getExcludedServersForSystemTable() {
2321
2311
* "hbase.min.version.move.system.tables" if checkForMinVersion is true.
2322
2312
* Detailed explanation available with definition of minVersionToMoveSysTables.
2323
2313
*
2324
- * @param checkForMinVersion If false, return a list of servers with lower version. If true,
2325
- * compare higher version with minVersionToMoveSysTables. Only if higher version is greater
2326
- * than minVersionToMoveSysTables, this method returns list of servers with lower version. If
2327
- * higher version is less than or equal to minVersionToMoveSysTables, returns empty list.
2328
- * An example is provided with definition of minVersionToMoveSysTables.
2329
2314
* @return List of Excluded servers for System table regions.
2330
2315
*/
2331
- private List <ServerName > getExcludedServersForSystemTable (
2332
- boolean checkForMinVersion ) {
2316
+ public List <ServerName > getExcludedServersForSystemTable () {
2333
2317
// TODO: This should be a cached list kept by the ServerManager rather than calculated on each
2334
2318
// move or system region assign. The RegionServerTracker keeps list of online Servers with
2335
2319
// RegionServerInfo that includes Version.
@@ -2342,12 +2326,11 @@ private List<ServerName> getExcludedServersForSystemTable(
2342
2326
}
2343
2327
String highestVersion = Collections .max (serverList ,
2344
2328
(o1 , o2 ) -> VersionInfo .compareVersion (o1 .getSecond (), o2 .getSecond ())).getSecond ();
2345
- if (checkForMinVersion ) {
2346
- if (!DEFAULT_MIN_VERSION_MOVE_SYS_TABLES_CONFIG .equals (minVersionToMoveSysTables )) {
2347
- int comparedValue = VersionInfo .compareVersion (minVersionToMoveSysTables , highestVersion );
2348
- if (comparedValue > 0 ) {
2349
- return Collections .emptyList ();
2350
- }
2329
+ if (!DEFAULT_MIN_VERSION_MOVE_SYS_TABLES_CONFIG .equals (minVersionToMoveSysTables )) {
2330
+ int comparedValue = VersionInfo .compareVersion (minVersionToMoveSysTables ,
2331
+ highestVersion );
2332
+ if (comparedValue > 0 ) {
2333
+ return Collections .emptyList ();
2351
2334
}
2352
2335
}
2353
2336
return serverList .stream ()
0 commit comments