Repository: helix Updated Branches: refs/heads/master 1f3402c49 -> cd3dc0d9f
[HELIX-725] Remove method for setting quota type for TaskConfig Changelist: 1. A setter for quota type was removed to comply with the definition that quota types only exist down to the job level. 2. Updated JavaDoc. Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/cd3dc0d9 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/cd3dc0d9 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/cd3dc0d9 Branch: refs/heads/master Commit: cd3dc0d9f9ef1f3bd909f391164c2462b78c8da9 Parents: 1f3402c Author: Hunter Lee <[email protected]> Authored: Mon Jul 9 18:41:51 2018 -0700 Committer: Hunter Lee <[email protected]> Committed: Thu Jul 12 11:20:50 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/helix/task/TaskConfig.java | 55 +++++--------------- 1 file changed, 14 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/cd3dc0d9/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 d3a8b34..4fce4ba 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,12 +37,10 @@ public class TaskConfig { TASK_COMMAND, @Deprecated TASK_SUCCESS_OPTIONAL, - TASK_TARGET_PARTITION, - TASK_QUOTA_TYPE + TASK_TARGET_PARTITION } private static final Logger LOG = LoggerFactory.getLogger(TaskConfig.class); - public static final String DEFAULT_QUOTA_TYPE = "DEFAULT"; private final Map<String, String> _configMap; @@ -58,12 +56,11 @@ public class TaskConfig { } /** - * Instantiate the task config - * - * @param command the command to invoke for the task - * @param configMap configuration to be passed as part of the invocation - * @param id existing task ID - * @param target target partition for a task + * Instantiate the task config. + * @param command the command to invoke for the task + * @param configMap configuration to be passed as part of the invocation + * @param id existing task ID + * @param target target partition for a task */ public TaskConfig(String command, Map<String, String> configMap, String id, String target) { if (configMap == null) { @@ -83,10 +80,9 @@ public class TaskConfig { } /** - * Instantiate the task config - * - * @param command the command to invoke for the task - * @param configMap configuration to be passed as part of the invocation + * Instantiate the task config. + * @param command the command to invoke for the task + * @param configMap configuration to be passed as part of the invocation */ public TaskConfig(String command, Map<String, String> configMap) { this(command, configMap, null, null); @@ -94,7 +90,6 @@ public class TaskConfig { /** * Unique identifier for this task - * * @return UUID as a string */ public String getId() { @@ -103,7 +98,6 @@ public class TaskConfig { /** * Get the command to invoke for this task - * * @return string command, or null if not overridden */ public String getCommand() { @@ -112,7 +106,6 @@ public class TaskConfig { /** * Get the target partition of this task, if any - * * @return the target partition, or null */ public String getTargetPartition() { @@ -120,23 +113,6 @@ public class TaskConfig { } /** - * 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; - } - - /** * Check if this task must succeed for a job to succeed * This field has been ignored by Helix * @return true if success is optional, false otherwise @@ -149,14 +125,14 @@ public class TaskConfig { /** * Get the configuration map for this task's command - * * @return map of configuration key to value */ public Map<String, String> getConfigMap() { return _configMap; } - @Override public String toString() { + @Override + public String toString() { ObjectMapper mapper = new ObjectMapper(); try { return mapper.writeValueAsString(this); @@ -224,8 +200,7 @@ public class TaskConfig { } /** - * Instantiate a typed configuration from just a target - * + * Instantiate a typed configuration from just a target. * @param target the target partition * @return instantiated TaskConfig */ @@ -234,8 +209,7 @@ public class TaskConfig { } /** - * Instantiate a typed configuration from a bean - * + * Instantiate a typed configuration from a bean. * @param bean plain bean describing the task * @return instantiated TaskConfig */ @@ -245,7 +219,6 @@ public class TaskConfig { /** * Instantiate a typed configuration from a raw string map - * * @param rawConfigMap mixed map of configuration and task metadata * @return instantiated TaskConfig */ @@ -257,4 +230,4 @@ public class TaskConfig { return new TaskConfig(command, rawConfigMap, taskId, targetPartition); } } -} +} \ No newline at end of file
