Finalize ITmfTrace API
authorFrancois Chouinard <fchouinard@gmail.com>
Fri, 30 Mar 2012 17:12:00 +0000 (13:12 -0400)
committerFrancois Chouinard <fchouinard@gmail.com>
Tue, 3 Apr 2012 19:44:44 +0000 (15:44 -0400)
22 files changed:
org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java
org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/TestParams.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/experiment/TmfExperimentTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/experiment/TmfMultiTraceExperimentTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
org.eclipse.linuxtools.tmf.ui/schema/org.eclipse.linuxtools.tmf.ui.tracetype.exsd
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenExperimentHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/OpenTraceHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/editors/EventsViewEditor.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/editors/TmfEventsEditor.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/events/TmfEventsView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java

index e50fcedc22607f0f9fc7ef6e99fccbda92772aa3..d7f7ca9bed0a9d9d877c315a35171175b868aa9d 100644 (file)
@@ -116,12 +116,8 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
     }
 
     @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) {
@@ -305,7 +301,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
     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;
@@ -543,7 +539,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
         }
 
         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) {
@@ -563,7 +559,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
         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;
 
index d008558062b12d17f8840bb183c2313739de205f..2c8cffb19397345fa1a3a6a225f8919684207d85 100644 (file)
@@ -26,7 +26,6 @@ import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
 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:
@@ -44,7 +43,7 @@ public abstract class CTFTestFiles {
     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;
     }
index cbf149d82a2006240d780aa39860bb3faee21ce3..9a0a25704eef47296f693a4aaf4a28eb7a069133 100644 (file)
@@ -16,8 +16,6 @@ public abstract class TestParams {
     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;
     }
@@ -29,7 +27,7 @@ public abstract class TestParams {
     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;
     }
index 57e418a2aaa9da80822751fe5bbd1b6c2672ce31..01a1534f13fe5f073541bc151230aae651241744 100644 (file)
@@ -124,7 +124,7 @@ public class TmfExperimentTest extends TestCase {
     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
index 7768390f80affc123e450c07ef87a3281d720730..d240e85275b250a2ef9284c7e997781f19592680 100644 (file)
@@ -128,7 +128,7 @@ public class TmfMultiTraceExperimentTest extends TestCase {
     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
index 40213c39479cfac697fc9026275a2f73112a3e81..c7c7903d924535df3e3eeaeedadd96de586500fd 100644 (file)
@@ -125,7 +125,7 @@ public class TmfTraceTest extends TestCase {
                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 {
@@ -144,13 +144,13 @@ public class TmfTraceTest extends TestCase {
                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 {
@@ -158,7 +158,7 @@ public class TmfTraceTest extends TestCase {
                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());
     }
 
@@ -216,7 +216,7 @@ public class TmfTraceTest extends TestCase {
     // ------------------------------------------------------------------------
 
     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());
@@ -224,7 +224,7 @@ public class TmfTraceTest extends TestCase {
         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
index 3a81bbb0ba68dc0ba038526731f8bdffab8eac9d..65e799843530686bcc95f1de1f70f9c4f4597ff0 100644 (file)
@@ -70,7 +70,7 @@ public class CtfTmfTrace extends TmfEventProvider<CtfTmfEvent> implements
     }
 
     @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);
@@ -154,7 +154,7 @@ public class CtfTmfTrace extends TmfEventProvider<CtfTmfEvent> implements
     }
 
     @Override
-    public int getCacheSize() {
+    public int getIndexPageSize() {
         return this.fIndexPageSize;
     }
 
index cf9c33cfea4d738e4b25e9a6fc8c75767b00fd12..9cd5c73f19b659c9c4883791ab0190afb4505686 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 /**
  * <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)
index 9a4c1b7b0c8a2f37790ce6e6c37bd8d7b43f59df..192e1af6f0908428a36a530dd84c7d5f6a1f2910 100644 (file)
@@ -96,7 +96,7 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl
     }
 
     @Override
-    public void initTrace(String name, String path, Class<T> eventType, int pageSize) {
+    public void initTrace(String name, String path, Class<T> eventType) {
     }
 
     /**
@@ -182,7 +182,7 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl
     }
 
     @Override
-    public int getCacheSize() {
+    public int getIndexPageSize() {
         return fIndexPageSize;
     }
 
index b032ec10c8fb9c3f39fbb97eaf30cfe7b7d521e5..5c8fdb25b101ccd440ab58a8e85148e945e3d1b8 100644 (file)
@@ -25,28 +25,59 @@ import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
 /**
  * <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
     // ------------------------------------------------------------------------
 
     /**
@@ -60,23 +91,24 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent {
     @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();
 
     /**
@@ -84,89 +116,102 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent {
      */
     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();
-
 }
index 7109971a228ffab289345a3c36965792c925bcd1..965e93b230a46f4d9dd02137d28c2deaeaaf0fb0 100644 (file)
@@ -97,11 +97,7 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
     }
 
     @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;
@@ -114,9 +110,6 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
             }
         }
         super.init(fTraceName, eventType);
-        fIndexPageSize = (pageSize > 0) ? pageSize : DEFAULT_INDEX_PAGE_SIZE;
-        if (indexTrace)
-            indexTrace(false);
     }
 
     @Override
