From e4dfdcee9f5312ba716b8297778db8bd3434db2d Mon Sep 17 00:00:00 2001 From: Jitendra Pandey Date: Tue, 16 Oct 2018 10:34:16 -0700 Subject: [PATCH] HDDS-667. Fix TestOzoneFileInterfaces. Contributed by Mukul Kumar Singh. --- .../ozone/container/keyvalue/impl/BlockManagerImpl.java | 4 ++-- .../java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java index 7fa0cfb92e3..67cda9f5ac1 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java @@ -53,6 +53,8 @@ import static org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.Res public class BlockManagerImpl implements BlockManager { static final Logger LOG = LoggerFactory.getLogger(BlockManagerImpl.class); + private static byte[] blockCommitSequenceIdKey = + DFSUtil.string2Bytes(OzoneConsts.BLOCK_COMMIT_SEQUENCE_ID_PREFIX); private Configuration config; @@ -89,8 +91,6 @@ public class BlockManagerImpl implements BlockManager { Preconditions.checkNotNull(db, "DB cannot be null here"); long blockCommitSequenceId = data.getBlockCommitSequenceId(); - byte[] blockCommitSequenceIdKey = - DFSUtil.string2Bytes(OzoneConsts.BLOCK_COMMIT_SEQUENCE_ID_PREFIX); byte[] blockCommitSequenceIdValue = db.get(blockCommitSequenceIdKey); // default blockCommitSequenceId for any block is 0. It the putBlock diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java index 71a4befcf63..ae5245194d3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java @@ -35,6 +35,7 @@ import org.apache.hadoop.ozone.client.OzoneClient; import org.apache.hadoop.ozone.client.OzoneClientFactory; import org.apache.hadoop.ozone.client.rest.OzoneException; import org.apache.hadoop.ozone.common.Storage.StorageState; +import org.apache.hadoop.ozone.container.common.utils.ContainerCache; import org.apache.hadoop.ozone.om.OMConfigKeys; import org.apache.hadoop.ozone.om.OzoneManager; import org.apache.hadoop.hdds.scm.server.SCMStorage; @@ -283,6 +284,7 @@ public final class MiniOzoneClusterImpl implements MiniOzoneCluster { scm.getClientProtocolServer().getScmInfo().getClusterId())); stop(); FileUtils.deleteDirectory(baseDir); + ContainerCache.getInstance(conf).shutdownCache(); } catch (IOException e) { LOG.error("Exception while shutting down the cluster.", e); }