diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/AppenderatorDriverRealtimeIndexTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/AppenderatorDriverRealtimeIndexTask.java index 1230711e57b..d97caaec874 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/AppenderatorDriverRealtimeIndexTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/AppenderatorDriverRealtimeIndexTask.java @@ -122,6 +122,7 @@ import java.util.concurrent.TimeoutException; public class AppenderatorDriverRealtimeIndexTask extends AbstractTask implements ChatHandler, PendingSegmentAllocatingTask { + public static final String TYPE = "index_realtime_appenderator"; private static final String CTX_KEY_LOOKUP_TIER = "lookupTier"; private static final EmittingLogger log = new EmittingLogger(RealtimeIndexTask.class); @@ -217,7 +218,7 @@ public class AppenderatorDriverRealtimeIndexTask extends AbstractTask @Override public String getType() { - return "index_realtime_appenderator"; + return TYPE; } @Override diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java index 9104e2cfb05..46303806dab 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/ArchiveTask.java @@ -40,6 +40,7 @@ import java.util.Set; public class ArchiveTask extends AbstractFixedIntervalTask { + public static final String TYPE = "archive"; private static final Logger log = new Logger(ArchiveTask.class); public ArchiveTask( @@ -60,7 +61,7 @@ public class ArchiveTask extends AbstractFixedIntervalTask @Override public String getType() { - return "archive"; + return TYPE; } @Nonnull diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java index f5aec08c306..833bcdd2fed 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java @@ -129,6 +129,7 @@ import java.util.stream.IntStream; */ public class CompactionTask extends AbstractBatchIndexTask implements PendingSegmentAllocatingTask { + public static final String TYPE = "compact"; private static final Logger log = new Logger(CompactionTask.class); private static final Clock UTC_CLOCK = Clock.systemUTC(); @@ -145,8 +146,6 @@ public class CompactionTask extends AbstractBatchIndexTask implements PendingSeg */ public static final String CTX_KEY_APPENDERATOR_TRACKING_TASK_ID = "appenderatorTrackingTaskId"; - private static final String TYPE = "compact"; - private static final boolean STORE_COMPACTION_STATE = true; static { diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java index 4a31be24dd2..bc9d5aca2b6 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java @@ -94,10 +94,10 @@ import java.util.stream.Collectors; public class HadoopIndexTask extends HadoopTask implements ChatHandler { + public static final String TYPE = "index_hadoop"; public static final String INPUT_SOURCE_TYPE = "hadoop"; private static final Logger log = new Logger(HadoopIndexTask.class); private static final String HADOOP_JOB_ID_FILENAME = "mapReduceJobId.json"; - private static final String TYPE = "index_hadoop"; private TaskConfig taskConfig = null; private static String getTheDataSource(HadoopIngestionSpec spec) @@ -192,7 +192,7 @@ public class HadoopIndexTask extends HadoopTask implements ChatHandler @Override public String getType() { - return "index_hadoop"; + return TYPE; } @Nonnull diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java index 7603fe9542b..14e37cc81c5 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java @@ -141,7 +141,6 @@ import java.util.stream.Collectors; public class IndexTask extends AbstractBatchIndexTask implements ChatHandler, PendingSegmentAllocatingTask { - public static final HashFunction HASH_FUNCTION = Hashing.murmur3_128(); public static final String TYPE = "index"; diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java index e02af66e046..8762aa91b4c 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/MoveTask.java @@ -41,6 +41,7 @@ import java.util.Set; public class MoveTask extends AbstractFixedIntervalTask { + public static final String TYPE = "move"; private static final Logger log = new Logger(MoveTask.class); private final Map targetLoadSpec; @@ -68,7 +69,7 @@ public class MoveTask extends AbstractFixedIntervalTask @Override public String getType() { - return "move"; + return TYPE; } @Nonnull diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/NoopTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/NoopTask.java index 9d91542ebf0..7887ab08111 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/NoopTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/NoopTask.java @@ -41,6 +41,7 @@ import java.util.UUID; */ public class NoopTask extends AbstractTask implements PendingSegmentAllocatingTask { + public static final String TYPE = "noop"; private static final int DEFAULT_RUN_TIME = 2500; @JsonIgnore @@ -70,7 +71,7 @@ public class NoopTask extends AbstractTask implements PendingSegmentAllocatingTa @Override public String getType() { - return "noop"; + return TYPE; } @Nonnull diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RealtimeIndexTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RealtimeIndexTask.java index a32ef91192b..443b72ec21a 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RealtimeIndexTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RealtimeIndexTask.java @@ -85,6 +85,7 @@ import java.util.concurrent.ThreadLocalRandom; @Deprecated public class RealtimeIndexTask extends AbstractTask { + public static final String TYPE = "index_realtime"; public static final String CTX_KEY_LOOKUP_TIER = "lookupTier"; private static final EmittingLogger log = new EmittingLogger(RealtimeIndexTask.class); @@ -180,7 +181,7 @@ public class RealtimeIndexTask extends AbstractTask @Override public String getType() { - return "index_realtime"; + return TYPE; } @Override diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java index e3a0ecf633e..3b0f5d6c622 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/RestoreTask.java @@ -41,6 +41,7 @@ import java.util.Set; public class RestoreTask extends AbstractFixedIntervalTask { + public static final String TYPE = "restore"; private static final Logger log = new Logger(RestoreTask.class); public RestoreTask( @@ -61,7 +62,7 @@ public class RestoreTask extends AbstractFixedIntervalTask @Override public String getType() { - return "restore"; + return TYPE; } @Nonnull diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java index 7556908023a..cdf7cea7e3f 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java @@ -67,10 +67,10 @@ import java.util.Set; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @JsonSubTypes(value = { @Type(name = KillUnusedSegmentsTask.TYPE, value = KillUnusedSegmentsTask.class), - @Type(name = "move", value = MoveTask.class), - @Type(name = "archive", value = ArchiveTask.class), - @Type(name = "restore", value = RestoreTask.class), - @Type(name = "index", value = IndexTask.class), + @Type(name = MoveTask.TYPE, value = MoveTask.class), + @Type(name = ArchiveTask.TYPE, value = ArchiveTask.class), + @Type(name = RestoreTask.TYPE, value = RestoreTask.class), + @Type(name = IndexTask.TYPE, value = IndexTask.class), @Type(name = ParallelIndexSupervisorTask.TYPE, value = ParallelIndexSupervisorTask.class), @Type(name = SinglePhaseSubTask.TYPE, value = SinglePhaseSubTask.class), // for backward compatibility @@ -80,11 +80,11 @@ import java.util.Set; @Type(name = PartialRangeSegmentGenerateTask.TYPE, value = PartialRangeSegmentGenerateTask.class), @Type(name = PartialDimensionDistributionTask.TYPE, value = PartialDimensionDistributionTask.class), @Type(name = PartialGenericSegmentMergeTask.TYPE, value = PartialGenericSegmentMergeTask.class), - @Type(name = "index_hadoop", value = HadoopIndexTask.class), - @Type(name = "index_realtime", value = RealtimeIndexTask.class), - @Type(name = "index_realtime_appenderator", value = AppenderatorDriverRealtimeIndexTask.class), - @Type(name = "noop", value = NoopTask.class), - @Type(name = "compact", value = CompactionTask.class) + @Type(name = HadoopIndexTask.TYPE, value = HadoopIndexTask.class), + @Type(name = RealtimeIndexTask.TYPE, value = RealtimeIndexTask.class), + @Type(name = AppenderatorDriverRealtimeIndexTask.TYPE, value = AppenderatorDriverRealtimeIndexTask.class), + @Type(name = NoopTask.TYPE, value = NoopTask.class), + @Type(name = CompactionTask.TYPE, value = CompactionTask.class) }) public interface Task {