hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [1/2] hadoop git commit: HDDS-762. Fix unit test failure for TestContainerSQLCli & TestSCMMetrics. Contributed by Mukul Kumar Singh.
Date Wed, 31 Oct 2018 02:37:03 GMT
Repository: hadoop
Updated Branches:
  refs/heads/ozone-0.3 5e48a7047 -> 382b73a10


HDDS-762. Fix unit test failure for TestContainerSQLCli & TestSCMMetrics.
Contributed by Mukul Kumar Singh.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9cc2ce16
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9cc2ce16
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9cc2ce16

Branch: refs/heads/ozone-0.3
Commit: 9cc2ce16450edb0c23a18c4e5016e07919fb4ef2
Parents: 5e48a70
Author: Anu Engineer <aengineer@apache.org>
Authored: Tue Oct 30 19:25:13 2018 -0700
Committer: Anu Engineer <aengineer@apache.org>
Committed: Tue Oct 30 19:25:13 2018 -0700

----------------------------------------------------------------------
 .../container/TestContainerStateManagerIntegration.java | 12 +++++++-----
 .../common/transport/server/ratis/TestCSMMetrics.java   | 10 +++++++---
 hadoop-project/pom.xml                                  |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9cc2ce16/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
----------------------------------------------------------------------
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
index ed8b1e3..f08ae80 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
@@ -40,12 +40,13 @@ import org.junit.Before;
 import org.junit.Test;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.NavigableSet;
 import java.util.Random;
 import org.slf4j.event.Level;
 
+import static org.apache.hadoop.hdds.scm.ScmConfigKeys
+    .OZONE_SCM_DB_CACHE_SIZE_DEFAULT;
+
 /**
  * Tests for ContainerStateManager.
  */
@@ -120,13 +121,11 @@ public class TestContainerStateManagerIntegration {
   public void testContainerStateManagerRestart() throws IOException {
     // Allocate 5 containers in ALLOCATED state and 5 in CREATING state
 
-    List<ContainerInfo> containers = new ArrayList<>();
     for (int i = 0; i < 10; i++) {
       ContainerWithPipeline container = scm.getClientProtocolServer()
           .allocateContainer(
               xceiverClientManager.getType(),
               xceiverClientManager.getFactor(), containerOwner);
-      containers.add(container.getContainerInfo());
       if (i >= 5) {
         scm.getContainerManager().updateContainerState(container
                 .getContainerInfo().getContainerID(),
@@ -134,10 +133,13 @@ public class TestContainerStateManagerIntegration {
       }
     }
 
+    cluster.getStorageContainerManager().stop();
     // New instance of ContainerStateManager should load all the containers in
     // container store.
     ContainerStateManager stateManager =
-        new ContainerStateManager(conf, containerManager, selector);
+        new SCMContainerManager(conf, scm.getScmNodeManager(),
+            OZONE_SCM_DB_CACHE_SIZE_DEFAULT,
+            scm.getEventQueue()).getStateManager();
     int matchCount = stateManager
         .getMatchingContainerIDs(containerOwner,
             xceiverClientManager.getType(), xceiverClientManager.getFactor(),

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9cc2ce16/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java
----------------------------------------------------------------------
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java
index 2c94f3b..8ba51d1 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java
@@ -47,6 +47,7 @@ import org.apache.hadoop.test.GenericTestUtils;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 
 import static org.apache.ratis.rpc.SupportedRpcType.GRPC;
+import org.apache.ratis.protocol.RaftGroupId;
 import org.apache.ratis.util.CheckedBiConsumer;
 
 import java.util.function.BiConsumer;
@@ -104,7 +105,8 @@ public class TestCSMMetrics {
       client.connect();
 
       // Before Read Chunk/Write Chunk
-      MetricsRecordBuilder metric = getMetrics(CSMMetrics.SOURCE_NAME);
+      MetricsRecordBuilder metric = getMetrics(CSMMetrics.SOURCE_NAME +
+          RaftGroupId.valueOf(pipeline.getId().getId()).toString());
       assertCounter("NumWriteStateMachineOps", 0L, metric);
       assertCounter("NumReadStateMachineOps", 0L, metric);
       assertCounter("NumApplyTransactionOps", 0L, metric);
@@ -120,7 +122,8 @@ public class TestCSMMetrics {
       Assert.assertEquals(ContainerProtos.Result.SUCCESS,
           response.getResult());
 
-      metric = getMetrics(CSMMetrics.SOURCE_NAME);
+      metric = getMetrics(CSMMetrics.SOURCE_NAME +
+              RaftGroupId.valueOf(pipeline.getId().getId()).toString());
       assertCounter("NumWriteStateMachineOps", 1L, metric);
       assertCounter("NumApplyTransactionOps", 1L, metric);
 
@@ -132,7 +135,8 @@ public class TestCSMMetrics {
       Assert.assertEquals(ContainerProtos.Result.SUCCESS,
           response.getResult());
 
-      metric = getMetrics(CSMMetrics.SOURCE_NAME);
+      metric = getMetrics(CSMMetrics.SOURCE_NAME +
+          RaftGroupId.valueOf(pipeline.getId().getId()).toString());
       assertCounter("NumReadStateMachineOps", 1L, metric);
       assertCounter("NumApplyTransactionOps", 1L, metric);
     } finally {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9cc2ce16/hadoop-project/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index a193bf8..147f1d6 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -101,7 +101,7 @@
     <ldap-api.version>1.0.0-M33</ldap-api.version>
 
     <!-- Apache Ratis version -->
-    <ratis.version>0.3.0-2272086-SNAPSHOT</ratis.version>
+    <ratis.version>0.3.0-1d2ebee-SNAPSHOT</ratis.version>
     <jcache.version>1.0-alpha-1</jcache.version>
     <ehcache.version>3.3.1</ehcache.version>
     <hikari.version>2.4.12</hikari.version>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message