HDFS-9377. Fix findbugs warnings in FSDirSnapshotOp. (Mingliang Liu via Yongjun Zhang)

This commit is contained in:
Yongjun Zhang 2015-11-05 14:36:12 -08:00
parent 21c0e3eda5
commit 286cc6483f
2 changed files with 4 additions and 2 deletions

View File

@ -1626,6 +1626,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9363. Add fetchReplica() to FsDatasetTestUtils to return FsDataset-agnostic HDFS-9363. Add fetchReplica() to FsDatasetTestUtils to return FsDataset-agnostic
replica. (Tony Wu via lei) replica. (Tony Wu via lei)
HDFS-9377. Fix findbugs warnings in FSDirSnapshotOp.
(Mingliang Liu via Yongjun Zhang)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -171,8 +171,7 @@ class FSDirSnapshotOp {
static Collection<String> getSnapshotFiles(FSDirectory fsd, static Collection<String> getSnapshotFiles(FSDirectory fsd,
List<DirectorySnapshottableFeature> lsf, List<DirectorySnapshottableFeature> lsf,
String file) throws IOException { String file) throws IOException {
ArrayList<String> snaps = new ArrayList<String>(); ArrayList<String> snaps = new ArrayList<>();
ListIterator<DirectorySnapshottableFeature> sfi = lsf.listIterator();
for (DirectorySnapshottableFeature sf : lsf) { for (DirectorySnapshottableFeature sf : lsf) {
// for each snapshottable dir e.g. /dir1, /dir2 // for each snapshottable dir e.g. /dir1, /dir2
final ReadOnlyList<Snapshot> lsnap = sf.getSnapshotList(); final ReadOnlyList<Snapshot> lsnap = sf.getSnapshotList();