}
@Override
- public void initTrace(String name, String path, Class<LttngEvent> eventType, int pageSize) throws FileNotFoundException {
- initLTTngTrace(name, path, eventType, pageSize, false);
- }
-
- private synchronized void initLTTngTrace(String name, String path, Class<LttngEvent> eventType, int pageSize, boolean indexTrace) throws FileNotFoundException {
- super.initTrace(name, path, eventType, (pageSize > 0) ? pageSize : CHECKPOINT_PAGE_SIZE);
+ public synchronized void initTrace(String name, String path, Class<LttngEvent> eventType) throws FileNotFoundException {
+ super.initTrace(name, path, eventType);
try {
currentJniTrace = JniTraceFactory.getJniTrace(path, traceLibPath, SHOW_LTT_DEBUG_DEFAULT);
} catch (Exception e) {
public LTTngTrace(String name, String path, String traceLibPath, boolean waitForCompletion, boolean bypassIndexing)
throws Exception {
super(name, LttngEvent.class, path, CHECKPOINT_PAGE_SIZE, false);
- initTrace(name, path, LttngEvent.class, CHECKPOINT_PAGE_SIZE);
+ initTrace(name, path, LttngEvent.class);
if (!bypassIndexing)
indexTrace(false);
this.traceLibPath = traceLibPath;
}
ITmfTimestamp timestamp = null;
- long index = position / getCacheSize();
+ long index = position / getIndexPageSize();
// Get the timestamp of the closest check point to the given position
if (fCheckpoints.size() > 0) {
previousLocation = (LttngLocation) tmpContext.getLocation();
// Ajust the index of the event we found at this check point position
- Long currentPosition = index * getCacheSize();
+ Long currentPosition = index * getIndexPageSize();
Long lastTimeValueRead = 0L;
public abstract class CTFTestFiles {
public final static long NANOSECS_PER_SEC = 1000000000L;
- private final static int PAGE_SIZE = 1000;
/*
* To run these tests, you will need to download the following trace, at:
public static CtfTmfTrace getTestTrace() throws FileNotFoundException {
if (trace == null) {
trace = new CtfTmfTrace();
- trace.initTrace("test-trace2", traceFile, CtfTmfEvent.class, PAGE_SIZE); //$NON-NLS-1$
+ trace.initTrace("test-trace2", traceFile, CtfTmfEvent.class); //$NON-NLS-1$
}
return trace;
}
private static final File emptyFile = new File(""); //$NON-NLS-1$
private static CtfTmfTrace emptyTrace = new CtfTmfTrace();
- private final static int PAGE_SIZE = 1000;
-
public static File getEmptyFile() {
return emptyFile;
}
public static CtfTmfTrace createTrace() throws FileNotFoundException {
if ( testTrace1 == null ) {
testTrace1 = new CtfTmfTrace();
- testTrace1.initTrace("test-trace", testTracePath1, CtfTmfEvent.class,PAGE_SIZE); //$NON-NLS-1$
+ testTrace1.initTrace("test-trace", testTracePath1, CtfTmfEvent.class); //$NON-NLS-1$
}
return testTrace1;
}
public void testValidateCheckpoints() throws Exception {
Vector<TmfCheckpoint> checkpoints = fExperiment.getCheckpoints();
- int pageSize = fExperiment.getCacheSize();
+ int pageSize = fExperiment.getIndexPageSize();
assertTrue("Checkpoints exist", checkpoints != null);
// Validate that each checkpoint points to the right event
public void testValidateCheckpoints() throws Exception {
Vector<TmfCheckpoint> checkpoints = fExperiment.getCheckpoints();
- int pageSize = fExperiment.getCacheSize();
+ int pageSize = fExperiment.getIndexPageSize();
assertTrue("Checkpoints exist", checkpoints != null);
// Validate that each checkpoint points to the right event
assertEquals("getType", TmfEvent.class, trace.getType());
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getName", TEST_STREAM, trace.getName());
- assertEquals("getCacheSize", TmfTrace.DEFAULT_INDEX_PAGE_SIZE, trace.getCacheSize());
+ assertEquals("getCacheSize", TmfTrace.DEFAULT_INDEX_PAGE_SIZE, trace.getIndexPageSize());
}
public void testTmfTraceDefaultCacheSize() throws Exception {
assertEquals("getType", TmfEvent.class, trace.getType());
assertEquals("getPath", testfile.toURI().getPath(), trace.getPath());
assertEquals("getName", TEST_STREAM, trace.getName());
- assertEquals("getCacheSize", TmfTrace.DEFAULT_INDEX_PAGE_SIZE, trace.getCacheSize());
+ assertEquals("getCacheSize", TmfTrace.DEFAULT_INDEX_PAGE_SIZE, trace.getIndexPageSize());
}
public void testTmfTrace() throws Exception {
assertEquals("getType", TmfEvent.class, fTrace.getType());
assertEquals("getName", TEST_STREAM, fTrace.getName());
- assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
+ assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getIndexPageSize());
}
public void testClone() throws Exception {
assertEquals("getType", TmfEvent.class, trace.getType());
assertEquals("getPath", fTrace.getPath(), trace.getPath());
assertEquals("getName", TEST_STREAM, trace.getName());
- assertEquals("getCacheSize", BLOCK_SIZE, trace.getCacheSize());
+ assertEquals("getCacheSize", BLOCK_SIZE, trace.getIndexPageSize());
assertEquals("getTimeRange", fTrace.getTimeRange(), trace.getTimeRange());
}
// ------------------------------------------------------------------------
public void testTmfTraceIndexing() throws Exception {
- assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
+ assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getIndexPageSize());
assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents());
assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue());
assertEquals("getRange-end", NB_EVENTS, fTrace.getTimeRange().getEndTime().getValue());
assertEquals("getEndTime", NB_EVENTS, fTrace.getEndTime().getValue());
Vector<TmfCheckpoint> checkpoints = fTrace.getCheckpoints();
- int pageSize = fTrace.getCacheSize();
+ int pageSize = fTrace.getIndexPageSize();
assertTrue("Checkpoints exist", checkpoints != null);
// Validate that each checkpoint points to the right event
}
@Override
- public void initTrace(String name, String path, Class<CtfTmfEvent> eventType, int pageSize)
+ public void initTrace(String name, String path, Class<CtfTmfEvent> eventType)
throws FileNotFoundException {
try {
this.fTrace = new CTFTrace(path);
}
@Override
- public int getCacheSize() {
+ public int getIndexPageSize() {
return this.fIndexPageSize;
}
/**
* <b><u>ITmfEvent</u></b>
* <p>
- * The basic event structure in the TMF. In its canonical form, a data item has:
+ * The basic event structure in TMF. In its canonical form, a data item has:
* <ul>
* <li> a parent trace
* <li> a rank (order within the trace)
}
@Override
- public void initTrace(String name, String path, Class<T> eventType, int pageSize) {
+ public void initTrace(String name, String path, Class<T> eventType) {
}
/**
}
@Override
- public int getCacheSize() {
+ public int getIndexPageSize() {
return fIndexPageSize;
}
/**
* <b><u>ITmfTrace</u></b>
* <p>
- * The basic event trace structure in the TMF.
+ * The basic event trace structure in TMF.
*/
public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent {
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
// ------------------------------------------------------------------------
// Initializers
// ------------------------------------------------------------------------
+
+ /**
+ * Initialize a newly instantiated "empty" trace object. This is used to
+ * parameterize an ITmfTrace instantiated with its parameterless constructor.
+ *
+ * @param name the trace name
+ * @param path the trace path
+ * @param eventType the trace event type
+ * @throws FileNotFoundException
+ */
+ public void initTrace(String name, String path, Class<T> eventType) throws FileNotFoundException;
- // initTrace variants
- public void initTrace(String name, String path, Class<T> eventType, int pageSize) throws FileNotFoundException;
+ /**
+ * Validate that the trace is of the correct type.
+ *
+ * @param project the eclipse project
+ * @param path the trace path
+ *
+ * @return true if trace is valid
+ */
+ public boolean validate(IProject project, String path);
- public void indexTrace(boolean waitForCompletion);
+ /**
+ * Set the resource used for persistent properties on this trace
+ *
+ * @param resource the properties resource
+ */
+ public void setResource(IResource resource);
- // Trace type validation
- public boolean validate(IProject project, String path);
+ /**
+ * Get the resource used for persistent properties on this trace
+ *
+ * @return the properties resource or null if none is set
+ */
+ public IResource getResource();
+
+ /**
+ * Start the trace indexing, optionally wait for the index to be fully
+ * built before returning.
+ *
+ * @param waitForCompletion
+ */
+ public void indexTrace(boolean waitForCompletion);
// ------------------------------------------------------------------------
- // Getters
+ // Basic getters
// ------------------------------------------------------------------------
/**
@Override
public String getName();
- /**
- * @return the cache size
- */
- public int getCacheSize();
-
/**
* @return the number of events in the trace
*/
public long getNbEvents();
/**
- * Trace time range accesses
+ * @return the trace time range
*/
public TmfTimeRange getTimeRange();
+ /**
+ * @return the timestamp of the first trace event
+ */
public ITmfTimestamp getStartTime();
+ /**
+ * @return the timestamp of the last trace event
+ */
public ITmfTimestamp getEndTime();
/**
*/
public long getStreamingInterval();
+ /**
+ * @return the trace index page size
+ */
+ public int getIndexPageSize();
+
// ------------------------------------------------------------------------
// Seek operations
// ------------------------------------------------------------------------
/**
- * Positions the trace at the first event with the specified timestamp or index (i.e. the nth event in the trace).
+ * Position the trace at the specified location. The null location
+ * is used to indicate that the first trace event.
*
- * Returns a context which can later be used to read the event.
- *
- * @param location
- * @return a context object for subsequent reads
+ * @param location the trace specific location (null for 1st event)
+ * @return a context which can later be used to read the corresponding event
*/
public ITmfContext seekLocation(ITmfLocation<?> location);
- public ITmfContext seekEvent(ITmfTimestamp timestamp);
-
- public ITmfContext seekEvent(long rank);
-
/**
- * Positions the trace at the event located at the specified ratio.
+ * Position the trace at the event located at the specified ratio in the
+ * trace file.
*
- * Returns a context which can later be used to read the event.
+ * The notion of ratio (0.0 <= r <= 1.0) is trace specific and left
+ * voluntarily vague. Typically, it would refer to the event proportional
+ * rank or timestamp in the trace file.
*
- * @param ratio
- * a floating-point number between 0.0 (beginning) and 1.0 (end)
- * @return a context object for subsequent reads
+ * @param ratio the proportional 'rank' in the trace
+ * @return a context which can later be used to read the corresponding event
*/
public ITmfContext seekLocation(double ratio);
+ /**
+ * Position the trace at the first event with the specified timestamp. If
+ * there is no event with the requested timestamp, a context pointing to
+ * the chronologically next event is returned.
+ *
+ * @param timestamp the timestamp of desired event
+ * @return a context which can later be used to read the corresponding event
+ */
+ public ITmfContext seekEvent(ITmfTimestamp timestamp);
+
+ /**
+ * Position the trace at the Nth event in the trace.
+ *
+ * @param rank the event rank
+ * @return a context which can later be used to read the corresponding event
+ */
+ public ITmfContext seekEvent(long rank);
+
// ------------------------------------------------------------------------
// Read operations
// ------------------------------------------------------------------------
/**
- * Return the event pointed by the supplied context (or null if no event left) and updates the context to the next
- * event.
+ * Return the event pointed by the supplied context (or null if no event
+ * left) and updates the context to point the next event.
*
+ * @param context the read context
* @return the next event in the stream
*/
public ITmfEvent getNextEvent(ITmfContext context);
/**
- * Return the event pointed by the supplied context (or null if no event left) and *does not* update the context.
+ * Return the event pointed by the supplied context (or null if no event
+ * left) and *does not* update the context.
*
+ * @param context the read context
* @return the next event in the stream
*/
public ITmfEvent parseEvent(ITmfContext context);
// ------------------------------------------------------------------------
- // misc
+ // Location getters
// ------------------------------------------------------------------------
/**
- * Returns the ratio corresponding to the specified location.
+ * Returns the ratio (proportion) corresponding to the specified location.
*
- * @param location
- * a trace location
+ * @param location a trace specific location
* @return a floating-point number between 0.0 (beginning) and 1.0 (end)
*/
public double getLocationRatio(ITmfLocation<?> location);
+ /**
+ * @return the curretn trace location
+ */
public ITmfLocation<?> getCurrentLocation();
/**
- * Returns the rank of the first event with the requested timestamp. If none, returns the index of the next event
- * (if any).
+ * Returns the rank of the first event with the requested timestamp.
+ * If none, returns the index of the subsequent event (if any).
*
* @param timestamp the requested event timestamp
* @return the corresponding event rank
*/
public long getRank(ITmfTimestamp timestamp);
- /**
- * Set the resource used for persistent properties on this trace
- * @param resource the properties resource
- */
- public void setResource(IResource resource);
-
- /**
- * Get the resource used for persistent properties on this trace
- * @return the properties resource or null if none is set
- */
- public IResource getResource();
-
}
}
@Override
- public void initTrace(String name, String path, Class<T> eventType, int pageSize) throws FileNotFoundException {
- initTmfTrace(name, path, eventType, pageSize, false);
- }
-
- private void initTmfTrace(String name, String path, Class<T> eventType, int pageSize, boolean indexTrace) throws FileNotFoundException {
+ public void initTrace(String name, String path, Class<T> eventType) throws FileNotFoundException {
fPath = path;
if (name != null) {
fTraceName = name;
}
}
super.init(fTraceName, eventType);
- fIndexPageSize = (pageSize > 0) ? pageSize : DEFAULT_INDEX_PAGE_SIZE;
- if (indexTrace)
- indexTrace(false);
}
@Override
* @param indexTrace
* @throws FileNotFoundException
*/
- protected TmfTrace(String name, Class<T> type, String path, int cacheSize, boolean indexTrace) throws FileNotFoundException {
+ protected TmfTrace(String name, Class<T> type, String path, int indexPageSize, boolean indexTrace) throws FileNotFoundException {
super();
- initTmfTrace(name, path, type, cacheSize, indexTrace);
+ initTrace(name, path, type);
+ fIndexPageSize = (indexPageSize >0) ? indexPageSize : DEFAULT_INDEX_PAGE_SIZE;
+ if (indexTrace)
+ indexTrace(false);
}
@SuppressWarnings("unchecked")
* @return the size of the cache
*/
@Override
- public int getCacheSize() {
+ public int getIndexPageSize() {
return fIndexPageSize;
}
<attribute name="category" type="string">
<annotation>
<documentation>
- an optional attribute that is composed of the category ID. The referenced category must be declared in a corresponding category element.
+ An optional attribute that is composed of the category ID. The referenced category must be declared in a corresponding category element.
</documentation>
<appinfo>
<meta.attribute kind="identifier" basedOn="org.eclipse.linuxtools.tmf.ui.tracetype/category/@id"/>
<attribute name="event_type" type="string" use="required">
<annotation>
<documentation>
- The fully qualified name of a class that extends <samp>TmfEvent</samp> .
+ The fully qualified name of a class that implements the <samp>ITmfEvent</samp> interface
</documentation>
<appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.linuxtools.tmf.core.event.TmfEvent:"/>
+ <meta.attribute kind="java" basedOn=":org.eclipse.linuxtools.tmf.core.event.ITmfEvent"/>
</appinfo>
</annotation>
</attribute>
public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {\r
\r
private static final TmfLocation<Long> NULL_LOCATION = new TmfLocation<Long>((Long) null);\r
- private static final int DEFAULT_PAGE_SIZE = 100;\r
+ private static final int DEFAULT_CACHE_SIZE = 100;\r
\r
private CustomTxtTraceDefinition fDefinition;\r
private CustomTxtEventType fEventType;\r
fEventType = new CustomTxtEventType(fDefinition);\r
}\r
\r
- public CustomTxtTrace(String name, CustomTxtTraceDefinition definition, String path, int cacheSize) throws FileNotFoundException {\r
- super(name, CustomTxtEvent.class, path, cacheSize);\r
+ public CustomTxtTrace(String name, CustomTxtTraceDefinition definition, String path, int pageSize) throws FileNotFoundException {\r
+ super(name, CustomTxtEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);\r
fDefinition = definition;\r
fEventType = new CustomTxtEventType(fDefinition);\r
}\r
\r
@Override\r
- public void initTrace(String name, String path, Class<CustomTxtEvent> eventType, int pageSize) throws FileNotFoundException {\r
- super.initTrace(name, path, eventType, (pageSize > 0) ? pageSize : DEFAULT_PAGE_SIZE);\r
+ public void initTrace(String name, String path, Class<CustomTxtEvent> eventType) throws FileNotFoundException {\r
+ super.initTrace(name, path, eventType);\r
}\r
\r
@Override\r
public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {\r
\r
private static final TmfLocation<Long> NULL_LOCATION = new TmfLocation<Long>((Long) null);\r
- private static final int DEFAULT_PAGE_SIZE = 100;\r
+ private static final int DEFAULT_CACHE_SIZE = 100;\r
\r
private CustomXmlTraceDefinition fDefinition;\r
private CustomXmlEventType fEventType;\r
fRecordInputElement = getRecordInputElement(fDefinition.rootInputElement);\r
}\r
\r
- public CustomXmlTrace(String name, CustomXmlTraceDefinition definition, String path, int cacheSize) throws FileNotFoundException {\r
- super(name, CustomXmlEvent.class, path, cacheSize);\r
+ public CustomXmlTrace(String name, CustomXmlTraceDefinition definition, String path, int pageSize) throws FileNotFoundException {\r
+ super(name, CustomXmlEvent.class, path, (pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);\r
fDefinition = definition;\r
fEventType = new CustomXmlEventType(fDefinition);\r
fRecordInputElement = getRecordInputElement(fDefinition.rootInputElement);\r
}\r
\r
@Override\r
- public void initTrace(String name, String path, Class<CustomXmlEvent> eventType, int pageSize) throws FileNotFoundException {\r
- super.initTrace(name, path, eventType, (pageSize > 0) ? pageSize : DEFAULT_PAGE_SIZE);\r
+ public void initTrace(String name, String path, Class<CustomXmlEvent> eventType) throws FileNotFoundException {\r
+ super.initTrace(name, path, eventType);\r
}\r
\r
@Override\r
return null;
}
try {
- trace.initTrace(element.getName(), element.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(element.getName(), element.getLocation().getPath(), traceEvent.getClass());
} catch (FileNotFoundException e) {
displayErrorMsg(""); //$NON-NLS-1$
}
trace.setResource(element.getResource());
- cacheSize = Math.min(cacheSize, trace.getCacheSize());
+ cacheSize = Math.min(cacheSize, trace.getIndexPageSize());
String editorId = element.getEditorId();
if (editorId == null) {
useEditor = false;
} else {
activePage.openEditor(editorInput, editorId);
}
- experiment.initTrace(null, null, null, 0);
+ experiment.initTrace(null, null, null);
experiment.indexTrace(true);
IDE.setDefaultEditor(file, editorId);
// editor should dispose the experiment on close
boolean usesEditor = editorId != null && editorId.length() > 0;
try {
- trace.initTrace(fTrace.getName(), fTrace.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(fTrace.getName(), fTrace.getLocation().getPath(), traceEvent.getClass());
if (usesEditor)
trace.indexTrace(false);
} catch (FileNotFoundException e) {
} else {
// Create the experiment
ITmfTrace[] traces = new ITmfTrace[] { trace };
- TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), fTrace.getName(), traces, trace.getCacheSize());
+ TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), fTrace.getName(), traces, trace.getIndexPageSize());
experiment.setBookmarksFile(file);
TmfExperiment.setCurrentExperiment(experiment);
throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);
}
try {
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());
} catch (FileNotFoundException e) {
}
trace.setResource(traceElement.getResource());
- cacheSize = Math.min(cacheSize, trace.getCacheSize());
+ cacheSize = Math.min(cacheSize, trace.getIndexPageSize());
traces[i] = trace;
}
TmfExperiment experiment = new TmfExperiment(TmfEvent.class, experimentElement.getName(), traces, cacheSize);
throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
}
try {
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());
} catch (FileNotFoundException e) {
}
trace.setResource(traceElement.getResource());
ITmfTrace[] traces = new ITmfTrace[] { trace };
- TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), traceElement.getName(), traces, trace.getCacheSize());
+ TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), traceElement.getName(), traces, trace.getIndexPageSize());
experiment.setBookmarksFile(fFile);
fTrace = experiment;
TmfExperiment.setCurrentExperiment(experiment);
throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);
}
try {
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());
trace.indexTrace(false);
} catch (FileNotFoundException e) {
}
((TmfTrace) trace).setResource(traceElement.getResource());
}
ITmfTrace[] traces = new ITmfTrace[] { trace };
- TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), traceElement.getName(), traces, trace.getCacheSize());
+ TmfExperiment experiment = new TmfExperiment(traceEvent.getClass(), traceElement.getName(), traces, trace.getIndexPageSize());
experiment.setBookmarksFile(fFile);
fTrace = experiment;
TmfExperiment.setCurrentExperiment(experiment);
throw new PartInitException(Messages.OpenExperimentHandler_NoTraceType);\r
}\r
try {\r
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);\r
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());\r
} catch (FileNotFoundException e) {\r
}\r
trace.setResource(traceElement.getResource());\r
- cacheSize = Math.min(cacheSize, trace.getCacheSize());\r
+ cacheSize = Math.min(cacheSize, trace.getIndexPageSize());\r
traces[i] = trace;\r
}\r
TmfExperiment experiment = new TmfExperiment(TmfEvent.class, experimentElement.getName(), traces, cacheSize);\r
experiment.setBookmarksFile(fFile);\r
fTrace = experiment;\r
- experiment.initTrace(null, null, null, 0);\r
+ experiment.initTrace(null, null, null);\r
experiment.indexTrace(true);\r
break;\r
}\r
throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);\r
}\r
try {\r
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);\r
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());\r
trace.indexTrace(false);\r
} catch (FileNotFoundException e) {\r
}\r
throw new PartInitException(Messages.OpenTraceHandler_NoTraceType);\r
}\r
try {\r
- trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass(), 0);\r
+ trace.initTrace(traceElement.getName(), traceElement.getLocation().getPath(), traceEvent.getClass());\r
trace.indexTrace(false);\r
} catch (FileNotFoundException e) {\r
}\r
super.setInput(new FileEditorInput(fFile));\r
fEventsTable.dispose();\r
if (fTrace != null) {\r
- fEventsTable = createEventsTable(fParent, fTrace.getCacheSize());\r
+ fEventsTable = createEventsTable(fParent, fTrace.getIndexPageSize());\r
fEventsTable.setTrace(fTrace, true);\r
fEventsTable.refreshBookmarks(fFile);\r
broadcast(new TmfTraceOpenedSignal(this, fTrace, fFile, fEventsTable));\r
fParent = parent;\r
if (fTrace != null) {\r
setPartName(fTrace.getName());\r
- fEventsTable = createEventsTable(parent, fTrace.getCacheSize());\r
+ fEventsTable = createEventsTable(parent, fTrace.getIndexPageSize());\r
fEventsTable.setTrace(fTrace, true);\r
fEventsTable.refreshBookmarks(fFile);\r
broadcast(new TmfTraceOpenedSignal(this, fTrace, fFile, fEventsTable));\r
fTrace = (ITmfTrace<?>) ce.createExecutableExtension(TmfTraceType.TRACE_TYPE_ATTR);\r
TmfEvent event = (TmfEvent) ce.createExecutableExtension(TmfTraceType.EVENT_TYPE_ATTR);\r
String path = fFile.getLocationURI().getPath();\r
- fTrace.initTrace(name, path, event.getClass(), 0);\r
+ fTrace.initTrace(name, path, event.getClass());\r
fTrace.indexTrace(false);\r
break;\r
}\r
}\r
fEventsTable.dispose();\r
if (fTrace != null) {\r
- fEventsTable = createEventsTable(fParent, fTrace.getCacheSize());\r
+ fEventsTable = createEventsTable(fParent, fTrace.getIndexPageSize());\r
fEventsTable.setTrace(fTrace, true);\r
broadcast(new TmfTraceOpenedSignal(this, fTrace, fFile, fEventsTable));\r
} else {\r
return;\r
}\r
request = new TmfEventRequest<TmfEvent>(TmfEvent.class, TmfTimeRange.ETERNITY, (int) fFilterCheckCount,\r
- nbRequested, fTrace.getCacheSize(), ExecutionType.BACKGROUND) {\r
+ nbRequested, fTrace.getIndexPageSize(), ExecutionType.BACKGROUND) {\r
@Override\r
public void handleData(TmfEvent event) {\r
super.handleData(event);\r
boolean wrapped = false;\r
while (!monitor.isCanceled() && foundRank == -1 && fTrace != null) {\r
int nbRequested = (direction == Direction.FORWARD ? Integer.MAX_VALUE : Math.min((int) rank + 1,\r
- fTrace.getCacheSize()));\r
+ fTrace.getIndexPageSize()));\r
if (direction == Direction.BACKWARD) {\r
- rank = Math.max(0, rank - fTrace.getCacheSize() + 1);\r
+ rank = Math.max(0, rank - fTrace.getIndexPageSize() + 1);\r
}\r
request = new TmfDataRequest<TmfEvent>(TmfEvent.class, (int) rank, nbRequested) {\r
long currentRank = rank;\r
if (fExperiment == null) {
return new TmfEventsTable(parent, DEFAULT_CACHE_SIZE);
}
- int cacheSize = fExperiment.getCacheSize();
+ int cacheSize = fExperiment.getIndexPageSize();
String commonTraceType = null;
try {
for (ITmfTrace<?> trace : fExperiment.getTraces()) {
}\r
\r
public void merge(RankRangeList rankRangeList) {\r
- long threshold = fParentEntry.getTrace().getCacheSize();\r
+ long threshold = fParentEntry.getTrace().getIndexPageSize();\r
for (RankRange newRange : rankRangeList) {\r
boolean merged = false;\r
for (RankRange oldRange : fRankRangeList) {\r
done = true;\r
break;\r
}\r
- if (context.getRank() % trace.getCacheSize() == 1) {\r
+ if (context.getRank() % trace.getIndexPageSize() == 1) {\r
// break for UI refresh\r
break;\r
}\r
entryIsBookmarked |= event.isBookmarked();\r
entryIsVisible |= event.isVisible();\r
entryIsSearchMatch |= event.isSearchMatch();\r
- if (++fCount % timeAnalysisEntry.getTrace().getCacheSize() == 0) {\r
+ if (++fCount % timeAnalysisEntry.getTrace().getIndexPageSize() == 0) {\r
refreshViewer(false);\r
}\r
}\r