From f0a6d17e3b84094d0d06ee32000008938c35e89f Mon Sep 17 00:00:00 2001 From: Arpit Agarwal Date: Mon, 31 Oct 2016 12:39:54 -0700 Subject: [PATCH] HDFS-11074. Remove unused method FsDatasetSpi#getFinalizedBlocksOnPersistentStorage. Contributed by Hanisha Koneru. --- .../datanode/fsdataset/FsDatasetSpi.java | 3 --- .../fsdataset/impl/FsDatasetImpl.java | 19 ------------------- .../server/datanode/SimulatedFSDataset.java | 5 ----- .../extdataset/ExternalDatasetImpl.java | 5 ----- 4 files changed, 32 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/FsDatasetSpi.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/FsDatasetSpi.java index 19f580abc37..f7c3711357b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/FsDatasetSpi.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/FsDatasetSpi.java @@ -242,9 +242,6 @@ public interface FsDatasetSpi extends FSDatasetMBean { */ List getFinalizedBlocks(String bpid); - /** @return a list of finalized blocks for the given block pool. */ - List getFinalizedBlocksOnPersistentStorage(String bpid); - /** * Check whether the in-memory block record matches the block on the disk, * and, in case that they are not matched, update the record or mark it diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index c4431f53fbe..ce3c144c2f9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -1863,25 +1863,6 @@ class FsDatasetImpl implements FsDatasetSpi { } } - /** - * Get the list of finalized blocks from in-memory blockmap for a block pool. - */ - @Override - public List - getFinalizedBlocksOnPersistentStorage(String bpid) { - try(AutoCloseableLock lock = datasetLock.acquire()) { - ArrayList finalized = - new ArrayList(volumeMap.size(bpid)); - for (ReplicaInfo b : volumeMap.replicas(bpid)) { - if (!b.getVolume().isTransientStorage() && - b.getState() == ReplicaState.FINALIZED) { - finalized.add(new FinalizedReplica((FinalizedReplica) b)); - } - } - return finalized; - } - } - /** * Check if a block is valid. * diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java index d1a982f7aef..cda7672aa48 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java @@ -1311,11 +1311,6 @@ public class SimulatedFSDataset implements FsDatasetSpi { throw new UnsupportedOperationException(); } - @Override - public List getFinalizedBlocksOnPersistentStorage(String bpid) { - throw new UnsupportedOperationException(); - } - @Override public Map getVolumeInfoMap() { throw new UnsupportedOperationException(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/extdataset/ExternalDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/extdataset/ExternalDatasetImpl.java index 738f338d296..1bbf9de03a8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/extdataset/ExternalDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/extdataset/ExternalDatasetImpl.java @@ -92,11 +92,6 @@ public class ExternalDatasetImpl implements FsDatasetSpi { return null; } - @Override - public List getFinalizedBlocksOnPersistentStorage(String bpid) { - return null; - } - @Override public void checkAndUpdate(String bpid, long blockId, File diskFile, File diskMetaFile, FsVolumeSpi vol) {