xy720 commented on code in PR #23086:
URL: https://github.com/apache/doris/pull/23086#discussion_r1299691906


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -5379,6 +5381,62 @@ public void cleanTrash(AdminCleanTrashStmt stmt) {
         }
     }
 
+    public void setPartitionVersion(AdminSetPartitionVersionStmt stmt) throws 
DdlException {
+        long partitionId = stmt.getPartitionId();
+        long versionInfo = stmt.getVisibleVersion();
+        int setSuccess = setPartitionVersionInternal(partitionId, versionInfo, 
false);
+        if (setSuccess == -1) {
+            throw new DdlException("Failed to set partition visible version to 
" + versionInfo + ". "
+                + "Partition " + partitionId + " not exists.");
+        }
+    }
+
+    public void replaySetPartitionVersion(SetPartitionVersionOperationLog log) 
throws DdlException {
+        int setSuccess = setPartitionVersionInternal(log.getPartitionId(), 
log.getVersionInfo(), true);
+        if (setSuccess == -1) {
+            LOG.warn("Failed to set partition visible version to {}. Partition 
{} not exists.",
+                    log.getVersionInfo(), log.getPartitionId());
+        }
+    }
+
+    public int setPartitionVersionInternal(long partitionId, long versionInfo, 
boolean isReplay) throws DdlException {
+        int result = -1;
+        List<Long> dbIds = getInternalCatalog().getDbIds();
+        // TODO should use inverted index
+        for (long dbId : dbIds) {

Review Comment:
   Sure.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to