Clear supplementory directories when xml analysis configuration is deleted#268
Conversation
So that the corresponding state system and segement store is deleted when calling clearPersistentData(). [Fixed] Implement XmlPatternAnalysis.clearPersistentData() Fixes eclipse-tracecompass#267 Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
05493e5 to
3740873
Compare
| } | ||
| } | ||
| } catch (CoreException e) { | ||
| Activator.logError("Can't delete supplementary resources for XML anlayses", e); //$NON-NLS-1$ |
| } | ||
| if (resource instanceof IFile) { | ||
| analysisIds.forEach(analysisId -> { | ||
| if (resource.getName().startsWith(analysisId)) { |
There was a problem hiding this comment.
Is it a certainty that XML analysis will only create supplementary files that are prefixed with the analysisId? It does seem to be the case with those created by TmfAnalysisModuleHelperXml.
I'm worried if you could create two XML analysis where one has an id that is based on the other but with an extra suffix at the end, then deleting the base one could delete the files from the other?
I can't think of a non-scary alternative though, like waking up every trace in the workspace to make them clear their persistent data for that analysis! Or keeping track somewhere of every supplementary file that gets created for each XML analysis.
Perhaps forcing to clear persistent data when the XML module is disposed? But this would mean it needs to be recreated every time the trace is opened.
There was a problem hiding this comment.
Good questions. I aligned this implementation to the way it's done in Eclipse Trace Compass UI. See here for the equivalent code
The analysisIds are coming from the XML files (see line 751 above), so we'll only delete resources coming from analyses defined in the XML file. So, I think it's ok, no?
Please note, that I was not able to re-use the same code for the trace server because it's in UI and because the trace server doesn't have an equivalent project model implementation.
Fixes eclipse-tracecompass#267 [Fixed] Delete supplementary files when deleting xml analysis config Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
3740873 to
63a5706
Compare
What it does
fixes #267
How to test
The corresponding state systems or segment store files are deleted from the supplementary directories.
Follow-ups
None
Review checklist