-
Notifications
You must be signed in to change notification settings - Fork 4
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
migrate analyses vdi ids #88
Conversation
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.
Really think we need to consider >1 entityId per descriptor.
readVdiMappingFile(tinyDbFile); | ||
|
||
// Default to dryrun to avoid incidental migrations when testing. | ||
_writeToDb = Boolean.parseBoolean(args.getOrDefault("-write", "false")); |
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.
Should this have the double dash to be like the other args?
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.
Yes, fixed
.map(match -> match.group(1)) | ||
.collect(Collectors.toSet()); | ||
|
||
final String entityId = ENTITY_ID_PATTERN.matcher(descriptor).results() |
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.
Are we sure there's only one here? We could easily have a config with >1 variable spec, each of which might contain a different entity ID, especially across different visualizations.
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.
There's only one entity allowed in ISA simple studies
|
||
return new TableRowInterfaces.RowResult<>(nextRow) | ||
// Create a copy with just the dataset ID updated to VDI counterpart. | ||
AnalysisRow out = new AnalysisRow(nextRow.getAnalysisId(), vdiDatasetId, new JSONObject(descriptor), |
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.
Could just use setters to assign dataset ID and descriptor here, but probably not much more expensive given the work above.
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.
Updated to use setters instead.
AnalysisRow out = new AnalysisRow(nextRow.getAnalysisId(), vdiDatasetId, new JSONObject(descriptor), | ||
nextRow.getNumFilters(), nextRow.getNumComputations(), nextRow.getNumVisualizations()); | ||
|
||
LOG.info("Analysis descriptor after migration: " + out); |
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.
You're dumping the AnalysisRow here; might have a decent toString() but isn't necessarily good for comparing to the "before" log line above.
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.
Oops, meant to log just the descriptor.
Overview
Testing