1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.trace
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEvent
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfTimestamp
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
20 * The generic trace indexer in TMF with support for incremental indexing.
23 * @author Francois Chouinard
28 public interface ITmfTraceIndexer
{
31 * Start an asynchronous index building job and waits for the job completion
32 * if required. Typically, the indexing job sends notifications at regular
33 * intervals to indicate its progress.
35 * <b>Example 1</b>: Index a whole trace asynchronously
38 * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false);
41 * <b>Example 2</b>: Index a whole trace synchronously
44 * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true);
47 * <b>Example 3</b>: Index a trace asynchronously, starting at rank 100
50 * trace.getIndexer().buildIndex(100, TmfTimeRange.ETERNITY, false);
53 * <b>Example 4</b>: Index a trace asynchronously, starting at rank 100 for
54 * events between T1 and T2 (inclusive). This is used for incremental
58 * TmfTimeRange range = new TmfTimeRange(T1, T2);
59 * trace.getIndexer().buildIndex(100, range, false);
63 * The offset of the first event to consider
65 * The time range to consider
66 * @param waitForCompletion
67 * Should we block the calling thread until the build is
70 public void buildIndex(long offset
, TmfTimeRange range
, boolean waitForCompletion
);
73 * Indicates that the indexer is busy indexing the trace.
74 * Will always return false if the indexing is done synchronously.
76 * @return the state of the indexer (indexing or not)
78 public boolean isIndexing();
81 * Adds an entry to the trace index.
83 * @param context The trace context to save
84 * @param timestamp The timestamp matching this context
86 public void updateIndex(ITmfContext context
, ITmfTimestamp timestamp
);
89 * Returns the context of the checkpoint immediately preceding the requested
90 * timestamp (or at the timestamp if it coincides with a checkpoint).
92 * @param timestamp the requested timestamp
93 * @return the checkpoint context
95 public ITmfContext
seekIndex(ITmfTimestamp timestamp
);
98 * Returns the context of the checkpoint immediately preceding the requested
99 * rank (or at rank if it coincides with a checkpoint).
101 * @param rank the requested event rank
102 * @return the checkpoint context
104 public ITmfContext
seekIndex(long rank
);
107 * Perform cleanup when the indexer is no longer required.
109 public void dispose();
This page took 0.0375529999999999 seconds and 6 git commands to generate.