Lchangliang commented on code in PR #32804:
URL: https://github.com/apache/doris/pull/32804#discussion_r1574181399


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudEnv.java:
##########
@@ -438,4 +452,63 @@ public void 
replayUpdateCloudReplica(UpdateCloudReplicaInfo info) throws MetaNot
     public boolean getEnableStorageVault() {
         return this.enableStorageVault;
     }
+
+    public long loadCloudWarmUpJob(DataInputStream dis, long checksum) throws 
Exception {
+        // same as loadAlterJob
+
+        int size = dis.readInt();
+        long newChecksum = checksum ^ size;
+        if (size > 0) {
+            // There should be no old cloudWarmUp jobs, if exist throw 
exception, should not use this FE version
+            throw new IOException("There are [" + size + "] cloud warm up 
jobs."
+                    + " Please downgrade FE to an older version and handle 
residual jobs");
+        }
+
+        // finished or cancelled jobs
+        size = dis.readInt();
+        newChecksum ^= size;
+        if (size > 0) {
+            throw new IOException("There are [" + size + "] old finished or 
cancelled cloud warm up jobs."
+                    + " Please downgrade FE to an older version and handle 
residual jobs");
+        }
+
+        size = dis.readInt();
+        newChecksum ^= size;
+        for (int i = 0; i < size; i++) {
+            CloudWarmUpJob cloudWarmUpJob = CloudWarmUpJob.read(dis);
+            if (cloudWarmUpJob.isExpire() || cloudWarmUpJob.getJobState() == 
JobState.DELETED) {
+                LOG.info("cloud warm up job is expired, {}, ignore it", 
cloudWarmUpJob.getJobId());
+                continue;
+            }
+            this.getCacheHotspotMgr().addCloudWarmUpJob(cloudWarmUpJob);
+        }
+        LOG.info("finished replay cloud warm up job from image");
+        return newChecksum;
+    }
+
+    public long saveCloudWarmUpJob(CountingDataOutputStream dos, long 
checksum) throws IOException {

Review Comment:
   The persistence is same.



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