HDFS-11287. Storage class member storageDirs should be private to avoid unprotected access by derived classes. (Manoj Govindassamy via lei)
(cherry picked from commit 63320d1daa
)
This commit is contained in:
parent
8d6fa4569b
commit
541efe18c7
|
@ -123,9 +123,9 @@ public abstract class Storage extends StorageInfo {
|
|||
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 @@ public class BlockPoolSliceStorage extends Storage {
|
|||
it.hasNext(); ) {
|
||||
StorageDirectory sd = it.next();
|
||||
if (sd.getRoot().getAbsoluteFile().equals(absPathToRemove)) {
|
||||
this.storageDirs.remove(sd);
|
||||
getStorageDirs().remove(sd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -519,7 +519,7 @@ public class DataStorage extends Storage {
|
|||
bpsStorage.remove(bpRoot.getAbsoluteFile());
|
||||
}
|
||||
|
||||
this.storageDirs.remove(sd);
|
||||
getStorageDirs().remove(sd);
|
||||
try {
|
||||
sd.unlock();
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue