- Increase app's version.

- Code polishing.
This commit is contained in:
Lampros Smyrnaios 2023-09-04 12:46:55 +03:00
parent febe2b212c
commit 98516498eb
3 changed files with 5 additions and 8 deletions

View File

@ -6,7 +6,7 @@ plugins {
java {
group = 'eu.openaire.urls_controller'
version = '2.1.0-SNAPSHOT'
version = '2.4.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_1_8
}

View File

@ -12,7 +12,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -29,7 +28,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -270,7 +268,7 @@ public class UrlsServiceImpl implements UrlsService {
if ( logger.isTraceEnabled() )
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));
}

View File

@ -207,8 +207,8 @@ public class FileUtils {
workerIp = workerInfo.getWorkerIP(); // This won't be null.
// Get the file-locations.
AtomicInteger numFullTextsFound = new AtomicInteger();
AtomicInteger numFilesFoundFromPreviousAssignmentsBatches = new AtomicInteger();
final AtomicInteger numFullTextsFound = 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.
@ -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());
// This is a very rare case. At the moment, we just move on with what we have so far.
} catch (Exception e) {
String errorMsg = "Unexpected error when checking for already-found file-hashes in parallel! " + e.getMessage();
logger.error(errorMsg, e);
logger.error("Unexpected error when checking for already-found file-hashes in parallel!", e);
return UploadFullTextsResponse.unsuccessful;
} finally {
DatabaseConnector.databaseLock.unlock(); // The remaining work of this function does not use the database.