HDFS-11287. Storage class member storageDirs should be private to avoid unprotected access by derived classes. (Manoj Govindassamy via lei)
This commit is contained in:
parent
724bb86351
commit
63320d1daa
|
@ -124,9 +124,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;
|
||||
|
|
|
@ -299,7 +299,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -508,7 +508,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