You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/03/28 15:36:15 UTC

[GitHub] [incubator-druid] sascha-coenen commented on a change in pull request #7066: Support assign tasks to run on different tiers of MiddleManagers

sascha-coenen commented on a change in pull request #7066: Support assign tasks to run on different tiers of MiddleManagers
URL: https://github.com/apache/incubator-druid/pull/7066#discussion_r270065787
 
 

 ##########
 File path: indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/WorkerTierSpec.java
 ##########
 @@ -0,0 +1,142 @@
+/*
+ * 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.druid.indexing.overlord.setup;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Map;
+import java.util.Objects;
+
+public class WorkerTierSpec
+{
+  // key: taskType, value: tierConfig
+  private final Map<String, TierConfig> tierMap;
+  private final boolean strong;
+
+  @JsonCreator
+  public WorkerTierSpec(
+      @JsonProperty("tierMap") Map<String, TierConfig> tierMap,
+      @JsonProperty("strong") boolean strong
+  )
+  {
+    this.tierMap = tierMap;
+    this.strong = strong;
+  }
+
+  @JsonProperty
+  public Map<String, TierConfig> getTierMap()
+  {
+    return tierMap;
+  }
+
+  @JsonProperty
+  public boolean isStrong()
+  {
+    return strong;
+  }
+
+  @Override
+  public boolean equals(final Object o)
+  {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    final WorkerTierSpec that = (WorkerTierSpec) o;
+    return strong == that.strong &&
+           Objects.equals(tierMap, that.tierMap);
+  }
+
+  @Override
+  public int hashCode()
+  {
+    return Objects.hash(tierMap, strong);
+  }
+
+  @Override
+  public String toString()
+  {
+    return "WorkerTierSpec{" +
+           "tierMap=" + tierMap +
+           ", strong=" + strong +
+           '}';
+  }
+
+  public static class TierConfig
+  {
+    private final String defaultTier;
+    // key: datasource, value: tier
+    private final Map<String, String> tiers;
 
 Review comment:
   instead of supporting only a fixed usecase like tiers per datasource or tiers per indexing type, why not just support a "tier" property within the "context" section of an ingestion spec?
   
   This would allow for arbitrary tier mappings including the ones you have in mind.
   The context section is already used for those purposes in the context of queries to set priorities, timeouts etc. I think it would therefore also be a valid design choice to support standard context properties for ingestion tasks.
   `
   {
     "type": "index_hadoop",
     "context": {
        "tier": "my-very-personal-tier-token", 
        ...
     }
     ...
   }
   
   
   Good point about the autoscaler. its interface should then probably also receive a tier name for which a scale operation should happen...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org