Merge branch 'master'
[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 * The generic trace indexer in TMF.
20 *
21 * @version 1.0
22 * @author Francois Chouinard
23 *
24 * @see ITmfTrace
25 * @see ITmfEvent
26 */
27 public interface ITmfTraceIndexer<T extends ITmfTrace<ITmfEvent>> {
28
29 /**
30 * Start an asynchronous index building job and waits for the job completion
31 * if required. Typically, the indexing job sends notifications at regular
32 * intervals to indicate its progress.
33 *
34 * @param waitForCompletion
35 */
36 public void buildIndex(boolean waitForCompletion);
37
38 /**
39 * Adds an entry to the trace index.
40 *
41 * @param context
42 * @param timestamp
43 */
44 public void updateIndex(ITmfContext context, ITmfTimestamp timestamp);
45
46 /**
47 * Returns the context of the checkpoint immediately preceding the requested
48 * timestamp (or at the timestamp if it coincides with a checkpoint).
49 *
50 * @param timestamp the requested timestamp
51 * @return the checkpoint context
52 */
53 public ITmfContext seekIndex(ITmfTimestamp timestamp);
54
55 /**
56 * Returns the context of the checkpoint immediately preceding the requested
57 * rank (or at rank if it coincides with a checkpoint).
58 *
59 * @param rank the requested event rank
60 * @return the checkpoint context
61 */
62 public ITmfContext seekIndex(long rank);
63
64 }
This page took 0.033365 seconds and 6 git commands to generate.