-
Notifications
You must be signed in to change notification settings - Fork 19
add extra logging and skipping over bad pvs #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"); | ||
return result; | ||
} | ||
logger.log(Level.INFO, "Statuses {0}", statuses); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} | ||
|
||
|
There was a problem hiding this comment.
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.