@@ -157,9 +150,12 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      * @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")
@@ -196,7 +192,7 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T>
      * @return the size of the cache
      */
     @Override
-    public int getCacheSize() {
+    public int getIndexPageSize() {
         return fIndexPageSize;
     }
 
index f51f6822b374f187e5b8801e40935e28a154363c..758a884e2fdce30687f54db0ec56e2af501483a6 100644 (file)
@@ -90,7 +90,7 @@
          <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 &lt;samp&gt;TmfEvent&lt;/samp&gt; .
+                  The fully qualified name of a class that implements the &lt;samp&gt;ITmfEvent&lt;/samp&gt;  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>
index 3790a24b7b9270cdb9a3a4b841b0ed6101c2f8d0..2d94dbb360a0290b80488937060a510df2d79936 100644 (file)
@@ -34,7 +34,7 @@ import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
 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
@@ -44,15 +44,15 @@ public class CustomTxtTrace extends TmfTrace<CustomTxtEvent> {
         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
index 6bade33af351038e7bf42abb8fc13bfb69eb3d90..44abfb4e8950b89c5f6ac3812f20e2d1967165fb 100644 (file)
@@ -45,7 +45,7 @@ import org.xml.sax.SAXParseException;
 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
@@ -57,16 +57,16 @@ public class CustomXmlTrace extends TmfTrace<CustomXmlEvent> {
         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
index 7399f8ab8879ccfe28527c01b179af5f3cb6a8a1..87fdfb830acc8c7dcc4a24dd565985d8598ce9d3 100644 (file)
@@ -140,12 +140,12 @@ public class OpenExperimentHandler extends AbstractHandler {
                     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;
@@ -177,7 +177,7 @@ public class OpenExperimentHandler extends AbstractHandler {
                 } 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
index 96d0ee5ac0c423a8fcf0cc8dd3513ca3084a7720..69b6bba6ec051d148da536eee081e1e4c44ad1ea 100644 (file)
@@ -139,7 +139,7 @@ public class OpenTraceHandler extends AbstractHandler {
         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) {
@@ -199,7 +199,7 @@ public class OpenTraceHandler extends AbstractHandler {
         } 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);
index 2ad773c15de17b14c65973fe20d6fd38660888b4..0268dd547929e1cf76b6ee5b250882038b358a69 100644 (file)
@@ -136,11 +136,11 @@ public class EventsViewEditor extends TmfEditor {
                                     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);
@@ -167,12 +167,12 @@ public class EventsViewEditor extends TmfEditor {
                                 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);
@@ -194,7 +194,7 @@ public class EventsViewEditor extends TmfEditor {
                                 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) {
                             }
@@ -202,7 +202,7 @@ public class EventsViewEditor extends TmfEditor {
                                 ((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);
index acfe0d17daa600152ac9fde0654a8846b455d900..9d26d4bc444428713de75de713d5241f154b45b9 100644 (file)
@@ -130,17 +130,17 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                                     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
@@ -161,7 +161,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                                 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
@@ -184,7 +184,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                                 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
@@ -238,7 +238,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
             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
@@ -254,7 +254,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
         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
@@ -500,7 +500,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                             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
@@ -515,7 +515,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
             }\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
index f345f4d31bd70910d641b6fac0707110a297f50b..c7f8eb259edeabe27322637c0f3ca65e5067a520 100644 (file)
@@ -1062,7 +1062,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 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
@@ -1255,9 +1255,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             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
index 0d20170c43cb10f6fba26db9d68a3a5377d1627d..df749ae875becf811b42ccda57a37e9a403921de 100644 (file)
@@ -108,7 +108,7 @@ public class TmfEventsView extends TmfView {
         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()) {
index 2c27264ca904edd87430127f67accb471d407963..e48fe24deafa1b4b17a23642ed7ed19c0d1ad474 100644 (file)
@@ -195,7 +195,7 @@ public class TimeChartEvent implements ITimeEvent {
         }\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
index e105915b0f14307cabc265888b95d53c3aa4471c..3b0a377fcf53691528b78cad53469f0f8809099c 100644 (file)
@@ -196,7 +196,7 @@ public class TimeChartView extends TmfView implements ITmfTimeScaleSelectionList
                         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
@@ -411,7 +411,7 @@ public class TimeChartView extends TmfView implements ITmfTimeScaleSelectionList
                     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
This page took 0.044468 seconds and 5 git commands to generate.