[enhancement](Tablet) rename pathHashToDishInfoRef to pathHashToDiskInfoRef (#24311)

This commit is contained in:
xy720
2023-09-16 18:39:11 +08:00
committed by GitHub
parent 990d6c02ec
commit de50fb5a46
2 changed files with 5 additions and 5 deletions

View File

@ -563,7 +563,7 @@ public class Tablet extends MetaObject implements Writable {
// 3. replica is under relocating
if (stable < replicationNum) {
List<Long> replicaBeIds = replicas.stream().map(Replica::getBackendId).collect(Collectors.toList());
Set<Long> replicaBeIds = replicas.stream().map(Replica::getBackendId).collect(Collectors.toSet());
List<Long> availableBeIds = aliveBeIds.stream().filter(systemInfoService::checkBackendScheduleAvailable)
.collect(Collectors.toList());
if (replicaBeIds.containsAll(availableBeIds)

View File

@ -77,7 +77,7 @@ public class SystemInfoService {
private volatile ImmutableMap<Long, Backend> idToBackendRef = ImmutableMap.of();
private volatile ImmutableMap<Long, AtomicLong> idToReportVersionRef = ImmutableMap.of();
private volatile ImmutableMap<Long, DiskInfo> pathHashToDishInfoRef = ImmutableMap.of();
private volatile ImmutableMap<Long, DiskInfo> pathHashToDiskInfoRef = ImmutableMap.of();
public static class HostInfo implements Comparable<HostInfo> {
public String host;
@ -848,7 +848,7 @@ public class SystemInfoService {
*/
public Status checkExceedDiskCapacityLimit(Multimap<Long, Long> bePathsMap, boolean floodStage) {
LOG.debug("pathBeMap: {}", bePathsMap);
ImmutableMap<Long, DiskInfo> pathHashToDiskInfo = pathHashToDishInfoRef;
ImmutableMap<Long, DiskInfo> pathHashToDiskInfo = pathHashToDiskInfoRef;
for (Long beId : bePathsMap.keySet()) {
for (Long pathHash : bePathsMap.get(beId)) {
DiskInfo diskInfo = pathHashToDiskInfo.get(pathHash);
@ -865,7 +865,7 @@ public class SystemInfoService {
// update the path info when disk report
// there is only one thread can update path info, so no need to worry about concurrency control
public void updatePathInfo(List<DiskInfo> addedDisks, List<DiskInfo> removedDisks) {
Map<Long, DiskInfo> copiedPathInfos = Maps.newHashMap(pathHashToDishInfoRef);
Map<Long, DiskInfo> copiedPathInfos = Maps.newHashMap(pathHashToDiskInfoRef);
for (DiskInfo diskInfo : addedDisks) {
copiedPathInfos.put(diskInfo.getPathHash(), diskInfo);
}
@ -873,7 +873,7 @@ public class SystemInfoService {
copiedPathInfos.remove(diskInfo.getPathHash());
}
ImmutableMap<Long, DiskInfo> newPathInfos = ImmutableMap.copyOf(copiedPathInfos);
pathHashToDishInfoRef = newPathInfos;
pathHashToDiskInfoRef = newPathInfos;
LOG.debug("update path infos: {}", newPathInfos);
}