You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/24 06:01:27 UTC

[GitHub] [ozone] GlenGeng commented on a change in pull request #2079: HDDS-4981. Remove SequenceIdGenerator#StateManagerImpl

GlenGeng commented on a change in pull request #2079:
URL: https://github.com/apache/ozone/pull/2079#discussion_r600194555



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SequenceIdGenerator.java
##########
@@ -260,9 +256,13 @@ public Builder setDBTransactionBuffer(DBTransactionBuffer trxBuffer) {
       public StateManager build() {
         Preconditions.checkNotNull(table);
         Preconditions.checkNotNull(buffer);
-        Preconditions.checkNotNull(ratisServer);
 
         final StateManager impl = new StateManagerHAImpl(table, buffer);
+
+        if (null == ratisServer) {

Review comment:
       no need this logic, just go ahead.

##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java
##########
@@ -70,8 +73,6 @@ public void testSequenceIDGenUponNonRatis() throws Exception {
   @Test
   public void testSequenceIDGenUponRatis() throws Exception {
     OzoneConfiguration conf = SCMTestUtils.getConf();
-    // enable ratis based SequenceIDGen
-    conf.setBoolean(OZONE_SCM_HA_ENABLE_KEY, true);

Review comment:
       why remove this configuration ?

##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java
##########
@@ -19,23 +19,26 @@
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.scm.metadata.SCMMetadataStore;
 import org.apache.hadoop.hdds.scm.metadata.SCMMetadataStoreImpl;
+import org.apache.hadoop.hdds.scm.metadata.SCMDBTransactionBufferImpl;
 import org.apache.hadoop.ozone.container.common.SCMTestUtils;
+
 import org.junit.Assert;
 import org.junit.Test;
 
-import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY;
 import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SEQUENCE_ID_BATCH_SIZE;
 
 public class TestSequenceIDGenerator {
   @Test
   public void testSequenceIDGenUponNonRatis() throws Exception {
     OzoneConfiguration conf = SCMTestUtils.getConf();
-    conf.setBoolean(OZONE_SCM_HA_ENABLE_KEY, false);

Review comment:
       why remove this configuration ?

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java
##########
@@ -452,6 +452,11 @@ private void initializeSystemManagers(OzoneConfiguration conf,
       clusterMap = new NetworkTopologyImpl(conf);
     }
 
+    /*
+    TODO: setSCMHAManager is only called in tests now, so

Review comment:
       no need this change.

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/MockSCMHAManager.java
##########
@@ -53,6 +53,10 @@ public static SCMHAManager getInstance(boolean isLeader) {
     return new MockSCMHAManager(isLeader);
   }
 
+  public static SCMHAManager getInstance(DBTransactionBuffer buffer) {

Review comment:
       no need change this file.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org