Commit | Line | Data |
---|---|---|
5945cec9 | 1 | package org.eclipse.linuxtools.internal.lttng.core.state.trace; |
5d10d135 | 2 | |
5945cec9 FC |
3 | import org.eclipse.linuxtools.internal.lttng.core.event.LttngSyntheticEvent; |
4 | import org.eclipse.linuxtools.internal.lttng.core.state.model.LttngTraceState; | |
4df4581d | 5 | import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp; |
6c13869b | 6 | import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange; |
6c13869b FC |
7 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
8 | import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpoint; | |
5d10d135 | 9 | |
550d787e FC |
10 | public interface IStateTraceManager { |
11 | // /** | |
12 | // * TODO: Not ready for threading | |
13 | // * <p> | |
14 | // * Read events within specific time window, e.g. time range selection | |
15 | // * </p> | |
0c32e4c5 | 16 | // * |
550d787e FC |
17 | // * @param trange |
18 | // * @param source | |
19 | // * @param listener | |
20 | // * @param processor | |
21 | // * @return | |
22 | // */ | |
23 | // public abstract ILttngSyntEventRequest executeDataRequest( | |
24 | // TmfTimeRange trange, Object source, | |
25 | // IRequestStatusListener listener, ITransEventProcessor processor); | |
5d10d135 ASL |
26 | |
27 | /** | |
28 | * used to obtain details on the log associated with this manager e.g. | |
29 | * logid. | |
0c32e4c5 | 30 | * |
5d10d135 ASL |
31 | * @return |
32 | */ | |
0c32e4c5 | 33 | public abstract ITmfTrace getStateTrace(); |
5d10d135 ASL |
34 | |
35 | /** | |
36 | * Restore to the closest checkpoint from TmfTimestamp | |
37 | * <p> | |
38 | * Note : it is heavier to restore by timestamp than by event position, | |
39 | * restore by event position whichever possible. | |
0c32e4c5 | 40 | * |
5d10d135 ASL |
41 | * @param eventTime |
42 | * The timestamp of the event to restore to | |
0c32e4c5 | 43 | * |
a79913eb | 44 | * @return TmfCheckpoint indicates the nearest checkpoint used to restore the |
5d10d135 ASL |
45 | * state, null sent if input is invalid |
46 | */ | |
a79913eb | 47 | public abstract TmfCheckpoint restoreCheckPointByTimestamp( |
4df4581d | 48 | ITmfTimestamp eventTime); |
5d10d135 | 49 | |
a79913eb FC |
50 | /** |
51 | * Restore to the closest checkpoint from index | |
0c32e4c5 | 52 | * |
a79913eb FC |
53 | * @param eventIndex |
54 | * The index of the event to restore to | |
0c32e4c5 | 55 | * |
a79913eb FC |
56 | * @return TmfCheckpoint indicates the nearest checkpoint used to restore the |
57 | * state, null sent if input is invalid | |
58 | */ | |
59 | public abstract TmfCheckpoint restoreCheckPointByIndex(long eventIndex); | |
60 | ||
5d10d135 ASL |
61 | /** |
62 | * @return | |
63 | */ | |
64 | public abstract TmfTimeRange getExperimentTimeWindow(); | |
65 | ||
66 | /** | |
550d787e FC |
67 | * Returns the State model used to build the check points for the state |
68 | * system | |
0c32e4c5 | 69 | * |
550d787e FC |
70 | * @return |
71 | */ | |
72 | public abstract LttngTraceState getCheckPointStateModel(); | |
73 | ||
74 | /** | |
75 | * Returns the State model instance associated with this Trace i.e. not the | |
76 | * checkpoint build state model | |
5d10d135 | 77 | * Returns the State model instance associated with this Trace |
0c32e4c5 | 78 | * |
5d10d135 ASL |
79 | * @return |
80 | */ | |
81 | public abstract LttngTraceState getStateModel(); | |
82 | ||
0c32e4c5 | 83 | |
550d787e FC |
84 | /** |
85 | * Reset previously stored check points, and initialize the associated state | |
86 | * model | |
87 | */ | |
88 | public void clearCheckPoints(); | |
89 | ||
90 | /** | |
91 | * handles incoming events used to build the associated check points, The | |
92 | * user must call clearCheckPoints before the processing the first synthetic | |
93 | * event. | |
0c32e4c5 | 94 | * |
550d787e FC |
95 | * @param synEvent |
96 | * @param eventCount | |
97 | */ | |
98 | public void handleEvent(LttngSyntheticEvent synEvent, Long eventCount); | |
99 | } |