You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/04/20 14:29:14 UTC

[GitHub] [incubator-doris] xy720 opened a new pull request #3360: Alter replication number for table in one command

xy720 opened a new pull request #3360:
URL: https://github.com/apache/incubator-doris/pull/3360


   #2290
   This cl add new command to set replication number of table in one time.
   
   ```
   alter table test_tbl set ("default.replication_num" = "3");
   ```
   
   It changes replication num of every partitiion of the table.


----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #3360: Alter replication number for table in one command

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #3360:
URL: https://github.com/apache/incubator-doris/pull/3360#discussion_r412206895



##########
File path: fe/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -5177,8 +5177,31 @@ public void replayModifyTableProperty(short opCode, ModifyTablePropertyOperation
     }
 
     // The caller need to hold the db write lock
-    public void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) {
+    public void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) throws DdlException {
         Preconditions.checkArgument(db.isWriteLockHeldByCurrentThread());
+        short newReplicationNum = (short) -1;
+        try {
+            newReplicationNum = Short.valueOf(properties.get(PropertyAnalyzer.PROPERTIES_REPLICATION_NUM));

Review comment:
       ok.




----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #3360: Alter replication number for table in one command

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #3360:
URL: https://github.com/apache/incubator-doris/pull/3360#discussion_r412233611



##########
File path: fe/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -5176,8 +5176,50 @@ public void replayModifyTableProperty(short opCode, ModifyTablePropertyOperation
         }
     }
 
+    /**
+     * Set replication number for a table that only have one partition.

Review comment:
       ```suggestion
        * Set replication number for unpartitioned table
   ```




----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #3360: Alter replication number for table in one command

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #3360:
URL: https://github.com/apache/incubator-doris/pull/3360#discussion_r411452197



##########
File path: fe/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -5177,8 +5177,31 @@ public void replayModifyTableProperty(short opCode, ModifyTablePropertyOperation
     }
 
     // The caller need to hold the db write lock
-    public void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) {
+    public void modifyTableReplicationNum(Database db, OlapTable table, Map<String, String> properties) throws DdlException {
         Preconditions.checkArgument(db.isWriteLockHeldByCurrentThread());
+        short newReplicationNum = (short) -1;
+        try {
+            newReplicationNum = Short.valueOf(properties.get(PropertyAnalyzer.PROPERTIES_REPLICATION_NUM));

Review comment:
       This should be done in `analyze()` of `ModifyTablePropertyClause.java`.
   And you can call `PropertyAnalyzer.analyzeReplicationNum()`.




----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org