diff options
Diffstat (limited to 'tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java')
-rw-r--r-- | tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java new file mode 100644 index 0000000000..2e3ff1cfe3 --- /dev/null +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2012, 2014 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Francois Chouinard - Initial API and implementation + * Patrick Tasse - Updated for location in checkpoint + *******************************************************************************/ + +package org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint; + +import java.nio.ByteBuffer; + +import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp; +import org.eclipse.tracecompass.tmf.core.trace.location.ITmfLocation; + +/** + * The basic trace checkpoint structure in TMF. The purpose of the checkpoint is + * to associate a trace location to an event timestamp. + * * + * @see ITmfTimestamp + * @see ITmfLocation + * + * @author Francois Chouinard + */ +public interface ITmfCheckpoint extends Comparable<ITmfCheckpoint> { + + // ------------------------------------------------------------------------ + // Getters + // ------------------------------------------------------------------------ + + /** + * The maximum size of the serialize buffer when determining the checkpoint + * size + */ + static final int MAX_SERIALIZE_SIZE = 1024; + + /** + * @return the timestamp of the event referred to by the context + */ + ITmfTimestamp getTimestamp(); + + /** + * @return the location of the event referred to by the checkpoint + */ + ITmfLocation getLocation(); + + // ------------------------------------------------------------------------ + // Comparable + // ------------------------------------------------------------------------ + + @Override + int compareTo(ITmfCheckpoint checkpoint); + + /** + * Returns the checkpoint rank for this checkpoint. The checkpoint rank can + * be seen as the index of the checkpoint in the order it was added. + * + * @return the checkpoint rank for this checkpoint + */ + long getCheckpointRank(); + + /** + * Write the checkpoint to the ByteBuffer so that it can be saved to disk. + * + * @param bufferOut + * the buffer to write to + */ + void serialize(ByteBuffer bufferOut); +} |