BTree index on disk
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / indexer / checkpoint / ITmfCheckpoint.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 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 * Patrick Tasse - Updated for location in checkpoint
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint;
15
16 import java.nio.ByteBuffer;
17
18 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
19 import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
20
21 /**
22 * The basic trace checkpoint structure in TMF. The purpose of the checkpoint is
23 * to associate a trace location to an event timestamp.
24 * *
25 * @see ITmfTimestamp
26 * @see ITmfLocation
27 *
28 * @author Francois Chouinard
29 * @since 3.0
30 */
31 public interface ITmfCheckpoint extends Comparable<ITmfCheckpoint> {
32
33 // ------------------------------------------------------------------------
34 // Getters
35 // ------------------------------------------------------------------------
36
37 /**
38 * The maximum size of the serialize buffer when determining the checkpoint
39 * size
40 */
41 static final int MAX_SERIALIZE_SIZE = 1024;
42
43 /**
44 * @return the timestamp of the event referred to by the context
45 * @since 2.0
46 */
47 ITmfTimestamp getTimestamp();
48
49 /**
50 * @return the location of the event referred to by the checkpoint
51 */
52 ITmfLocation getLocation();
53
54 // ------------------------------------------------------------------------
55 // Comparable
56 // ------------------------------------------------------------------------
57
58 @Override
59 int compareTo(ITmfCheckpoint checkpoint);
60
61 /**
62 * Returns the checkpoint rank for this checkpoint. The checkpoint rank can
63 * be seen as the index of the checkpoint in the order it was added.
64 *
65 * @return the checkpoint rank for this checkpoint
66 * @since 3.0
67 */
68 long getCheckpointRank();
69
70 /**
71 * Write the checkpoint to the ByteBuffer so that it can be saved to disk.
72 *
73 * @param bufferOut
74 * the buffer to write to
75 *
76 * @since 3.0
77 */
78 void serialize(ByteBuffer bufferOut);
79 }
This page took 0.031352 seconds and 5 git commands to generate.