- Remove the obsolete "parenthesis" and "increasing duplicate-num" from the full-texts' names, before sending them to the S3-Object-Store. They now end with the "file-hash", so it is guaranteed that they will be unique. The Worker continues to produce the previous kind of names, without any disturbance.
logger.info("Going to create (if not exist) the database \"" +testDatabaseName+"\" and its tables. Also will fill some tables with data from database \""+initialDatabaseName+"\".");
logger.info("Going to create (if not exist) the test-database \"" +testDatabaseName+"\" and its tables. Also will fill some tables with data from database \""+initialDatabaseName+"\".");
jdbcTemplate.execute("CREATE DATABASE IF NOT EXISTS "+testDatabaseName);
jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS "+testDatabaseName+".publication stored as parquet as select * from "+initialDatabaseName+".publication");
// Use the "fileID" and not the "filenameWithoutExtension", as we want to avoid keeping the possible "parenthesis" with the increasing number (about the duplication of ID-fileName).
// Now we append the file-hash, so it is guaranteed that the filename will be unique.
// TODO - What if the fileObjKeyName already exists? Right now it gets overwritten (unless we add versioning0, which is not currently supported by our S3ObjectStore).
// Each Worker handles some of these cases, but in case of id-urls splitting between different workers or re-attempting some temporarily faulty urls later,
// duplicate fileNames may appear and cause file-overwriting from the part of S3ObjectStore.
// What if the fileObjKeyName already exists? (Default action from S3-Object-Store --> overwrite)
// Each Worker handles some of these cases, but in case of id-urls splitting between different workers or re-attempting some temporarily faulty urls later, duplicate fileNames may appear.
// However, the Controller uses the file-hash (instead of the duplicate -number), so it is 99.99% guaranteed that no overwrites will ever occur.
Strings3Url=s3Protocol+bucketName+"/"+fileObjKeyName;// Be aware: This url works only if the access to the bucket is public.
//logger.debug("Uploaded file \"" + fileObjKeyName + "\". The s3Url is: " + s3Url);