dclim closed pull request #6492: fix TaskRunnerUtils String formatting issue
URL: https://github.com/apache/incubator-druid/pull/6492
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
index 16b75ed4c38..9480bf333b3 100644
---
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
+++
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
@@ -599,9 +599,9 @@ public void shutdown(final String taskId)
// Worker is still running this task
final URL url = TaskRunnerUtils.makeWorkerURL(
zkWorker.getWorker(),
- "/druid/worker/v1/task/%s/log?offset=%d",
+ "/druid/worker/v1/task/%s/log?offset=%s",
taskId,
- offset
+ Long.toString(offset)
);
return Optional.of(
new ByteSource()
diff --git
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java
index 176a3a12996..6352b867ee7 100644
---
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java
+++
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunnerUtils.java
@@ -99,12 +99,12 @@ public void run()
}
}
- public static URL makeWorkerURL(Worker worker, String pathFormat, Object...
pathParams)
+ public static URL makeWorkerURL(Worker worker, String pathFormat, String...
pathParams)
{
Preconditions.checkArgument(pathFormat.startsWith("/"), "path must start
with '/': %s", pathFormat);
final String path = StringUtils.format(
pathFormat,
- Arrays.stream(pathParams).map(s ->
StringUtils.urlEncode(s.toString())).toArray()
+ Arrays.stream(pathParams).map(StringUtils::urlEncode).toArray()
);
try {
diff --git
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java
index b3c6f77985c..b4ebdf60b6f 100644
---
a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java
+++
b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/hrtr/HttpRemoteTaskRunner.java
@@ -107,12 +107,12 @@
* A Remote TaskRunner to manage tasks on Middle Manager nodes using
internal-discovery({@link DruidNodeDiscoveryProvider})
* to discover them and Http.
* Middle Managers expose 3 HTTP endpoints
- * 1. POST request for assigning a task
- * 2. POST request for shutting down a task
- * 3. GET request for getting list of assigned, running, completed tasks on
Middle Manager and its enable/disable status.
- * This endpoint is implemented to support long poll and holds the request
till there is a change. This class
- * sends the next request immediately as the previous finishes to keep the
state up-to-date.
- *
+ * 1. POST request for assigning a task
+ * 2. POST request for shutting down a task
+ * 3. GET request for getting list of assigned, running, completed tasks on
Middle Manager and its enable/disable status.
+ * This endpoint is implemented to support long poll and holds the request
till there is a change. This class
+ * sends the next request immediately as the previous finishes to keep the
state up-to-date.
+ * <p>
* ZK_CLEANUP_TODO : As of 0.11.1, it is required to cleanup task status paths
from ZK which are created by the
* workers to support deprecated RemoteTaskRunner. So a method
"scheduleCompletedTaskStatusCleanupFromZk()" is added'
* which should be removed in the release that removes RemoteTaskRunner legacy
ZK updation WorkerTaskMonitor class.
@@ -858,7 +858,12 @@ public WorkerTaskRunnerConfig getConfig()
return Optional.absent();
} else {
// Worker is still running this task
- final URL url = TaskRunnerUtils.makeWorkerURL(worker,
"/druid/worker/v1/task/%s/log?offset=%d", taskId, offset);
+ final URL url = TaskRunnerUtils.makeWorkerURL(
+ worker,
+ "/druid/worker/v1/task/%s/log?offset=%s",
+ taskId,
+ Long.toString(offset)
+ );
return Optional.of(
new ByteSource()
{
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]