suneet-s commented on code in PR #14620:
URL: https://github.com/apache/druid/pull/14620#discussion_r1271125885
##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesOverlordUtils.java:
##########
@@ -43,4 +45,10 @@ public static String convertTaskIdToK8sLabel(String taskId)
return taskId == null ? "" :
StringUtils.left(RegExUtils.replaceAll(taskId, K8S_TASK_ID_PATTERN, "")
.toLowerCase(Locale.ENGLISH), 63);
}
+
+ public static String convertTaskIdToJobName(String taskId)
+ {
+ return taskId == null ? "" :
StringUtils.left(RegExUtils.replaceAll(taskId, K8S_TASK_ID_PATTERN, "")
+ .toLowerCase(Locale.ENGLISH), 30) + "-" +
Hashing.murmur3_128().hashString(taskId, StandardCharsets.UTF_8);
Review Comment:
`Hashing.murmur3_128().hashString(taskId, StandardCharsets.UTF_8)`
How many characters will this produce? I couldn't easily figure out if there
is a limit on the length of the string returned from this function
##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/KubernetesPeonClient.java:
##########
@@ -56,10 +56,10 @@ public Pod launchPeonJobAndWaitForStart(Job job, long
howLong, TimeUnit timeUnit
// launch job
return clientApi.executeRequest(client -> {
client.batch().v1().jobs().inNamespace(namespace).resource(job).create();
- K8sTaskId taskId = new K8sTaskId(job.getMetadata().getName());
- log.info("Successfully submitted job: %s ... waiting for job to launch",
taskId);
+ String jobName = job.getMetadata().getName();
+ log.info("Successfully submitted job: %s ... waiting for job to launch",
jobName);
Review Comment:
It would be good to report the taskId in this log line, to make it easy to
map to the task_id that is being started.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]