parent
febe2b212c
commit
98516498eb
|
@ -6,7 +6,7 @@ plugins {
|
||||||
|
|
||||||
java {
|
java {
|
||||||
group = 'eu.openaire.urls_controller'
|
group = 'eu.openaire.urls_controller'
|
||||||
version = '2.1.0-SNAPSHOT'
|
version = '2.4.0-SNAPSHOT'
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
||||||
import org.springframework.dao.EmptyResultDataAccessException;
|
import org.springframework.dao.EmptyResultDataAccessException;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -29,7 +28,6 @@ import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -270,7 +268,7 @@ public class UrlsServiceImpl implements UrlsService {
|
||||||
if ( logger.isTraceEnabled() )
|
if ( logger.isTraceEnabled() )
|
||||||
logger.trace("numDuplicates in returned assignments_" + curAssignmentsBatchCounter + " = " + (assignmentsSize - distinctAssignmentsSize));
|
logger.trace("numDuplicates in returned assignments_" + curAssignmentsBatchCounter + " = " + (assignmentsSize - distinctAssignmentsSize));
|
||||||
|
|
||||||
logger.info("Sending batch-assignments_" + curAssignmentsBatchCounter + " with " + distinctAssignmentsSize + " assignments to worker with ID: " + workerId + ".");
|
logger.info("Sending batch-assignments_" + curAssignmentsBatchCounter + ", with " + distinctAssignmentsSize + " assignments, to worker with ID: " + workerId + ".");
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new AssignmentsResponse(curAssignmentsBatchCounter, distinctAssignments));
|
return ResponseEntity.status(HttpStatus.OK).body(new AssignmentsResponse(curAssignmentsBatchCounter, distinctAssignments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,8 +207,8 @@ public class FileUtils {
|
||||||
workerIp = workerInfo.getWorkerIP(); // This won't be null.
|
workerIp = workerInfo.getWorkerIP(); // This won't be null.
|
||||||
|
|
||||||
// Get the file-locations.
|
// Get the file-locations.
|
||||||
AtomicInteger numFullTextsFound = new AtomicInteger();
|
final AtomicInteger numFullTextsFound = new AtomicInteger();
|
||||||
AtomicInteger numFilesFoundFromPreviousAssignmentsBatches = new AtomicInteger();
|
final AtomicInteger numFilesFoundFromPreviousAssignmentsBatches = new AtomicInteger();
|
||||||
|
|
||||||
SetMultimap<String, Payload> allFileNamesWithPayloads = Multimaps.synchronizedSetMultimap(HashMultimap.create((sizeOfUrlReports / 5), 3)); // Holds multiple values for any key, if a fileName(key) has many IDs(values) associated with it.
|
SetMultimap<String, Payload> allFileNamesWithPayloads = Multimaps.synchronizedSetMultimap(HashMultimap.create((sizeOfUrlReports / 5), 3)); // Holds multiple values for any key, if a fileName(key) has many IDs(values) associated with it.
|
||||||
|
|
||||||
|
@ -288,8 +288,7 @@ public class FileUtils {
|
||||||
logger.warn("The current thread was interrupted when waiting for the worker-threads to finish checking for already-found file-hashes: " + ie.getMessage());
|
logger.warn("The current thread was interrupted when waiting for the worker-threads to finish checking for already-found file-hashes: " + ie.getMessage());
|
||||||
// This is a very rare case. At the moment, we just move on with what we have so far.
|
// This is a very rare case. At the moment, we just move on with what we have so far.
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String errorMsg = "Unexpected error when checking for already-found file-hashes in parallel! " + e.getMessage();
|
logger.error("Unexpected error when checking for already-found file-hashes in parallel!", e);
|
||||||
logger.error(errorMsg, e);
|
|
||||||
return UploadFullTextsResponse.unsuccessful;
|
return UploadFullTextsResponse.unsuccessful;
|
||||||
} finally {
|
} finally {
|
||||||
DatabaseConnector.databaseLock.unlock(); // The remaining work of this function does not use the database.
|
DatabaseConnector.databaseLock.unlock(); // The remaining work of this function does not use the database.
|
||||||
|
|
Loading…
Reference in New Issue