From: Geneviève Bastien Date: Fri, 1 Apr 2016 20:29:00 +0000 (-0400) Subject: tmf: Add a method to verify if analysis is ready at timestamp X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0b9711a7e91f3acb9d8b3dbecdb0a6e217e9c981;p=deliverable%2Ftracecompass.git tmf: Add a method to verify if analysis is ready at timestamp First step to resolve bug 488757. This new method will return whether an analysis is ready to be queried at a given timestamp. Change-Id: I2a1f597d503fe74664df95d0bb5c4c16952b6376 Signed-off-by: Geneviève Bastien Reviewed-on: https://git.eclipse.org/r/69753 Reviewed-by: Hudson CI Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/IAnalysisModule.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/IAnalysisModule.java index 0a8061b54d..0c6a34f79f 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/IAnalysisModule.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/IAnalysisModule.java @@ -99,8 +99,8 @@ public interface IAnalysisModule extends ITmfComponent, IAnalysisRequirementProv * @param trace * The trace to run the analysis on * @return {@code true} if the trace was successfully set on the module, - * {@code false} if the analysis cannot be applied to the trace, - * for instance if the trace does not have the right requirements + * {@code false} if the analysis cannot be applied to the trace, for + * instance if the trace does not have the right requirements * @throws TmfAnalysisException * This exception should be thrown if the trace is set more than * once @@ -203,6 +203,30 @@ public interface IAnalysisModule extends ITmfComponent, IAnalysisRequirementProv */ boolean waitForCompletion(@NonNull IProgressMonitor monitor); + /** + * Return whether the analysis is ready to be queried at a given time. + * + * A return value of false means that the caller can wait and + * this will eventually return true. + * + * Note to implementers: If the analysis is not started or completed, even + * though the timestamp was not part of it, or cancelled, this should return + * true so the caller does not end up waiting for something + * that will never happen. Calling this method can however trigger the + * scheduling of the analysis. In this case, it may return + * false until the timestamp is covered. + * + * @param ts + * The timestamp to validate + * @return Whether the analysis is ready to be queried at the timestamp. A + * value of false means the caller may wait until the + * analysis has reached the desired time. + * @since 2.0 + */ + default boolean isQueryable(long ts) { + return true; + } + /** * Cancels the current analysis */