Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326821 - [TMF] TmfTrace/Experiment indexing improvement
Summary: [TMF] TmfTrace/Experiment indexing improvement
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Francois Chouinard CLA
QA Contact: Francois Chouinard CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 301614
  Show dependency tree
 
Reported: 2010-10-01 17:23 EDT by Francois Chouinard CLA
Modified: 2022-01-13 14:52 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Chouinard CLA 2010-10-01 17:23:12 EDT
The indexing operation of TmfTrace objects is changed to use the new skip feature (https://bugs.eclipse.org/bugs/show_bug.cgi?id=326820). As such, indexing performance is vastly improved, and indexing of fixed size event streams is now very fast.

Some methods to control indexing are added. Beside the existing method indexStream() the new methods reindexStream(), isIndexingStream() and stopIndexingStream() are added.

The indexing operation of TmfExperiment objects is completely rewritten to improve performance. A heuristic is used to employ the new skip feature as much as possible, even when multiple traces are in the experiment.

An EventIterator class is added that provides significantly better performance than the getNextEvent() method. When the getNextEvent() method had an effort of o(n) where n is the number of traces in the experiment, the new class has an effort of o(1) – in the case when multiple traces in the
experiment do not overlap in time – to o(log n) – in the case when multiple traces in the experiment overlap in time.

The getNextEvent(), positionTraces() and processDataRequest() methods are changed to use the new EventIterator class.

Note1
-----
The trace/experiment indexing strategy was modified since to take advantage of the fact that the experiment has to read the traces to build its own index: the indexes (trace and experiment) are built as the events are read by getNextEvent(). Therefore, indexing a experiment (and its traces) boils down to processing a request to read the whole experiment. This was done to prepare the ground for trace streaming: as new incoming events are read, the index is updated on-the-fly.

Nonetheless, it should be fairly straightforward to adjust the indexing functions to use the much more efficient skipEvent(). Since requests can be cancelled and queried (for their current state), the complementary functions shouldn't be a problem either.

Note 2
------
I was thinking of changing the ITmfTrace API and move getNextEvent() to ITmfContext which would now act as an iterator (I guess I'm finally graduating from C to Java :-). It would work a bit like this:

ITmfContext myContext = myTrace.seekEvent(<some location criteria>, myRequest.getEventFilter());
while (!myContext.isCompleted() {
    event = myContext.getNextEvent();
}

I was pleasantly surprised when I saw that you introduced an EventIterator in the TmfExperiment(s)... Not exactly the same semantics, but a very similar concept that, I believe, would deserve to become a standalone TMF class.
Comment 1 Patrick Tasse CLA 2013-05-17 17:16:35 EDT
Event skipping was not implemented and is not required for now.