Skip to content

Commit

Permalink
no need to try to calculate checksums if this globus storage isn't da…
Browse files Browse the repository at this point in the history
…taverse-accessible. #10623
  • Loading branch information
landreev committed Aug 6, 2024
1 parent 65ec69f commit 0495160
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1160,25 +1160,30 @@ private FileDetailsHolder calculateDetails(String id, Logger globusLogger)
// ToDo: what if the file does not exist in s3
// ToDo: what if checksum calculation failed

do {
try {
StorageIO<DvObject> dataFileStorageIO = DataAccess.getDirectStorageIO(fullPath);
in = dataFileStorageIO.getInputStream();
checksumVal = FileUtil.calculateChecksum(in, DataFile.ChecksumType.MD5);
count = 3;
} catch (IOException ioex) {
count = 3;
logger.fine(ioex.getMessage());
globusLogger.info(
"DataFile (fullPath " + fullPath + ") does not appear to be accessible within Dataverse: ");
} catch (Exception ex) {
count = count + 1;
ex.printStackTrace();
logger.info(ex.getMessage());
Thread.sleep(5000);
}
String storageDriverId = DataAccess.getDriverIdAndStorageLocation(fullPath)[0];

} while (count < 3);
if (StorageIO.isDataverseAccessible(storageDriverId)) {
do {
try {
StorageIO<DvObject> dataFileStorageIO = DataAccess.getDirectStorageIO(fullPath);
in = dataFileStorageIO.getInputStream();
checksumVal = FileUtil.calculateChecksum(in, DataFile.ChecksumType.MD5);
count = 3;
} catch (IOException ioex) {
count = 3;
logger.fine(ioex.getMessage());
globusLogger.info(
"DataFile (fullPath " + fullPath + ") does not appear to be accessible within Dataverse: ");
} catch (Exception ex) {
count = count + 1;
ex.printStackTrace();
logger.info(ex.getMessage());
Thread.sleep(5000);
}


} while (count < 3);
}

if (checksumVal.length() == 0) {
checksumVal = "Not available in Dataverse";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public void handleTimeout(jakarta.ejb.Timer timer) {
}

try {
logger.log(Level.INFO,"Handling timeout on " + InetAddress.getLocalHost().getCanonicalHostName());
logger.log(Level.FINE,"Handling timeout on " + InetAddress.getLocalHost().getCanonicalHostName());
} catch (UnknownHostException ex) {
Logger.getLogger(DataverseTimerServiceBean.class.getName()).log(Level.SEVERE, null, ex);
}

if (timer.getInfo() instanceof MotherTimerInfo) {
logger.info("Behold! I am the Master Timer, king of all timers! I'm here to create all the lesser timers!");
logger.fine("Behold! I am the Master Timer, king of all timers! I'm here to create all the lesser timers!");
removeHarvestTimers();
for (HarvestingClient client : harvestingClientService.getAllHarvestingClients()) {
createHarvestTimer(client);
Expand Down

0 comments on commit 0495160

Please sign in to comment.