HDDS-1281. Fix the findbug issue caused by HDDS-1163. Contributed by Aravindan Vijayan.

This commit is contained in:
Bharat Viswanadham 2019-03-15 21:06:44 -07:00
parent 2064ca015d
commit 926d548caa
No known key found for this signature in database
GPG Key ID: 6A6F3FB121D2F77C
3 changed files with 3 additions and 5 deletions

View File

@ -677,7 +677,7 @@ public class KeyValueContainer implements Container<KeyValueContainerData> {
KeyValueContainerCheck checker = KeyValueContainerCheck checker =
new KeyValueContainerCheck(containerData.getMetadataPath(), config, new KeyValueContainerCheck(containerData.getMetadataPath(), config,
containerId, containerData); containerId);
switch (level) { switch (level) {
case FAST_CHECK: case FAST_CHECK:

View File

@ -52,20 +52,18 @@ public class KeyValueContainerCheck {
private static final Logger LOG = LoggerFactory.getLogger(Container.class); private static final Logger LOG = LoggerFactory.getLogger(Container.class);
private long containerID; private long containerID;
private KeyValueContainerData inMemContainerData; //from caller, maybe null
private KeyValueContainerData onDiskContainerData; //loaded from fs/disk private KeyValueContainerData onDiskContainerData; //loaded from fs/disk
private Configuration checkConfig; private Configuration checkConfig;
private String metadataPath; private String metadataPath;
public KeyValueContainerCheck(String metadataPath, Configuration conf, public KeyValueContainerCheck(String metadataPath, Configuration conf,
long containerID, KeyValueContainerData containerData) { long containerID) {
Preconditions.checkArgument(metadataPath != null); Preconditions.checkArgument(metadataPath != null);
this.checkConfig = conf; this.checkConfig = conf;
this.containerID = containerID; this.containerID = containerID;
this.onDiskContainerData = null; this.onDiskContainerData = null;
this.inMemContainerData = containerData;
this.metadataPath = metadataPath; this.metadataPath = metadataPath;
} }

View File

@ -111,7 +111,7 @@ import static org.junit.Assert.assertTrue;
KeyValueContainerCheck kvCheck = KeyValueContainerCheck kvCheck =
new KeyValueContainerCheck(containerData.getMetadataPath(), conf, new KeyValueContainerCheck(containerData.getMetadataPath(), conf,
containerID, containerData); containerID);
// first run checks on a Open Container // first run checks on a Open Container
error = kvCheck.fastCheck(); error = kvCheck.fastCheck();