HDFS-11287. Storage class member storageDirs should be private to avoid unprotected access by derived classes. (Manoj Govindassamy via lei)
(cherry picked from commit 63320d1daab7ce846bb180623378efe431ad8c52)
This commit is contained in:
parent
8d6fa4569b
commit
541efe18c7
@ -123,9 +123,9 @@ public interface StorageDirType {
|
||||
public boolean isOfType(StorageDirType type);
|
||||
}
|
||||
|
||||
protected List<StorageDirectory> storageDirs =
|
||||
private final List<StorageDirectory> storageDirs =
|
||||
new CopyOnWriteArrayList<>();
|
||||
|
||||
|
||||
private class DirIterator implements Iterator<StorageDirectory> {
|
||||
final StorageDirType dirType;
|
||||
final boolean includeShared;
|
||||
|
@ -296,7 +296,7 @@ void remove(File absPathToRemove) {
|
||||
it.hasNext(); ) {
|
||||
StorageDirectory sd = it.next();
|
||||
if (sd.getRoot().getAbsoluteFile().equals(absPathToRemove)) {
|
||||
this.storageDirs.remove(sd);
|
||||
getStorageDirs().remove(sd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ synchronized void removeVolumes(final Set<File> dirsToRemove)
|
||||
bpsStorage.remove(bpRoot.getAbsoluteFile());
|
||||
}
|
||||
|
||||
this.storageDirs.remove(sd);
|
||||
getStorageDirs().remove(sd);
|
||||
try {
|
||||
sd.unlock();
|
||||
} catch (IOException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user