forked from lsmyrnaios/UrlsController
Add renaming of the workerReport-file, to indicate failure, when the processing failed because no workerInfo was found for the worker-id existing in the report. This way, it can be retried by the scheduler later.
This commit is contained in:
parent
c98e8df323
commit
8fdb8e9137
|
@ -288,6 +288,9 @@ public class UrlsServiceImpl implements UrlsService {
|
||||||
FileUtils.UploadFullTextsResponse uploadFullTextsResponse = fileUtils.getAndUploadFullTexts(urlReports, sizeOfUrlReports, curReportAssignmentsCounter, curWorkerId);
|
FileUtils.UploadFullTextsResponse uploadFullTextsResponse = fileUtils.getAndUploadFullTexts(urlReports, sizeOfUrlReports, curReportAssignmentsCounter, curWorkerId);
|
||||||
if ( uploadFullTextsResponse == null ) {
|
if ( uploadFullTextsResponse == null ) {
|
||||||
// Nothing to post to the Worker, since we do not have the worker's info.
|
// Nothing to post to the Worker, since we do not have the worker's info.
|
||||||
|
// Rename the worker-report-file to indicate its "failure", so that the scheduler can pick it up and retry processing it.
|
||||||
|
String workerReportBaseName = this.workerReportsDirPath + File.separator + curWorkerId + File.separator + curWorkerId + "_assignments_" + curReportAssignmentsCounter + "_report";
|
||||||
|
getRenamedWorkerReport(workerReportBaseName, new File(workerReportBaseName + ".json"), "No info was found for worker: " + curWorkerId); // It may return null.
|
||||||
return false;
|
return false;
|
||||||
} else if ( uploadFullTextsResponse == FileUtils.UploadFullTextsResponse.databaseError ) {
|
} else if ( uploadFullTextsResponse == FileUtils.UploadFullTextsResponse.databaseError ) {
|
||||||
postReportResultToWorker(curWorkerId, curReportAssignmentsCounter, "Problem with the Impala-database!");
|
postReportResultToWorker(curWorkerId, curReportAssignmentsCounter, "Problem with the Impala-database!");
|
||||||
|
|
Loading…
Reference in New Issue