tmf: API fix for the state system queries
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 15 May 2012 18:12:59 +0000 (14:12 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 15 May 2012 18:12:59 +0000 (14:12 -0400)
Wanted to get this in before the API freezes...
Rename loadStateAtTime() -> queryFullState(). Originally this
would simply seek an inner vector to the given location, now
it actually returns that vector. It's more in line with the
other query*() methods.

Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/IStateSystemQuerier.java

index 91d3a4f6c44468ded37ee9358804a3c67474cc07..5be1ad22c813dce90ee16cd128205203d1c45e86 100644 (file)
@@ -128,7 +128,7 @@ public class StateSystemFullHistoryTest {
         int quark, valueInt;
         String valueStr;
 
-        list = ssb.loadStateAtTime(interestingTimestamp1);
+        list = ssb.queryFullState(interestingTimestamp1);
 
         quark = ssb.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD);
         interval = list.get(quark);
@@ -248,14 +248,14 @@ public class StateSystemFullHistoryTest {
     @Test(expected = TimeRangeException.class)
     public void testFullQueryInvalidTime1() throws TimeRangeException {
         long ts = CtfTestFiles.startTime + 20L * CtfTestFiles.NANOSECS_PER_SEC;
-        ssb.loadStateAtTime(ts);
+        ssb.queryFullState(ts);
 
     }
 
     @Test(expected = TimeRangeException.class)
     public void testFullQueryInvalidTime2() throws TimeRangeException {
         long ts = CtfTestFiles.startTime - 20L * CtfTestFiles.NANOSECS_PER_SEC;
-        ssb.loadStateAtTime(ts);
+        ssb.queryFullState(ts);
 
     }
 
@@ -324,7 +324,7 @@ public class StateSystemFullHistoryTest {
         ITmfStateInterval interval;
         int quark;
 
-        list = ssb.loadStateAtTime(interestingTimestamp1);
+        list = ssb.queryFullState(interestingTimestamp1);
         quark = ssb.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD);
         interval = list.get(quark);
 
@@ -339,7 +339,7 @@ public class StateSystemFullHistoryTest {
         ITmfStateInterval interval;
         int quark;
 
-        list = ssb.loadStateAtTime(interestingTimestamp1);
+        list = ssb.queryFullState(interestingTimestamp1);
         quark = ssb.getQuarkAbsolute(Attributes.THREADS, "1432", Attributes.EXEC_NAME);
         interval = list.get(quark);
 
index 9fc11e715d8c4d50dbccf26777823ae9121fae17..133cae70b6c65e206f16e45fc65fbe9432d97692 100644 (file)
@@ -116,7 +116,7 @@ public class StateHistorySystem extends StateSystem implements
      */
 
     @Override
-    public synchronized List<ITmfStateInterval> loadStateAtTime(long t)
+    public synchronized List<ITmfStateInterval> queryFullState(long t)
             throws TimeRangeException {
         List<ITmfStateInterval> stateInfo = new ArrayList<ITmfStateInterval>(
                 attributeTree.getNbAttributes());
index 970d3b5cb1f1f327926d83da428021409f441e00..3261caef0fddbdef9c9f0895a4245e8b853bc445 100644 (file)
@@ -193,18 +193,18 @@ public interface IStateSystemQuerier {
      *             If the 't' parameter is outside of the range of the state
      *             history.
      */
-    public List<ITmfStateInterval> loadStateAtTime(long t)
+    public List<ITmfStateInterval> queryFullState(long t)
             throws TimeRangeException;
 
     /**
      * Singular query method. This one does not update the whole stateInfo
-     * vector, like loadStateAtTimes() does. It only searches for one specific
+     * vector, like queryFullState() does. It only searches for one specific
      * entry in the state history.
      * 
      * It should be used when you only want very few entries, instead of the
      * whole state (or many entries, but all at different timestamps). If you do
      * request many entries all at the same time, you should use the
-     * conventional loadStateAtTime() + List.get() method.
+     * conventional queryFullState() + List.get() method.
      * 
      * @param t
      *            The timestamp at which we want the state
@@ -224,9 +224,9 @@ public interface IStateSystemQuerier {
      * attribute between timestamps t1 and t2. The list will be ordered by
      * ascending time.
      * 
-     * Note that contrary to loadStateAtTime(), the returned list here is in the
+     * Note that contrary to queryFullState(), the returned list here is in the
      * "direction" of time (and not in the direction of attributes, as is the
-     * case with loadStateAtTime()).
+     * case with queryFullState()).
      * 
      * @param attributeQuark
      *            Which attribute this query is interested in
This page took 0.032282 seconds and 5 git commands to generate.