Repository: helix
Updated Branches:
  refs/heads/master cd3dc0d9f -> b5e5e4919


[HELIX-728] Restore TaskConfig's quotaType related APIs temporarily


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/b5e5e491
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/b5e5e491
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/b5e5e491

Branch: refs/heads/master
Commit: b5e5e4919ca9eaad84358a07be9c8596c9e36d40
Parents: cd3dc0d
Author: Hunter Lee <[email protected]>
Authored: Thu Jul 12 11:25:33 2018 -0700
Committer: Hunter Lee <[email protected]>
Committed: Thu Jul 12 11:27:03 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/helix/task/TaskConfig.java  | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/b5e5e491/helix-core/src/main/java/org/apache/helix/task/TaskConfig.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/task/TaskConfig.java 
b/helix-core/src/main/java/org/apache/helix/task/TaskConfig.java
index 4fce4ba..cb963a8 100644
--- a/helix-core/src/main/java/org/apache/helix/task/TaskConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/task/TaskConfig.java
@@ -37,10 +37,12 @@ public class TaskConfig {
     TASK_COMMAND,
     @Deprecated
     TASK_SUCCESS_OPTIONAL,
-    TASK_TARGET_PARTITION
+    TASK_TARGET_PARTITION,
+    TASK_QUOTA_TYPE //TODO: remove
   }
 
   private static final Logger LOG = LoggerFactory.getLogger(TaskConfig.class);
+  public static final String DEFAULT_QUOTA_TYPE = "DEFAULT"; //TODO: remove!
 
   private final Map<String, String> _configMap;
 
@@ -230,4 +232,22 @@ public class TaskConfig {
       return new TaskConfig(command, rawConfigMap, taskId, targetPartition);
     }
   }
+
+  //TODO: remove the following
+  /**
+   * Set the quota type of this task
+   * @param quotaType
+   */
+  public void setQuotaType(String quotaType) {
+    _configMap.put(TaskConfigProperty.TASK_QUOTA_TYPE.name(), quotaType);
+  }
+
+  /**
+   * Return the quota type of this task
+   * @return
+   */
+  public String getQuotaType() {
+    return _configMap.containsKey(TaskConfigProperty.TASK_QUOTA_TYPE.name()) ?
+        _configMap.get(TaskConfigProperty.TASK_QUOTA_TYPE.name()) : 
DEFAULT_QUOTA_TYPE;
+  }
 }
\ No newline at end of file

Reply via email to