Skip to content

Commit

Permalink
add support for prefix/suffix for taskname (apache#14478)
Browse files Browse the repository at this point in the history
  • Loading branch information
aishikbh authored Nov 18, 2024
1 parent f61f47b commit 179be30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.apache.pinot.controller.util.CompletionServiceHelper;
import org.apache.pinot.core.common.MinionConstants;
import org.apache.pinot.core.minion.PinotTaskConfig;
import org.apache.pinot.spi.ingestion.batch.BatchConfigProperties;
import org.apache.pinot.spi.utils.CommonConstants;
import org.apache.pinot.spi.utils.CommonConstants.Helix;
import org.apache.pinot.spi.utils.JsonUtils;
Expand Down Expand Up @@ -262,7 +263,15 @@ public synchronized String submitTask(List<PinotTaskConfig> pinotTaskConfigs, St
Preconditions.checkState(numConcurrentTasksPerInstance > 0);

String taskType = pinotTaskConfigs.get(0).getTaskType();
String parentTaskName = getParentTaskName(taskType, UUID.randomUUID() + "_" + System.currentTimeMillis());

// Get task name prefix and suffix from the first task config.
String taskNamePrefix = pinotTaskConfigs.get(0).getConfigs()
.getOrDefault(BatchConfigProperties.TASK_NAME_PREFIX_KEY, UUID.randomUUID().toString());
String taskNameSuffix =
pinotTaskConfigs.get(0).getConfigs().getOrDefault(BatchConfigProperties.TASK_NAME_SUFFIX_KEY, "");

String parentTaskName =
getParentTaskName(taskType, taskNamePrefix + "_" + System.currentTimeMillis() + taskNameSuffix);
return submitTask(parentTaskName, pinotTaskConfigs, minionInstanceTag, taskTimeoutMs, numConcurrentTasksPerInstance,
maxAttemptsPerTask);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private BatchConfigProperties() {
public static final String APPEND_UUID_TO_SEGMENT_NAME = "append.uuid.to.segment.name";
public static final String EXCLUDE_TIME_IN_SEGMENT_NAME = "exclude.time.in.segment.name";
public static final String BATCH_SEGMENT_UPLOAD = "batchSegmentUpload";
public static final String TASK_NAME_PREFIX_KEY = "taskNamePrefix";
public static final String TASK_NAME_SUFFIX_KEY = "taskNameSuffix";

public static final String OUTPUT_SEGMENT_DIR_URI = "output.segment.dir.uri";

Expand Down

0 comments on commit 179be30

Please sign in to comment.