pengxiangyu commented on code in PR #10280:
URL: https://github.com/apache/doris/pull/10280#discussion_r912594141


##########
fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java:
##########
@@ -213,7 +222,7 @@ public static DataProperty analyzeDataProperty(Map<String, 
String> properties, D
         }
 
         Preconditions.checkNotNull(storageMedium);
-        return new DataProperty(storageMedium, cooldownTimeStamp, 
remoteStorageResourceName, remoteCooldownTimeStamp);
+        return new DataProperty(storageMedium, cooldownTimeStamp, 
remoteStorageResourceName, remoteCooldownTimeStamp, storagePolicy);

Review Comment:
   If MigrationHandler is on BE, remoteStorageResourceName and 
remoteCooldownTimeStamp are not useful, just remove them from DataProperty.



##########
fe/fe-core/src/main/java/org/apache/doris/task/DropReplicaTask.java:
##########
@@ -23,11 +23,13 @@
 public class DropReplicaTask extends AgentTask {
     private int schemaHash; // set -1L as unknown
     private long replicaId;
+    private boolean isDropTableOrPartition;

Review Comment:
   Add some annotation for this, what does true mean, and what abort false?



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TableProperty.java:
##########
@@ -139,6 +141,15 @@ public TableProperty buildInMemory() {
         return this;
     }
 
+    public TableProperty buildStoragePolicy() {
+        storagePolicy = 
properties.getOrDefault(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY, "");

Review Comment:
   default is ""?How abort use default_storage_policy in Config?



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/ResourceMgr.java:
##########
@@ -82,6 +85,20 @@ public void createResource(CreateResourceStmt stmt) throws 
DdlException {
         LOG.info("Create resource success. Resource: {}", resource);
     }
 
+    public void createDefaultStoragePolicy() throws DdlException {

Review Comment:
   StoragePolicyResource is not needed. Use StoragePolicy instead.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/DataProperty.java:
##########
@@ -46,6 +46,8 @@ public class DataProperty implements Writable {
     private String remoteStorageResourceName;

Review Comment:
   If Migration Handler is in BE, remoteStorageResourceName and 
remoteCooldownTimeMs are not needed, just remove them. The serialization for 
this class is a json.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/StoragePolicyResource.java:
##########
@@ -0,0 +1,235 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.Config;
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.BaseProcResult;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+import org.apache.doris.system.SystemInfoService;
+import org.apache.doris.task.AgentBatchTask;
+import org.apache.doris.task.AgentTaskExecutor;
+import org.apache.doris.task.NotifyUpdateStoragePolicyTask;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Policy resource for olap table
+ *
+ * Syntax:
+ * CREATE RESOURCE "storage_policy_name"
+ * PROPERTIES(
+ *      "type"="storage_policy",
+ *      "cooldown_datetime" = "2022-06-01", // time when data is transfter to 
medium
+ *      "cooldown_ttl" = "3600", // data is transfter to medium after 1 hour
+ *      "s3_*"
+ * );
+ */
+public class StoragePolicyResource extends Resource {

Review Comment:
   This class is replaced by StoragePolicy, as discuss before, it is a policy, 
but not a resource.



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