Refactor TmfTrace and dependencies - finalize ITmfTraceIndexer
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / ITmfTraceIndexer.java
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.trace;
14
15 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
16 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
17
18 /**
19 * <b><u>ITmfTraceIndexer</u></b>
20 * <p>
21 */
22 public interface ITmfTraceIndexer<T extends ITmfTrace<ITmfEvent>> {
23
24 /**
25 * Start an asynchronous index building job and waits for the job completion
26 * if required. Typically, the indexing job sends notifications at regular
27 * intervals to indicate its progress.
28 *
29 * @param waitForCompletion
30 */
31 public void buildIndex(boolean waitForCompletion);
32
33 /**
34 * Adds an entry to the trace index.
35 *
36 * @param context
37 * @param timestamp
38 */
39 public void updateIndex(ITmfContext context, ITmfTimestamp timestamp);
40
41 /**
42 * Returns the context of the checkpoint immediately preceding the requested
43 * timestamp (or at the timestamp if it coincides with a checkpoint).
44 *
45 * @param timestamp the requested timestamp
46 * @return the checkpoint context
47 */
48 public ITmfContext seekIndex(ITmfTimestamp timestamp);
49
50 /**
51 * Returns the context of the checkpoint immediately preceding the requested
52 * rank (or at rank if it coincides with a checkpoint).
53 *
54 * @param rank the requested event rank
55 * @return the checkpoint context
56 */
57 public ITmfContext seekIndex(long rank);
58
59 }
This page took 0.033055 seconds and 6 git commands to generate.