From 926d548caabdfcfbf7a75dcf0657e8dde6d9710a Mon Sep 17 00:00:00 2001 From: Bharat Viswanadham Date: Fri, 15 Mar 2019 21:06:44 -0700 Subject: [PATCH] HDDS-1281. Fix the findbug issue caused by HDDS-1163. Contributed by Aravindan Vijayan. --- .../hadoop/ozone/container/keyvalue/KeyValueContainer.java | 2 +- .../ozone/container/keyvalue/KeyValueContainerCheck.java | 4 +--- .../ozone/container/keyvalue/TestKeyValueContainerCheck.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java index 20dfd9c925..47af1107ff 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java @@ -677,7 +677,7 @@ public void check() throws StorageContainerException { KeyValueContainerCheck checker = new KeyValueContainerCheck(containerData.getMetadataPath(), config, - containerId, containerData); + containerId); switch (level) { case FAST_CHECK: diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java index 5366c27c77..b1ab1e1af8 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java @@ -52,20 +52,18 @@ public class KeyValueContainerCheck { private static final Logger LOG = LoggerFactory.getLogger(Container.class); private long containerID; - private KeyValueContainerData inMemContainerData; //from caller, maybe null private KeyValueContainerData onDiskContainerData; //loaded from fs/disk private Configuration checkConfig; private String metadataPath; public KeyValueContainerCheck(String metadataPath, Configuration conf, - long containerID, KeyValueContainerData containerData) { + long containerID) { Preconditions.checkArgument(metadataPath != null); this.checkConfig = conf; this.containerID = containerID; this.onDiskContainerData = null; - this.inMemContainerData = containerData; this.metadataPath = metadataPath; } diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerCheck.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerCheck.java index 79abc2fc56..3395214895 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerCheck.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerCheck.java @@ -111,7 +111,7 @@ public TestKeyValueContainerCheck(String metadataImpl) { KeyValueContainerCheck kvCheck = new KeyValueContainerCheck(containerData.getMetadataPath(), conf, - containerID, containerData); + containerID); // first run checks on a Open Container error = kvCheck.fastCheck();