HBASE-26185 Return mutable list in AssignmentManager#getExcludedServersForSystemTable (#3577)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
Rushabh Shah 2021-08-12 04:16:22 -04:00 committed by GitHub
parent 5e8a269b1a
commit d307a8f2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2322,7 +2322,7 @@ public class AssignmentManager {
.map(s->new Pair<>(s, master.getRegionServerVersion(s))) .map(s->new Pair<>(s, master.getRegionServerVersion(s)))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (serverList.isEmpty()) { if (serverList.isEmpty()) {
return Collections.emptyList(); return new ArrayList<>();
} }
String highestVersion = Collections.max(serverList, String highestVersion = Collections.max(serverList,
(o1, o2) -> VersionInfo.compareVersion(o1.getSecond(), o2.getSecond())).getSecond(); (o1, o2) -> VersionInfo.compareVersion(o1.getSecond(), o2.getSecond())).getSecond();
@ -2330,7 +2330,7 @@ public class AssignmentManager {
int comparedValue = VersionInfo.compareVersion(minVersionToMoveSysTables, int comparedValue = VersionInfo.compareVersion(minVersionToMoveSysTables,
highestVersion); highestVersion);
if (comparedValue > 0) { if (comparedValue > 0) {
return Collections.emptyList(); return new ArrayList<>();
} }
} }
return serverList.stream() return serverList.stream()