HDFS-11783. Ozone: Fix spotbugs warnings. Contributed by Weiwei Yang.
This commit is contained in:
parent
4be9710712
commit
744a052dc2
|
@ -262,16 +262,7 @@ public class VolumeDescriptor {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
for (String containerKey : containerMap.keySet()) {
|
||||
if (!other.containerMap.containsKey(containerKey)) {
|
||||
return false;
|
||||
}
|
||||
if (!containerMap.get(containerKey).equals(
|
||||
other.containerMap.get(containerKey))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return containerMap.equals(other.containerMap);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,6 @@ public class BlockManagerImpl implements BlockManager {
|
|||
}
|
||||
Options options = new Options();
|
||||
options.cacheSize(this.cacheSize * OzoneConsts.MB);
|
||||
options.createIfMissing();
|
||||
|
||||
// Write the block key to container name mapping.
|
||||
File blockContainerDbPath = new File(scmMetaDataDir, BLOCK_DB);
|
||||
|
|
|
@ -156,8 +156,12 @@ public class SQLCLI extends Configured implements Tool {
|
|||
LOG.error("Error processing output path {}", outPath);
|
||||
return -1;
|
||||
}
|
||||
if (!Files.exists(outPath.getParent())) {
|
||||
Files.createDirectories(outPath.getParent());
|
||||
|
||||
Path outParentPath = outPath.getParent();
|
||||
if (outParentPath != null) {
|
||||
if (!Files.exists(outParentPath)) {
|
||||
Files.createDirectories(outParentPath);
|
||||
}
|
||||
}
|
||||
LOG.info("Parent path [{}] db name [{}]", parentPath, dbName);
|
||||
if (dbName.toString().equals(CONTAINER_DB)) {
|
||||
|
|
|
@ -87,7 +87,6 @@ public class ContainerMapping implements Mapping {
|
|||
}
|
||||
Options options = new Options();
|
||||
options.cacheSize(this.cacheSize * OzoneConsts.MB);
|
||||
options.createIfMissing();
|
||||
|
||||
// Write the container name to pipeline mapping.
|
||||
File containerDBPath = new File(scmMetaDataDir, CONTAINER_DB);
|
||||
|
|
|
@ -89,7 +89,6 @@ public final class SCMNodePoolManager implements NodePoolManager {
|
|||
}
|
||||
Options options = new Options();
|
||||
options.cacheSize(cacheSize * OzoneConsts.MB);
|
||||
options.createIfMissing();
|
||||
|
||||
File nodePoolDBPath = new File(scmMetaDataDir, NODEPOOL_DB);
|
||||
nodePoolStore = new LevelDBStore(nodePoolDBPath, options);
|
||||
|
|
Loading…
Reference in New Issue