Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,36 @@ private Map<ArchiveAction, List<ArchivePVOptions>> getArchiveActions(
return result;
}
List<Map<String, String>> statuses = archiverClient.getStatuses(archivePVS, archiverInfo.url(), archiverInfo.alias());
statuses
.forEach(archivePVStatusJsonMap -> {
String archiveStatus = archivePVStatusJsonMap.get("status");
String pvName = archivePVStatusJsonMap.get("pvName");
String pvStatus = archivePVS.get(pvName).getPvStatus();
ArchiveAction action = pickArchiveAction(archiveStatus, pvStatus);
result.get(action).add(archivePVS.get(pvName));
});
if (statuses == null) {
logger.log(Level.WARNING, "archiverClient.getStatuses returned null");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be impossible. If you see archiverClient.getStatusesFromPvListQuery and archiverClient.getStatusesFromPvListBody return empty lists rather than null if something goes wrong. Or they should do.

return result;
}
logger.log(Level.INFO, "Statuses {0}", statuses);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be debug level (or FINER in java logging levels). This could be massive.

statuses.forEach(archivePVStatusJsonMap -> {
String archiveStatus = archivePVStatusJsonMap.get("status");
String pvName = archivePVStatusJsonMap.get("pvName");

if (archiveStatus == null || pvName == null) {
logger.log(Level.WARNING, "Missing status or pvName in archivePVStatusJsonMap: {0}", archivePVStatusJsonMap);
return;
}

ArchivePVOptions archivePVOptions = archivePVS.get(pvName);
if (archivePVOptions == null) {
logger.log(Level.WARNING, "archivePVS does not contain pvName: {0}", pvName);
return;
}

String pvStatus = archivePVOptions.getPvStatus();
ArchiveAction action = pickArchiveAction(archiveStatus, pvStatus);

List<ArchivePVOptions> archivePVOptionsList = result.get(action);
if (archivePVOptionsList == null) {
logger.log(Level.WARNING, "No list found for action: {0}", action);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure its possible for archivePVOptionsList to be null, see lines 194 to 195.

return;
}
archivePVOptionsList.add(archivePVOptions);
});
return result;
}

Expand Down
Loading