*/
private long endTime;
- protected void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
return this.startTime;
}
+ /**
+ * Set the trace's end time
+ *
+ * @param endTime
+ * The end time to use
+ */
+ protected void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
fTable.getColumns()[3].setData(Key.FIELD_ID, ITmfEvent.EVENT_FIELD_CONTENT);
}
- /**
- * @param event
- * @return
- */
@Override
protected ITmfEventField[] extractItemFields(ITmfEvent event) {
ITmfEventField[] fields = new TmfEventField[0];
*/
public class TestCommandShell implements ICommandShell {
+ /** If the shell is connected */
protected boolean fIsConnected = false;
@Override
* @param domain - the domain of the channels.
* @param channelNames - a list of channel names
* @param monitor - a progress monitor
- * @throws ExecutionException
+ * @throws ExecutionException If the command fails
*/
abstract protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
* @param channel - channel of events to be enabled
* @param eventNames - list event names
* @param monitor - a progress monitor
- * @throws ExecutionException
+ * @throws ExecutionException If the command fails
*/
abstract protected void changeState(TraceChannelComponent channel, List<String> eventNames, IProgressMonitor monitor) throws ExecutionException;
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
+
+ /**
+ * The command parameter
+ */
protected CommandParameter fParam;
// ------------------------------------------------------------------------
* - a progress monitor
* @return the command result
* @throws ExecutionException
+ * If the command fails
*/
protected ICommandResult executeCommand(String command,
IProgressMonitor monitor) throws ExecutionException {
* Copyright (c) 2012 Ericsson
* Copyright (c) 2010, 2011 École Polytechnique de Montréal
* Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
- *
+ *
* 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
- *
+ *
*******************************************************************************/
package org.eclipse.linuxtools.internal.tmf.core.statesystem.historytree;
/**
* The base class for all the types of nodes that go in the History Tree.
- *
+ *
* @author alexmont
- *
+ *
*/
abstract class HTNode {
/**
* Reader factory constructor. Build a Node object (of the right type) by
* reading a block in the file.
- *
+ *
* @param tree
* Reference to the HT which will own this node
* @param fc
/**
* Add an interval to this node
- *
+ *
* @param newInterval
*/
void addInterval(HTInterval newInterval) {
/**
* We've received word from the containerTree that newest nodes now exist to
* our right. (Puts isDone = true and sets the endtime)
- *
+ *
* @param endtime
* The nodeEnd time that the node will have
* @throws TimeRangeException
* The method to fill up the stateInfo (passed on from the Current State
* Tree when it does a query on the SHT). We'll replace the data in that
* vector with whatever relevant we can find from this node
- *
+ *
* @param stateInfo
* The same stateInfo that comes from SHT's doQuery()
* @param t
/**
* Get a single Interval from the information in this node If the
* key/timestamp pair cannot be found, we return null.
- *
+ *
* @param key
* @param t
* @return The Interval containing the information we want, or null if it
/**
* Debugging function that prints out the contents of this node
- *
+ *
* @param writer
* PrintWriter in which we will print the debug output
*/
final static int getCommonHeaderSize() {
/*
* 1 - byte (type)
- *
+ *
* 16 - 2x long (start time, end time)
- *
+ *
* 16 - 4x int (seq number, parent seq number, intervalcount, strings
* section pos.)
- *
+ *
* 1 - byte (done or not)
*/
return 34;
}
- /**
- * @name Abstract methods
- */
+ // ------------------------------------------------------------------------
+ // Abstract methods
+ // ------------------------------------------------------------------------
protected abstract byte getNodeType();
*/
public class HistoryTreeBackend implements IStateHistoryBackend {
+ /** The history tree that sits underneath */
protected final HistoryTree sht;
+
+ /** Direct reference to the tree's IO object */
private final HT_IO treeIO;
/** Indicates if the history tree construction is done */
// Attributes
// ------------------------------------------------------------------------
+ /** The type of event handled by this provider */
protected Class<? extends ITmfEvent> fType;
+
+ /** Is there some data being logged? */
protected boolean fLogData;
+
+ /** Are errors being logged? */
protected boolean fLogError;
- protected int fQueueSize = DEFAULT_QUEUE_SIZE;
+ /** Queue of events */
protected BlockingQueue<ITmfEvent> fDataQueue;
+
+ /** Size of the fDataQueue */
+ protected int fQueueSize = DEFAULT_QUEUE_SIZE;
+
private TmfRequestExecutor fExecutor;
private int fSignalDepth = 0;
TmfProviderManager.register(fType, this);
}
+ /**
+ * Constructor specifying the event type and the queue size.
+ *
+ * @param name
+ * Name of the provider
+ * @param type
+ * Type of event that will be handled
+ * @param queueSize
+ * Size of the event queue
+ */
protected TmfDataProvider(String name, Class<? extends ITmfEvent> type, int queueSize) {
this();
fQueueSize = queueSize;
// Coalescing (primitive test...)
// ------------------------------------------------------------------------
+ /** List of coalesced requests */
protected Vector<TmfCoalescedDataRequest> fPendingCoalescedRequests = new Vector<TmfCoalescedDataRequest>();
+ /**
+ * Create a new request from an existing one, and add it to the coalesced
+ * requests
+ *
+ * @param request
+ * The request to copy
+ */
protected void newCoalescedDataRequest(ITmfDataRequest request) {
synchronized (fLock) {
TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(request.getDataType(), request.getIndex(),
}
}
+ /**
+ * Add an existing requests to the list of coalesced ones
+ *
+ * @param request
+ * The request to add to the list
+ */
protected void coalesceDataRequest(ITmfDataRequest request) {
synchronized (fLock) {
for (TmfCoalescedDataRequest coalescedRequest : fPendingCoalescedRequests) {
}
}
+ /**
+ * Queue a request.
+ *
+ * @param request
+ * The data request
+ */
protected void queueRequest(final ITmfDataRequest request) {
if (fExecutor.isShutdown()) {
TmfCoreTracer.traceRequest(request, "QUEUED"); //$NON-NLS-1$
}
fExecutor.execute(thread);
-
}
- protected void queueBackgroundRequest(final ITmfDataRequest request, final int blockSize, final boolean indexing) {
+ /**
+ * Queue a background request
+ *
+ * @param request
+ * The request
+ * @param blockSize
+ * The request should be split in chunks of this size
+ * @param indexing
+ * Should we index the chunks
+ */
+ protected void queueBackgroundRequest(final ITmfDataRequest request,
+ final int blockSize, final boolean indexing) {
final TmfDataProvider provider = this;
* specific and will be updated by getNext().
*
* @param request
- * @return an application specific context; null if request can't be serviced
+ * The request
+ * @return Sn application specific context; null if request can't be
+ * serviced
*/
protected abstract ITmfContext armRequest(ITmfDataRequest request);
// Attributes
// ------------------------------------------------------------------------
+ /** The name of this field */
protected final String name;
// ------------------------------------------------------------------------
}
/**
+ * Build the state system(s) associated with this trace type.
+ *
* Suppressing the warning, because the 'throws' will usually happen in
* sub-classes.
*
* @throws TmfTraceException
+ * If there is a problem during the build
*/
@SuppressWarnings("unused")
protected void buildStateSystem() throws TmfTraceException {
*/
protected String fSupplPatternLetters = "TSCN"; //$NON-NLS-1$
- /**
+ /*
* The bracketing symbols used to mitigate the risk of a format string
* that contains escaped sequences that would conflict with our format
* extension.
*/
+ /** The open bracket symbol */
protected String fOpenBracket = "[&"; //$NON-NLS-1$
+
+ /** The closing bracket symbol */
protected String fCloseBracket = "&]"; //$NON-NLS-1$
// ------------------------------------------------------------------------
private final Class<? extends ITmfEvent> fDataType;
private final ExecutionType fExecType;
- private final int fRequestId; // A unique request ID
- protected long fIndex; // The index (rank) of the requested event
- protected int fNbRequested; // The number of requested events (ALL_DATA for all)
- private final int fBlockSize; // The block size (for BG requests)
- private int fNbRead; // The number of reads so far
+
+ /** A unique request ID */
+ private final int fRequestId;
+
+ /** The index (rank) of the requested event */
+ protected long fIndex;
+
+ /** The number of requested events (ALL_DATA for all) */
+ protected int fNbRequested;
+
+ /** The block size (for BG requests) */
+ private final int fBlockSize;
+
+ /** The number of reads so far */
+ private int fNbRead;
private final CountDownLatch startedLatch = new CountDownLatch(1);
private final CountDownLatch completedLatch = new CountDownLatch(1);
private final Thread eventHandlerThread;
private boolean ssAssigned;
- protected ITmfStateSystemBuilder ss;
private ITmfEvent currentEvent;
+ /** State system in which to insert the state changes */
+ protected ITmfStateSystemBuilder ss;
+
/**
* Instantiate a new state provider plugin.
*
return map;
}
- protected long checkStartTime(ITmfTimestamp startTs) {
+ private long checkStartTime(ITmfTimestamp startTs) {
long start = startTs.normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
if (start < stats.getStartTime()) {
return stats.getStartTime();
return start;
}
- protected long checkEndTime(ITmfTimestamp endTs) {
+ private long checkEndTime(ITmfTimestamp endTs) {
long end = endTs.normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
if (end > stats.getCurrentEndTime()) {
return stats.getCurrentEndTime();
// Attributes
// ------------------------------------------------------------------------
- // The event trace to index
+ /** The event trace to index */
protected final ITmfTrace fTrace;
- // The interval between checkpoints
+ /** The interval between checkpoints */
private final int fCheckpointInterval;
- // The event trace to index
+ /** The event trace to index */
private boolean fIsIndexing;
/**
* @param type the trace event type
* @param path the trace path
* @param cacheSize the trace cache size
- * @throws TmfTraceException
+ * @throws TmfTraceException If something failed during the opening
*/
protected TmfTrace(final IResource resource, final Class<? extends ITmfEvent> type, final String path, final int cacheSize) throws TmfTraceException {
this(resource, type, path, cacheSize, 0);
* @param path the trace path
* @param cacheSize the trace cache size
* @param interval the trace streaming interval
- * @throws TmfTraceException
+ * @throws TmfTraceException If something failed during the opening
*/
protected TmfTrace(final IResource resource, final Class<? extends ITmfEvent> type, final String path, final int cacheSize, final long interval) throws TmfTraceException {
this(resource, type, path, cacheSize, interval, null);
* @param type the trace event type
* @param path the trace path
* @param cacheSize the trace cache size
+ * @param interval the trace streaming interval
* @param indexer the trace indexer
- * @throws TmfTraceException
+ * @throws TmfTraceException If something failed during the opening
*/
protected TmfTrace(final IResource resource, final Class<? extends ITmfEvent> type, final String path, final int cacheSize,
final long interval, final ITmfTraceIndexer indexer) throws TmfTraceException {
* @param type the trace event type
* @param path the trace path
* @param cacheSize the trace cache size
+ * @param interval the trace streaming interval
* @param indexer the trace indexer
* @param parser the trace event parser
- * @throws TmfTraceException
+ * @throws TmfTraceException If something failed during the opening
*/
protected TmfTrace(final IResource resource, final Class<? extends ITmfEvent> type, final String path, final int cacheSize,
final long interval, final ITmfTraceIndexer indexer, final ITmfEventParser parser) throws TmfTraceException {
* @param path the trace path
* @param type the trace event type
*
- * @throws TmfTraceException
+ * @throws TmfTraceException If something failed during the initialization
*/
protected void initialize(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
if (path == null) {
}
/**
- * The default implementation of TmfTrace uses a TmfStatistics backend.
+ * The default implementation of TmfTrace uses a TmfStatistics back-end.
* Override this if you want to specify another type (or none at all).
*
+ * @throws TmfTraceException
+ * If there was a problem setting up the statistics
* @since 2.0
*/
protected void buildStatistics() throws TmfTraceException {