Remove workerId parameter from postWorkerError. (#17072)

* Remove workerId parameter from postWorkerError.

It was redundant to MSQErrorReport#getTaskId.

* Fix javadoc.
This commit is contained in:
Gian Merlino 2024-09-17 01:37:46 -07:00 committed by GitHub
parent 2e4d596d82
commit c56e23ec37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 10 deletions

View File

@ -84,7 +84,7 @@ public interface Controller
* taskId, not by query/stage/worker, because system errors are associated
* with a task rather than a specific query/stage/worker execution context.
*
* @see ControllerClient#postWorkerError(String, MSQErrorReport)
* @see ControllerClient#postWorkerError(MSQErrorReport)
*/
void workerError(MSQErrorReport errorReport);

View File

@ -83,10 +83,7 @@ public interface ControllerClient extends Closeable
/**
* Client side method to inform the controller that the error has occured in the given worker.
*/
void postWorkerError(
String workerId,
MSQErrorReport errorWrapper
) throws IOException;
void postWorkerError(MSQErrorReport errorWrapper) throws IOException;
/**
* Client side method to inform the controller about the warnings generated by the given worker.

View File

@ -202,7 +202,7 @@ public class WorkerImpl implements Worker
log.warn("%s", logMessage);
if (controllerAlive) {
controllerClient.postWorkerError(context.workerId(), errorReport);
controllerClient.postWorkerError(errorReport);
}
if (t != null) {

View File

@ -125,11 +125,11 @@ public class IndexerControllerClient implements ControllerClient
}
@Override
public void postWorkerError(String workerId, MSQErrorReport errorWrapper) throws IOException
public void postWorkerError(MSQErrorReport errorWrapper) throws IOException
{
final String path = StringUtils.format(
"/workerError/%s",
StringUtils.urlEncode(workerId)
StringUtils.urlEncode(errorWrapper.getTaskId())
);
doRequest(

View File

@ -97,7 +97,7 @@ public class MSQWarningReportLimiterPublisher implements MSQWarningReportPublish
// Send the warning as an error if it is disallowed altogether
if (criticalWarningCodes.contains(errorCode)) {
try {
controllerClient.postWorkerError(workerId, MSQErrorReport.fromException(workerId, host, stageNumber, e));
controllerClient.postWorkerError(MSQErrorReport.fromException(workerId, host, stageNumber, e));
}
catch (IOException postException) {
throw new RE(postException, "Failed to post the worker error [%s] to the controller", errorCode);

View File

@ -75,7 +75,7 @@ public class MSQTestControllerClient implements ControllerClient
}
@Override
public void postWorkerError(String workerId, MSQErrorReport errorWrapper)
public void postWorkerError(MSQErrorReport errorWrapper)
{
controller.workerError(errorWrapper);
}