ss: Move ownership of the SSID to the backend
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 26 Feb 2015 23:23:44 +0000 (18:23 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 3 Mar 2015 23:08:27 +0000 (18:08 -0500)
Since the backend is the "deepest" element in the
state-system-stack, we normally have to create it first. And
to avoid back-references, other elements do not have access
to those above them.

The concept of State System ID however can be useful for any
component in the stack. For this reason, it's more convenient
to save it in the backend, where all components can access it.

Change-Id: I5dab7e358eccf7dee52ac7e5d2f8400e130d5161
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/42858
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
15 files changed:
org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/StateSystemPushPopTest.java
org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/StateSystemUtilsTest.java
org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/InMemoryBackendTest.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/StateSystem.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/StateSystemFactory.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/IStateHistoryBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/InMemoryBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/NullBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/historytree/HistoryTreeBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java
org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/mipmap/TmfMipmapStateProviderTest.java
org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/mipmap/TmfMipmapStateProviderWeightedTest.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialStateSystem.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java

index a3fe97c81b1051af5398d92b9d956fb919d80ec0..b6e86cf32774f41081f1d6146deaf4b0d8ad2046 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -81,8 +81,8 @@ public class StateSystemPushPopTest {
         ITmfStateValue value;
         testHtFile = File.createTempFile("test", ".ht");
 
-        IStateHistoryBackend backend = new HistoryTreeBackend(testHtFile, 0, 0L);
-        ss = new StateSystem("push-pop-test", backend, true);
+        IStateHistoryBackend backend = new HistoryTreeBackend("push-pop-test", testHtFile, 0, 0L);
+        ss = new StateSystem(backend, true);
 
         /* Build the thing */
         final int attrib = ss.getQuarkAbsoluteAndAdd("Test", "stack");
index fe587e4212f04cd984082cea3bb26b4e14bfafd6..1d01a0e162d26e9dbdc557d61ea9ca02ddbd3fb6 100644 (file)
@@ -51,8 +51,8 @@ public class StateSystemUtilsTest {
     @Before
     public void setupStateSystem() {
         try {
-            IStateHistoryBackend backend = new InMemoryBackend(START_TIME);
-            fStateSystem = StateSystemFactory.newStateSystem(DUMMY_STRING, backend);
+            IStateHistoryBackend backend = new InMemoryBackend(DUMMY_STRING, START_TIME);
+            fStateSystem = StateSystemFactory.newStateSystem(backend);
             int quark = fStateSystem.getQuarkAbsoluteAndAdd(DUMMY_STRING);
 
             fStateSystem.modifyAttribute(1200L, TmfStateValue.newValueInt(10), quark);
index 03955ca97ed0a34ab25f60b581073e86e7024203..2e535b0ea1c4ee8c5d281bc6e8bc6e81196fe36b 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -42,7 +42,7 @@ public class InMemoryBackendTest {
      */
     @BeforeClass
     public static void init() {
-        fixture = new InMemoryBackend(0);
+        fixture = new InMemoryBackend("test-ss", 0);
         for (int attribute = 0; attribute < NUMBER_OF_ATTRIBUTES; attribute++) {
             for (int timeStart = 0; timeStart < 1000; timeStart++) {
                 try {
index e7d5f5448871cfd30e8a2a684e12cf0e608f1e17..b4d82d0ff47be18f899c893c828d59b03e1df5c2 100644 (file)
@@ -48,8 +48,6 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
  */
 public class StateSystem implements ITmfStateSystemBuilder {
 
-    private final String ssid;
-
     /* References to the inner structures */
     private final AttributeTree attributeTree;
     private final TransientState transState;
@@ -65,13 +63,10 @@ public class StateSystem implements ITmfStateSystemBuilder {
      * New-file constructor. For when you build a state system with a new file,
      * or if the back-end does not require a file on disk.
      *
-     * @param ssid
-     *            The ID of this statesystem. It should be unique.
      * @param backend
      *            Back-end plugin to use
      */
-    public StateSystem(@NonNull String ssid, @NonNull IStateHistoryBackend backend) {
-        this.ssid = ssid;
+    public StateSystem(@NonNull IStateHistoryBackend backend) {
         this.backend = backend;
         this.transState = new TransientState(backend);
         this.attributeTree = new AttributeTree(this);
@@ -80,8 +75,6 @@ public class StateSystem implements ITmfStateSystemBuilder {
     /**
      * General constructor
      *
-     * @param ssid
-     *            The ID of this statesystem. It should be unique.
      * @param backend
      *            The "state history storage" back-end to use.
      * @param newFile
@@ -90,9 +83,8 @@ public class StateSystem implements ITmfStateSystemBuilder {
      * @throws IOException
      *             If there was a problem creating the new history file
      */
-    public StateSystem(@NonNull String ssid, @NonNull IStateHistoryBackend backend, boolean newFile)
+    public StateSystem(@NonNull IStateHistoryBackend backend, boolean newFile)
             throws IOException {
-        this.ssid = ssid;
         this.backend = backend;
         this.transState = new TransientState(backend);
 
@@ -108,7 +100,7 @@ public class StateSystem implements ITmfStateSystemBuilder {
 
     @Override
     public String getSSID() {
-        return ssid;
+        return backend.getSSID();
     }
 
     @Override
index 4a51c9a09c084d3cbaa0cf0aab6f9bb90e8676b8..230b564557d8e38020bf4bda1d341102e09936fe 100644 (file)
@@ -37,23 +37,18 @@ public final class StateSystemFactory {
      * New-file factory method. For when you build a state system with a new
      * file, or if the back-end does not require a file on disk.
      *
-     * @param id
-     *            The ID of this statesystem. It should be unique.
      * @param backend
      *            Back-end plugin to use
      * @return The new state system
      */
-   public static ITmfStateSystemBuilder newStateSystem(String id,
-           IStateHistoryBackend backend) {
-       return new StateSystem(id, backend);
+   public static ITmfStateSystemBuilder newStateSystem(IStateHistoryBackend backend) {
+       return new StateSystem(backend);
    }
 
     /**
      * General factory method. The backend may try to open or create a file on
      * disk (the file contents and location are defined by the backend).
      *
-     * @param id
-     *            The ID of this statesystem. It should be unique.
      * @param backend
      *            The "state history storage" back-end to use.
      * @param newFile
@@ -63,9 +58,9 @@ public final class StateSystemFactory {
      * @throws IOException
      *             If there was a problem creating the new history file
      */
-    public static ITmfStateSystemBuilder newStateSystem(String id,
-            IStateHistoryBackend backend, boolean newFile) throws IOException {
-        return new StateSystem(id, backend, newFile);
+    public static ITmfStateSystemBuilder newStateSystem(IStateHistoryBackend backend,
+            boolean newFile) throws IOException {
+        return new StateSystem(backend, newFile);
     }
 
 }
index a960b3a022832e5a9dc5e418a66206fcdaa10716..07b75d86d8915f89abe0c6b6b95c9a5657986cd4 100644 (file)
@@ -40,6 +40,13 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
  */
 public interface IStateHistoryBackend {
 
+    /**
+     * Get the ID of the state system that populates this backend.
+     *
+     * @return The state system's ID.
+     */
+    @NonNull String getSSID();
+
     /**
      * Get the start time of this state history. This is usually the same as the
      * start time of the originating trace.
index 6a9cdd41387c20af630394a93c9b4c6b4688ab5f..ad60a304c5c8b30b324b7ec1ae236ad74be6595f 100644 (file)
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
 import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
@@ -71,22 +72,32 @@ public class InMemoryBackend implements IStateHistoryBackend {
 
             };
 
+    private final @NonNull String ssid;
     private final TreeSet<ITmfStateInterval> intervals;
     private final long startTime;
+
     private volatile long latestTime;
 
     /**
      * Constructor
      *
+     * @param ssid
+     *            The state system's ID
      * @param startTime
      *            The start time of this interval store
      */
-    public InMemoryBackend(long startTime) {
+    public InMemoryBackend(@NonNull String ssid, long startTime) {
+        this.ssid = ssid;
         this.startTime = startTime;
         this.latestTime = startTime;
         this.intervals = new TreeSet<>(END_COMPARATOR);
     }
 
+    @Override
+    public String getSSID() {
+        return ssid;
+    }
+
     @Override
     public long getStartTime() {
         return startTime;
index 09cc35a6e93b77f90c6ff2493dfed8d47c5c015b..38d749276c4ff56cb9940bab522650f3606ea090 100644 (file)
@@ -17,6 +17,7 @@ import java.io.FileInputStream;
 import java.io.PrintWriter;
 import java.util.List;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
 
@@ -31,10 +32,22 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
  */
 public class NullBackend implements IStateHistoryBackend {
 
+    private final @NonNull String ssid;
+
     /**
      * Constructor
+     *
+     * @param ssid
+     *            The state system's id
      */
-    public NullBackend() {}
+    public NullBackend(@NonNull String ssid) {
+        this.ssid = ssid;
+    }
+
+    @Override
+    public String getSSID() {
+        return ssid;
+    }
 
     @Override
     public long getStartTime() {
index 4eadece7dfaada35b0cd8d7ddad71c61497ca076..9b406ef49818da6e3d23db8f53f50e6bafa6cdae 100644 (file)
@@ -19,6 +19,7 @@ import java.io.PrintWriter;
 import java.nio.channels.ClosedChannelException;
 import java.util.List;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.CoreNode;
 import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTConfig;
 import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTInterval;
@@ -40,6 +41,8 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
  */
 public class HistoryTreeBackend implements IStateHistoryBackend {
 
+    private final @NonNull String ssid;
+
     /**
      * The history tree that sits underneath.
      */
@@ -71,6 +74,8 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      * Constructor for new history files. Use this when creating a new history
      * from scratch.
      *
+     * @param ssid
+     *            The state system's ID
      * @param newStateFile
      *            The filename/location where to store the state history (Should
      *            end in .ht)
@@ -88,8 +93,9 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      * @throws IOException
      *             Thrown if we can't create the file for some reason
      */
-    public HistoryTreeBackend(File newStateFile, int blockSize,
+    public HistoryTreeBackend(@NonNull String ssid, File newStateFile, int blockSize,
             int maxChildren, int providerVersion, long startTime) throws IOException {
+        this.ssid = ssid;
         final HTConfig conf = new HTConfig(newStateFile, blockSize, maxChildren,
                 providerVersion, startTime);
         sht = new HistoryTree(conf);
@@ -100,6 +106,8 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      * from scratch. This version supplies sane defaults for the configuration
      * parameters.
      *
+     * @param ssid
+     *            The state system's id
      * @param newStateFile
      *            The filename/location where to store the state history (Should
      *            end in .ht)
@@ -112,14 +120,16 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      * @throws IOException
      *             Thrown if we can't create the file for some reason
      */
-    public HistoryTreeBackend(File newStateFile, int providerVersion, long startTime)
+    public HistoryTreeBackend(@NonNull String ssid, File newStateFile, int providerVersion, long startTime)
             throws IOException {
-        this(newStateFile, 64 * 1024, 50, providerVersion, startTime);
+        this(ssid, newStateFile, 64 * 1024, 50, providerVersion, startTime);
     }
 
     /**
      * Existing history constructor. Use this to open an existing state-file.
      *
+     * @param ssid
+     *            The state system's id
      * @param existingStateFile
      *            Filename/location of the history we want to load
      * @param providerVersion
@@ -129,8 +139,9 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      *             recognized, or if the version of the file does not match the
      *             expected providerVersion.
      */
-    public HistoryTreeBackend(File existingStateFile, int providerVersion)
+    public HistoryTreeBackend(@NonNull String ssid, File existingStateFile, int providerVersion)
             throws IOException {
+        this.ssid = ssid;
         sht = new HistoryTree(existingStateFile, providerVersion);
         fFinishedBuilding = true;
     }
@@ -144,6 +155,11 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
         return sht;
     }
 
+    @Override
+    public String getSSID() {
+        return ssid;
+    }
+
     @Override
     public long getStartTime() {
         return sht.getTreeStart();
index faf4802df362dcd589ac3dcbfbef6d553b3ae470..0b05592587b8913f3d329a1ec5509c14ef95bd69 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,8 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
  *******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core.backend.historytree;
@@ -46,6 +48,8 @@ public final class ThreadedHistoryTreeBackend extends HistoryTreeBackend
      * Note that it usually doesn't make sense to use a Threaded HT if you're
      * opening an existing state-file, but you know what you're doing...
      *
+     * @param ssid
+     *            The state system's id
      * @param newStateFile
      *            The name of the history file that will be created. Should end
      *            in ".ht"
@@ -65,10 +69,10 @@ public final class ThreadedHistoryTreeBackend extends HistoryTreeBackend
      * @throws IOException
      *             If there was a problem opening the history file for writing
      */
-    public ThreadedHistoryTreeBackend(File newStateFile, int blockSize,
+    public ThreadedHistoryTreeBackend(@NonNull String ssid, File newStateFile, int blockSize,
             int maxChildren, long startTime, int providerVersion, int queueSize)
             throws IOException {
-        super(newStateFile, blockSize, maxChildren, providerVersion, startTime);
+        super(ssid, newStateFile, blockSize, maxChildren, providerVersion, startTime);
 
         intervalQueue = new ArrayBlockingQueue<>(queueSize);
         shtThread = new Thread(this, "History Tree Thread"); //$NON-NLS-1$
@@ -79,6 +83,8 @@ public final class ThreadedHistoryTreeBackend extends HistoryTreeBackend
      * New State History constructor. This version provides default values for
      * blockSize and maxChildren.
      *
+     * @param ssid
+     *            The state system's id
      * @param newStateFile
      *            The name of the history file that will be created. Should end
      *            in ".ht"
@@ -94,9 +100,9 @@ public final class ThreadedHistoryTreeBackend extends HistoryTreeBackend
      * @throws IOException
      *             If there was a problem opening the history file for writing
      */
-    public ThreadedHistoryTreeBackend(File newStateFile, long startTime,
+    public ThreadedHistoryTreeBackend(@NonNull String ssid, File newStateFile, long startTime,
             int providerVersion, int queueSize) throws IOException {
-        super(newStateFile, providerVersion, startTime);
+        super(ssid, newStateFile, providerVersion, startTime);
 
         intervalQueue = new ArrayBlockingQueue<>(queueSize);
         shtThread = new Thread(this, "History Tree Thread"); //$NON-NLS-1$
index 141d6a2b3877aaf9b9345d62a90836f263b5f980..a84b853cf690584140db99003f0a4537542b5b08 100644 (file)
@@ -62,8 +62,8 @@ public class TmfMipmapStateProviderTest {
     @BeforeClass
     public static void init() {
         TmfMipmapStateProviderStub mmp = new TmfMipmapStateProviderStub(RESOLUTION, Type.LONG);
-        IStateHistoryBackend be = new InMemoryBackend(0);
-        ITmfStateSystemBuilder ssb = StateSystemFactory.newStateSystem(SSID, be);
+        IStateHistoryBackend be = new InMemoryBackend(SSID, 0);
+        ITmfStateSystemBuilder ssb = StateSystemFactory.newStateSystem(be);
         mmp.assignTargetStateSystem(ssb);
         ssq = ssb;
 
index 1fcc66661c9f8e34a6b83b18d3847beeaf959b40..075df01358e7f908671c3bc9d3b6e195da31480c 100644 (file)
@@ -52,14 +52,14 @@ public class TmfMipmapStateProviderWeightedTest {
     public static void init() {
         /* setup for INTEGER test */
         TmfMipmapStateProviderStub mmpi = new TmfMipmapStateProviderStub(RESOLUTION, Type.INTEGER);
-        IStateHistoryBackend bei = new InMemoryBackend(0);
-        ITmfStateSystemBuilder ssbi = StateSystemFactory.newStateSystem(SSID, bei);
+        IStateHistoryBackend bei = new InMemoryBackend(SSID, 0);
+        ITmfStateSystemBuilder ssbi = StateSystemFactory.newStateSystem(bei);
         mmpi.assignTargetStateSystem(ssbi);
         ssqi = ssbi;
         /* setup for DOUBLE test */
         TmfMipmapStateProviderStub mmpd = new TmfMipmapStateProviderStub(RESOLUTION, Type.DOUBLE);
-        IStateHistoryBackend bed = new InMemoryBackend(0);
-        ITmfStateSystemBuilder ssbd = StateSystemFactory.newStateSystem(SSID, bed);
+        IStateHistoryBackend bed = new InMemoryBackend(SSID, 0);
+        ITmfStateSystemBuilder ssbd = StateSystemFactory.newStateSystem(bed);
         mmpd.assignTargetStateSystem(ssbd);
         ssqd = ssbd;
         /*
index f06e3ec2be12c97c4d6228f03cefa1d19cb79e5b..869c0e759b0e54c180b7b4c95041bf82ae2f9eca 100644 (file)
@@ -56,6 +56,8 @@ import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
  */
 public class PartialHistoryBackend implements IStateHistoryBackend {
 
+    private final @NonNull String fSSID;
+
     /**
      * A partial history needs the state input plugin to re-generate state
      * between checkpoints.
@@ -84,6 +86,8 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
     /**
      * Constructor
      *
+     * @param ssid
+     *            The state system's ID
      * @param partialInput
      *            The state change input object that was used to build the
      *            upstream state system. This partial history will make its own
@@ -98,8 +102,11 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
      *            Configuration parameter indicating how many trace events there
      *            should be between each checkpoint
      */
-    public PartialHistoryBackend(ITmfStateProvider partialInput, PartialStateSystem pss,
-            IStateHistoryBackend realBackend, long granularity) {
+    public PartialHistoryBackend(@NonNull String ssid,
+            ITmfStateProvider partialInput,
+            PartialStateSystem pss,
+            IStateHistoryBackend realBackend,
+            long granularity) {
         if (granularity <= 0 || partialInput == null || pss == null ||
                 partialInput.getAssignedStateSystem() != pss) {
             throw new IllegalArgumentException();
@@ -107,6 +114,7 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
 
         final long startTime = realBackend.getStartTime();
 
+        fSSID = ssid;
         fPartialInput = partialInput;
         fPartialSS = pss;
 
@@ -124,6 +132,11 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
         /* The request will countDown the checkpoints latch once it's finished */
     }
 
+    @Override
+    public String getSSID() {
+        return fSSID;
+    }
+
     @Override
     public long getStartTime() {
         return fInnerHistory.getStartTime();
index beff3d61e058a0c34f2bf546418fd12b37e3f8fb..2768c6b2c9758a7e444356ff13713be545321c6d 100644 (file)
@@ -54,7 +54,7 @@ public class PartialStateSystem extends StateSystem {
          * We use a Null back end here : we only use this state system for its
          * "ongoing" values, so no need to save the changes that are inserted.
          */
-        super("partial", new NullBackend()); //$NON-NLS-1$
+        super(new NullBackend("partial")); //$NON-NLS-1$
     }
 
     /**
index 2715563605b5aeee14c4d7c86e6549fad6d256af..d3ee563d772bed06861969950ccc3e7937fe8d8c 100644 (file)
@@ -254,9 +254,9 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
            /* Load an existing history */
             final int version = provider.getVersion();
             try {
-                IStateHistoryBackend backend = new HistoryTreeBackend(htFile, version);
+                IStateHistoryBackend backend = new HistoryTreeBackend(id, htFile, version);
                 fHtBackend = backend;
-                fStateSystem = StateSystemFactory.newStateSystem(id, backend, false);
+                fStateSystem = StateSystemFactory.newStateSystem(backend, false);
                 fInitialized.countDown();
                 return;
             } catch (IOException e) {
@@ -272,10 +272,10 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         final int QUEUE_SIZE = 10000;
 
         try {
-            IStateHistoryBackend backend = new ThreadedHistoryTreeBackend(htFile,
+            IStateHistoryBackend backend = new ThreadedHistoryTreeBackend(id, htFile,
                     provider.getStartTime(), provider.getVersion(), QUEUE_SIZE);
             fHtBackend = backend;
-            fStateSystem = StateSystemFactory.newStateSystem(id, backend);
+            fStateSystem = StateSystemFactory.newStateSystem(backend);
             provider.assignTargetStateSystem(fStateSystem);
             build(provider);
         } catch (IOException e) {
@@ -325,7 +325,7 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         /* 2 */
         IStateHistoryBackend realBackend = null;
         try {
-            realBackend = new ThreadedHistoryTreeBackend(htPartialFile,
+            realBackend = new ThreadedHistoryTreeBackend(id, htPartialFile,
                     provider.getStartTime(), provider.getVersion(), QUEUE_SIZE);
         } catch (IOException e) {
             throw new TmfTraceException(e.toString(), e);
@@ -341,13 +341,14 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         partialProvider.assignTargetStateSystem(pss);
 
         /* 3 */
+        String partialId = new String(id + ".partial"); //$NON-NLS-1$
         IStateHistoryBackend partialBackend =
-                new PartialHistoryBackend(partialProvider, pss, realBackend, granularity);
+                new PartialHistoryBackend(partialId, partialProvider, pss, realBackend, granularity);
 
         /* 4 */
         @SuppressWarnings("restriction")
         org.eclipse.tracecompass.internal.statesystem.core.StateSystem realSS =
-        (org.eclipse.tracecompass.internal.statesystem.core.StateSystem) StateSystemFactory.newStateSystem(id, partialBackend);
+        (org.eclipse.tracecompass.internal.statesystem.core.StateSystem) StateSystemFactory.newStateSystem(partialBackend);
 
         /* 5 */
         pss.assignUpstream(realSS);
@@ -368,9 +369,9 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
      * {@link ITmfStateSystem#queryOngoingState} will be available.
      */
     private void createNullHistory(String id, ITmfStateProvider provider) {
-        IStateHistoryBackend backend = new NullBackend();
+        IStateHistoryBackend backend = new NullBackend(id);
         fHtBackend = backend;
-        fStateSystem = StateSystemFactory.newStateSystem(id, backend);
+        fStateSystem = StateSystemFactory.newStateSystem(backend);
         provider.assignTargetStateSystem(fStateSystem);
         build(provider);
     }
@@ -381,9 +382,9 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
      * to 2^31 intervals.
      */
     private void createInMemoryHistory(String id, ITmfStateProvider provider) {
-        IStateHistoryBackend backend = new InMemoryBackend(provider.getStartTime());
+        IStateHistoryBackend backend = new InMemoryBackend(id, provider.getStartTime());
         fHtBackend = backend;
-        fStateSystem = StateSystemFactory.newStateSystem(id, backend);
+        fStateSystem = StateSystemFactory.newStateSystem(backend);
         provider.assignTargetStateSystem(fStateSystem);
         build(provider);
     }
This page took 0.037497 seconds and 5 git commands to generate.