From 0fe46f2ae7d93ed9b5421330229666a334a5a6b9 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Fri, 26 Apr 2013 17:49:26 -0400 Subject: [PATCH] tmf: Rename IStateChangeInput to ITmfStateProvider The nomenclature "state provider" was being used more and more instead of "state change input", so clarify this before the Kepler API freeze and use "state provider" everywhere. It just sounds better anyway. Change-Id: I88fbc4f8f867754fef41dc35b99a823dbea3683c Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/12259 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann IP-Clean: Bernd Hufmann Tested-by: Bernd Hufmann --- .../headless/BasicStateSystemExample.java | 6 +- .../tests/headless/GenerateTestValues.java | 6 +- ...t.java => CtfKernelStateProviderTest.java} | 12 +-- .../stateprovider/PartialStateSystemTest.java | 4 +- .../StateSystemFullHistoryTest.java | 8 +- .../StateSystemInMemoryTest.java | 4 +- .../tests/stateprovider/StateSystemTest.java | 4 +- .../core/tests/stateprovider/TestAll.java | 2 +- ...Input.java => CtfKernelStateProvider.java} | 10 +-- .../kernel/core/trace/CtfKernelTrace.java | 6 +- .../tests/statesystem/VerifyHistoryFile.java | 4 +- .../tmf/core/statesystem/HistoryBuilder.java | 44 +++++------ .../backends/historytree/HistoryTree.java | 4 +- .../partial/PartialHistoryBackend.java | 18 ++--- .../callstack/CallStackStateProvider.java | 4 +- ...put.java => AbstractTmfStateProvider.java} | 4 +- ...hangeInput.java => ITmfStateProvider.java} | 6 +- .../core/statesystem/StateSystemManager.java | 77 ++++++++++--------- .../core/statistics/StatsStateProvider.java | 4 +- .../core/statistics/TmfStateStatistics.java | 6 +- 20 files changed, 117 insertions(+), 116 deletions(-) rename org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/{CtfKernelStateInputTest.java => CtfKernelStateProviderTest.java} (81%) rename org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/{CtfKernelStateInput.java => CtfKernelStateProvider.java} (98%) rename org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/{AbstractStateChangeInput.java => AbstractTmfStateProvider.java} (98%) rename org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/{IStateChangeInput.java => ITmfStateProvider.java} (97%) diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/BasicStateSystemExample.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/BasicStateSystemExample.java index d493889786..6c1e56d027 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/BasicStateSystemExample.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/BasicStateSystemExample.java @@ -16,14 +16,14 @@ import java.io.File; import java.util.List; import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException; import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException; import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; import org.eclipse.linuxtools.tmf.core.tests.shared.CtfTmfTestTraces; @@ -43,7 +43,7 @@ public class BasicStateSystemExample { /* Read a trace and build the state system */ try { File newStateFile = new File("/tmp/helloworldctf.ht"); - IStateChangeInput input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(1)); + ITmfStateProvider input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(1)); ITmfStateSystem ss = StateSystemManager.loadStateHistory(newStateFile, input, true); requestExample(ss); diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/GenerateTestValues.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/GenerateTestValues.java index a280a9ffcc..c22fbeea08 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/GenerateTestValues.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/headless/GenerateTestValues.java @@ -17,9 +17,9 @@ import java.io.FileWriter; import java.io.PrintWriter; import java.util.List; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; @@ -61,7 +61,7 @@ public class GenerateTestValues { PrintWriter writer = new PrintWriter(new FileWriter(logFile), true); /* Build and query the state system */ - IStateChangeInput input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + ITmfStateProvider input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); ITmfStateSystem ssq = StateSystemManager.loadStateHistory(stateFile, input, true); List fullState = ssq.queryFullState(targetTimestamp); diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateInputTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateProviderTest.java similarity index 81% rename from org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateInputTest.java rename to org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateProviderTest.java index 0edeb615f8..fc0d63d42e 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateInputTest.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CtfKernelStateProviderTest.java @@ -15,22 +15,22 @@ package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; import static org.junit.Assert.assertEquals; import static org.junit.Assume.assumeTrue; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.tests.shared.CtfTmfTestTraces; import org.junit.BeforeClass; import org.junit.Test; /** - * Tests for the LTTng 2.0 kernel state provider + * Tests for the {@link CtfKernelStateProvider} * * @author Alexandre Montplaisir */ -public class CtfKernelStateInputTest { +public class CtfKernelStateProviderTest { private final static int TRACE_INDEX = 1; - private static IStateChangeInput input; + private static ITmfStateProvider input; /** * Set-up. @@ -38,7 +38,7 @@ public class CtfKernelStateInputTest { @BeforeClass public static void initialize() { assumeTrue(CtfTmfTestTraces.tracesExist()); - input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); } diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java index 04847032ba..7627b08f42 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/PartialStateSystemTest.java @@ -16,7 +16,7 @@ import static org.junit.Assume.assumeTrue; import java.io.File; import java.io.IOException; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; @@ -42,7 +42,7 @@ public class PartialStateSystemTest extends StateSystemTest { stateFile = File.createTempFile("test-partial", ".ht"); stateFile.deleteOnExit(); - input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); ssq = StateSystemManager.newPartialHistory(stateFile, input, true); } catch (IOException e) { e.printStackTrace(); diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java index b5c007097e..dd3f2418e3 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java @@ -20,9 +20,9 @@ import static org.junit.Assume.assumeTrue; import java.io.File; import java.io.IOException; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; import org.eclipse.linuxtools.tmf.core.tests.shared.CtfTmfTestTraces; @@ -50,7 +50,7 @@ public class StateSystemFullHistoryTest extends StateSystemTest { stateFile = File.createTempFile("test", ".ht"); stateFileBenchmark = File.createTempFile("test", ".ht.benchmark"); - input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); ssq = StateSystemManager.loadStateHistory(stateFile, input, true); } catch (IOException e) { e.printStackTrace(); @@ -73,7 +73,7 @@ public class StateSystemFullHistoryTest extends StateSystemTest { @Test public void testBuild() { try { - IStateChangeInput input2 = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + ITmfStateProvider input2 = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); ITmfStateSystem ssb2 = StateSystemManager.loadStateHistory(stateFileBenchmark, input2, true); assertEquals(startTime, ssb2.getStartTime()); diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java index d909d35426..e10636b6fd 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemInMemoryTest.java @@ -14,7 +14,7 @@ package org.eclipse.linuxtools.lttng2.kernel.core.tests.stateprovider; import static org.junit.Assume.assumeTrue; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; import org.eclipse.linuxtools.tmf.core.tests.shared.CtfTmfTestTraces; import org.junit.BeforeClass; @@ -32,7 +32,7 @@ public class StateSystemInMemoryTest extends StateSystemTest { @BeforeClass public static void initialize() { assumeTrue(CtfTmfTestTraces.tracesExist()); - input = new CtfKernelStateInput(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); + input = new CtfKernelStateProvider(CtfTmfTestTraces.getTestTrace(TRACE_INDEX)); ssq = StateSystemManager.newInMemHistory(input, true); } } diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java index 278342a2fe..b9ddedd4fa 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java @@ -24,7 +24,7 @@ import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException; import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; import org.junit.Test; @@ -50,7 +50,7 @@ public abstract class StateSystemTest { /** Number of nanoseconds in one second */ private static final long NANOSECS_PER_SEC = 1000000000L; - protected static IStateChangeInput input; + protected static ITmfStateProvider input; protected static ITmfStateSystem ssq; /* Offset in the trace + start time of the trace */ diff --git a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java index 43896b150e..4cbffa917e 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/TestAll.java @@ -20,7 +20,7 @@ import org.junit.runners.Suite; */ @RunWith(Suite.class) @Suite.SuiteClasses({ - CtfKernelStateInputTest.class, + CtfKernelStateProviderTest.class, PartialStateSystemTest.class, StateSystemFullHistoryTest.class, StateSystemInMemoryTest.class diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateProvider.java similarity index 98% rename from org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java rename to org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateProvider.java index d57cbdc137..77c80654bb 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateProvider.java @@ -24,7 +24,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException; import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystemBuilder; import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; import org.eclipse.linuxtools.tmf.core.statevalue.TmfStateValue; @@ -38,7 +38,7 @@ import org.eclipse.linuxtools.tmf.core.statevalue.TmfStateValue; * @author alexmont * */ -public class CtfKernelStateInput extends AbstractStateChangeInput { +public class CtfKernelStateProvider extends AbstractTmfStateProvider { /** * Version number of this state provider. Please bump this if you modify the @@ -59,7 +59,7 @@ public class CtfKernelStateInput extends AbstractStateChangeInput { * @param trace * The LTTng 2.0 kernel trace directory */ - public CtfKernelStateInput(CtfTmfTrace trace) { + public CtfKernelStateProvider(CtfTmfTrace trace) { super(trace, CtfTmfEvent.class, "LTTng Kernel"); //$NON-NLS-1$ knownEventNames = fillEventNames(); } @@ -80,8 +80,8 @@ public class CtfKernelStateInput extends AbstractStateChangeInput { } @Override - public CtfKernelStateInput getNewInstance() { - return new CtfKernelStateInput((CtfTmfTrace) this.getTrace()); + public CtfKernelStateProvider getNewInstance() { + return new CtfKernelStateProvider((CtfTmfTrace) this.getTrace()); } @Override diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java index 072eef0ed3..8e1414d2c5 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java @@ -23,11 +23,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException; import org.eclipse.linuxtools.ctf.core.trace.CTFTrace; import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator; -import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput; +import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateProvider; import org.eclipse.linuxtools.tmf.core.TmfCommonConstants; import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace; import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; @@ -105,7 +105,7 @@ public class CtfKernelTrace extends CtfTmfTrace { } final File htFile = new File(supplDirectory + File.separator + HISTORY_TREE_FILE_NAME); - final IStateChangeInput htInput = new CtfKernelStateInput(this); + final ITmfStateProvider htInput = new CtfKernelStateProvider(this); ITmfStateSystem ss = StateSystemManager.loadStateHistory(htFile, htInput, false); fStateSystems.put(STATE_ID, ss); diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/statesystem/VerifyHistoryFile.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/statesystem/VerifyHistoryFile.java index b65cd3e88b..d3ae77139f 100644 --- a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/statesystem/VerifyHistoryFile.java +++ b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/statesystem/VerifyHistoryFile.java @@ -23,7 +23,7 @@ import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException; import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; /** @@ -51,7 +51,7 @@ public class VerifyHistoryFile { TimeRangeException, AttributeNotFoundException, StateSystemDisposedException { htFile = new File(pathToHistoryFile); - htBackend = new HistoryTreeBackend(htFile, IStateChangeInput.IGNORE_PROVIDER_VERSION); + htBackend = new HistoryTreeBackend(htFile, ITmfStateProvider.IGNORE_PROVIDER_VERSION); ss = HistoryBuilder.openExistingHistory(htBackend); startTime = ss.getStartTime(); diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java index d0c4543211..ec6e27a8cc 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java @@ -24,14 +24,14 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler; import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal; import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystemBuilder; import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; /** - * This is the high-level wrapper around the State History and its input and + * This is the high-level wrapper around the State History and its provider and * storage plugins. Just create the object using the constructor then .run() * * You can use one HistoryBuilder and it will instantiate everything underneath. @@ -43,20 +43,20 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; */ public class HistoryBuilder extends TmfComponent { - private final IStateChangeInput sci; + private final ITmfStateProvider sp; private final StateSystem ss; private final IStateHistoryBackend hb; private boolean started = true; /* Don't handle signals until we're ready */ /** - * Instantiate a new HistoryBuilder helper. The input -> ss -> backend + * Instantiate a new HistoryBuilder helper. The provider -> ss -> backend * relationships should have been set up already. * - * @param stateChangeInput - * The input plugin to use + * @param stateProvider + * The state provider plugin to use * @param ss * The state system object that will receive the state changes - * from the input + * from the provider * @param backend * The back-end storage to use, which will receive the intervals * from the ss @@ -66,17 +66,17 @@ public class HistoryBuilder extends TmfComponent { * construction is done. False (out-of-band) means we will start * listening for the signal and return immediately. */ - public HistoryBuilder(IStateChangeInput stateChangeInput, StateSystem ss, + public HistoryBuilder(ITmfStateProvider stateProvider, StateSystem ss, IStateHistoryBackend backend, boolean buildManually) { - if (stateChangeInput == null || backend == null || ss == null) { + if (stateProvider == null || backend == null || ss == null) { throw new IllegalArgumentException(); } - if (stateChangeInput.getAssignedStateSystem() != ss) { - /* Logic check to make sure the input is setup properly */ + if (stateProvider.getAssignedStateSystem() != ss) { + /* Logic check to make sure the provider is setup properly */ throw new RuntimeException(); } - sci = stateChangeInput; + sp = stateProvider; hb = backend; this.ss = ss; @@ -134,7 +134,7 @@ public class HistoryBuilder extends TmfComponent { /* Send the request to the trace here, since there is probably no * experiment. */ - sci.getTrace().sendRequest(request); + sp.getTrace().sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { @@ -165,7 +165,7 @@ public class HistoryBuilder extends TmfComponent { ITmfTrace sender = signal.getTrace(); ITmfTrace target = null; for (ITmfTrace trace : sender.getTraces()) { - if (trace == sci.getTrace()) { + if (trace == sp.getTrace()) { target = trace; break; } @@ -196,7 +196,7 @@ public class HistoryBuilder extends TmfComponent { */ boolean found = false; for (ITmfTrace trace : signal.getTrace().getTraces()) { - if (trace == sci.getTrace()) { + if (trace == sp.getTrace()) { found = true; break; } @@ -211,13 +211,13 @@ public class HistoryBuilder extends TmfComponent { // Methods reserved for the request object below // ------------------------------------------------------------------------ - /** Get the input plugin object */ - IStateChangeInput getInputPlugin() { - return sci; + /** Get the state provider object */ + ITmfStateProvider getStateProvider() { + return sp; } void close(boolean deleteFiles) { - sci.dispose(); + sp.dispose(); if (deleteFiles) { hb.removeFiles(); } @@ -231,17 +231,17 @@ class StateSystemBuildRequest extends TmfEventRequest { private final static int chunkSize = 50000; private final HistoryBuilder builder; - private final IStateChangeInput sci; + private final ITmfStateProvider sci; private final ITmfTrace trace; StateSystemBuildRequest(HistoryBuilder builder) { - super(builder.getInputPlugin().getExpectedEventType(), + super(builder.getStateProvider().getExpectedEventType(), TmfTimeRange.ETERNITY, TmfDataRequest.ALL_DATA, chunkSize, ITmfDataRequest.ExecutionType.BACKGROUND); this.builder = builder; - this.sci = builder.getInputPlugin(); + this.sci = builder.getStateProvider(); this.trace = sci.getTrace(); } diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTree.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTree.java index d4d66e843e..bb08413770 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTree.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTree.java @@ -23,7 +23,7 @@ import java.nio.channels.FileChannel; import java.util.Vector; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; /** * Meta-container for the History Tree. This structure contains all the @@ -147,7 +147,7 @@ class HistoryTree { res = buffer.getInt(); /* Event handler's version number */ if (res != expProviderVersion && - expProviderVersion != IStateChangeInput.IGNORE_PROVIDER_VERSION) { + expProviderVersion != ITmfStateProvider.IGNORE_PROVIDER_VERSION) { /* * The existing history was built using a event handler that doesn't * match the current one in the framework. Information could be all diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java index 34e6129a0d..f731170b91 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java @@ -30,8 +30,8 @@ import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest; import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest; import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest; import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractStateChangeInput; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange; import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp; @@ -59,7 +59,7 @@ public class PartialHistoryBackend implements IStateHistoryBackend { * A partial history needs the state input plugin to re-generate state * between checkpoints. */ - private final IStateChangeInput partialInput; + private final ITmfStateProvider partialInput; /** * Fake state system that is used for partially rebuilding the states (when @@ -98,7 +98,7 @@ public class PartialHistoryBackend implements IStateHistoryBackend { * Configuration parameter indicating how many trace events there * should be between each checkpoint */ - public PartialHistoryBackend(IStateChangeInput partialInput, PartialStateSystem pss, + public PartialHistoryBackend(ITmfStateProvider partialInput, PartialStateSystem pss, IStateHistoryBackend realBackend, long granularity) { if (granularity <= 0 || partialInput == null || pss == null) { throw new IllegalArgumentException(); @@ -293,7 +293,7 @@ public class PartialHistoryBackend implements IStateHistoryBackend { private long eventCount; private long lastCheckpointAt; - public CheckpointsRequest(IStateChangeInput input, Map checkpoints) { + public CheckpointsRequest(ITmfStateProvider input, Map checkpoints) { super(input.getExpectedEventType(), TmfTimeRange.ETERNITY, TmfDataRequest.ALL_DATA, @@ -332,10 +332,10 @@ public class PartialHistoryBackend implements IStateHistoryBackend { private class PartialStateSystemRequest extends TmfEventRequest { private final static int chunkSize = 50000; - private final IStateChangeInput sci; + private final ITmfStateProvider sci; private final ITmfTrace trace; - PartialStateSystemRequest(IStateChangeInput sci, TmfTimeRange range) { + PartialStateSystemRequest(ITmfStateProvider sci, TmfTimeRange range) { super(sci.getExpectedEventType(), range, TmfDataRequest.ALL_DATA, @@ -360,8 +360,8 @@ public class PartialHistoryBackend implements IStateHistoryBackend { * all events have been handled by the state system before doing * queries on it. */ - if (partialInput instanceof AbstractStateChangeInput) { - ((AbstractStateChangeInput) partialInput).waitForEmptyQueue(); + if (partialInput instanceof AbstractTmfStateProvider) { + ((AbstractTmfStateProvider) partialInput).waitForEmptyQueue(); } super.handleCompleted(); } diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/callstack/CallStackStateProvider.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/callstack/CallStackStateProvider.java index d7f08cef08..cfc7f87abc 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/callstack/CallStackStateProvider.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/callstack/CallStackStateProvider.java @@ -16,7 +16,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException; import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; import org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue; import org.eclipse.linuxtools.tmf.core.statevalue.TmfStateValue; import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; @@ -60,7 +60,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; * @author Patrick Tasse * @since 2.0 */ -public abstract class CallStackStateProvider extends AbstractStateChangeInput { +public abstract class CallStackStateProvider extends AbstractTmfStateProvider { /** CallStack state system ID */ public static final String ID = "org.eclipse.linuxtools.tmf.callstack"; //$NON-NLS-1$ diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractTmfStateProvider.java similarity index 98% rename from org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java rename to org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractTmfStateProvider.java index e90fde48e0..95214e1d73 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractTmfStateProvider.java @@ -37,7 +37,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; * @author Alexandre Montplaisir * @since 2.0 */ -public abstract class AbstractStateChangeInput implements IStateChangeInput { +public abstract class AbstractTmfStateProvider implements ITmfStateProvider { private static final int DEFAULT_EVENTS_QUEUE_SIZE = 10000; @@ -63,7 +63,7 @@ public abstract class AbstractStateChangeInput implements IStateChangeInput { * @param id * Name given to this state change input. Only used internally. */ - public AbstractStateChangeInput(ITmfTrace trace, + public AbstractTmfStateProvider(ITmfTrace trace, Class eventType, String id) { this.trace = trace; this.eventType = eventType; diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/IStateChangeInput.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/ITmfStateProvider.java similarity index 97% rename from org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/IStateChangeInput.java rename to org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/ITmfStateProvider.java index ca36f2461d..d9d43e542e 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/IStateChangeInput.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/ITmfStateProvider.java @@ -22,10 +22,10 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; * Usually a state change input, also called "state provider" is the piece of * the pipeline which converts trace events to state changes. * - * @version 2.0 * @author Alexandre Montplaisir + * @since 2.0 */ -public interface IStateChangeInput { +public interface ITmfStateProvider { /** * Special state provider version number that will tell the backend to @@ -115,7 +115,7 @@ public interface IStateChangeInput { * assigned target state system * @since 2.0 */ - public IStateChangeInput getNewInstance(); + public ITmfStateProvider getNewInstance(); /** * Indicate to the state history building process that we are done (for now), diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/StateSystemManager.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/StateSystemManager.java index 446d3cf717..86a8023d13 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/StateSystemManager.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/StateSystemManager.java @@ -49,10 +49,10 @@ public abstract class StateSystemManager extends TmfComponent { * The target name of the history file we want to use. If it * exists it will be opened. If it doesn't, a new file will be * created with this name/path. - * @param htInput - * The IStateChangeInput to use for building the history file. It - * may be required even if we are opening an already-existing - * history (ie, for partial histories). + * @param stateProvider + * The {@link ITmfStateProvider} to use for building the history + * file. It may be required even if we are opening an + * already-existing history (ie, for partial histories). * @param buildManually * If false, the construction will wait for a signal before * starting. If true, it will build everything right now and @@ -65,7 +65,7 @@ public abstract class StateSystemManager extends TmfComponent { * @since 2.0 */ public static ITmfStateSystem loadStateHistory(File htFile, - IStateChangeInput htInput, boolean buildManually) + ITmfStateProvider stateProvider, boolean buildManually) throws TmfTraceException { IStateHistoryBackend htBackend; @@ -74,9 +74,9 @@ public abstract class StateSystemManager extends TmfComponent { // at least if its range matches the trace's range. if (htFile.exists()) { /* Load an existing history */ - final int version = (htInput == null) ? - IStateChangeInput.IGNORE_PROVIDER_VERSION : - htInput.getVersion(); + final int version = (stateProvider == null) ? + ITmfStateProvider.IGNORE_PROVIDER_VERSION : + stateProvider.getVersion(); try { htBackend = new HistoryTreeBackend(htFile, version); ITmfStateSystem ss = HistoryBuilder.openExistingHistory(htBackend); @@ -93,15 +93,15 @@ public abstract class StateSystemManager extends TmfComponent { /* Create a new state history from scratch */ HistoryBuilder builder; - if (htInput == null) { + if (stateProvider == null) { return null; } try { htBackend = new ThreadedHistoryTreeBackend(htFile, - htInput.getStartTime(), htInput.getVersion(), QUEUE_SIZE); + stateProvider.getStartTime(), stateProvider.getVersion(), QUEUE_SIZE); StateSystem ss = new StateSystem(htBackend); - htInput.assignTargetStateSystem(ss); - builder = new HistoryBuilder(htInput, ss, htBackend, buildManually); + stateProvider.assignTargetStateSystem(ss); + builder = new HistoryBuilder(stateProvider, ss, htBackend, buildManually); } catch (IOException e) { /* * If it fails here however, it means there was a problem writing to @@ -118,19 +118,19 @@ public abstract class StateSystemManager extends TmfComponent { * {@link ITmfStateSystem#queryOngoingState} will be available. * * This has to be built "manually" (which means you should call - * input.processEvent() to update the ongoing state of the state system). + * stateProvider.processEvent() to update the ongoing state of the state system). * - * @param input - * The input plugin to build the history + * @param stateProvider + * The state provider plugin to build the history * @return Reference to the history-less state system that got built * @since 2.0 */ - public static ITmfStateSystem newNullHistory(IStateChangeInput input) { + public static ITmfStateSystem newNullHistory(ITmfStateProvider stateProvider) { IStateHistoryBackend backend = new NullBackend(); StateSystem ss = new StateSystem(backend); - input.assignTargetStateSystem(ss); + stateProvider.assignTargetStateSystem(ss); - HistoryBuilder builder = new HistoryBuilder(input, ss, backend, true); + HistoryBuilder builder = new HistoryBuilder(stateProvider, ss, backend, true); return builder.getStateSystemQuerier(); } @@ -141,8 +141,8 @@ public abstract class StateSystemManager extends TmfComponent { * * This will block the caller while the construction is ongoing. * - * @param input - * The state change input to use + * @param stateProvider + * The sstateProvider to use * @param buildManually * Set to true to block the caller and build without using TMF * signals (for test programs most of the time). Use false if you @@ -150,13 +150,13 @@ public abstract class StateSystemManager extends TmfComponent { * @return Reference to the state system that just got built * @since 2.0 */ - public static ITmfStateSystem newInMemHistory(IStateChangeInput input, + public static ITmfStateSystem newInMemHistory(ITmfStateProvider stateProvider, boolean buildManually) { - IStateHistoryBackend backend = new InMemoryBackend(input.getStartTime()); + IStateHistoryBackend backend = new InMemoryBackend(stateProvider.getStartTime()); StateSystem ss = new StateSystem(backend); - input.assignTargetStateSystem(ss); + stateProvider.assignTargetStateSystem(ss); - HistoryBuilder builder = new HistoryBuilder(input, ss, backend, buildManually); + HistoryBuilder builder = new HistoryBuilder(stateProvider, ss, backend, buildManually); return builder.getStateSystemQuerier(); } @@ -174,8 +174,8 @@ public abstract class StateSystemManager extends TmfComponent { * The target file of the history. Since they are usually quick * to build, it will overwrite any existing file, without trying * to re-open it. - * @param realInput - * The state provider input to use to build this history. + * @param realStateProvider + * The state provider to use to build this history. * @param buildManually * Indicates if you want to build the state system in-band * ('true', for unit tests for example), or to not block the @@ -186,23 +186,24 @@ public abstract class StateSystemManager extends TmfComponent { * @since 2.0 */ public static ITmfStateSystem newPartialHistory(File htFile, - IStateChangeInput realInput, boolean buildManually) throws TmfTraceException { + ITmfStateProvider realStateProvider, boolean buildManually) + throws TmfTraceException { /* * The order of initializations is very tricky (but very important!) * here. We need to follow this pattern: * (1 is done before the call to this method) * - * 1- Instantiate realInput + * 1- Instantiate realStateProvider * 2- Instantiate realBackend * 3- Instantiate partialBackend, whith prereqs: - * 3a- Instantiate partialInput, via realInput.getNew() + * 3a- Instantiate partialProvider, via realProvider.getNew() * 3b- Instantiate nullBackend (partialSS's backend) * 3c- Instantiate partialSS - * 3d- partialInput.assignSS(partialSS) + * 3d- partialProvider.assignSS(partialSS) * 4- Instantiate realSS * 5- partialSS.assignUpstream(realSS) - * 6- realInput.assignSS(realSS) - * 7- Call HistoryBuilder(realInput, realSS, partialBackend) to build the thing. + * 6- realProvider.assignSS(realSS) + * 7- Call HistoryBuilder(realProvider, realSS, partialBackend) to build the thing. */ final long granularity = 50000; @@ -211,23 +212,23 @@ public abstract class StateSystemManager extends TmfComponent { IStateHistoryBackend realBackend = null; try { realBackend = new ThreadedHistoryTreeBackend(htFile, - realInput.getStartTime(), realInput.getVersion(), QUEUE_SIZE); + realStateProvider.getStartTime(), realStateProvider.getVersion(), QUEUE_SIZE); } catch (IOException e) { throw new TmfTraceException(e.toString(), e); } /* 3a */ - IStateChangeInput partialInput = realInput.getNewInstance(); + ITmfStateProvider partialProvider = realStateProvider.getNewInstance(); /* 3b-3c, constructor automatically uses a NullBackend */ PartialStateSystem pss = new PartialStateSystem(); /* 3d */ - partialInput.assignTargetStateSystem(pss); + partialProvider.assignTargetStateSystem(pss); /* 3 */ IStateHistoryBackend partialBackend = - new PartialHistoryBackend(partialInput, pss, realBackend, granularity); + new PartialHistoryBackend(partialProvider, pss, realBackend, granularity); /* 4 */ StateSystem realSS = new StateSystem(partialBackend); @@ -236,10 +237,10 @@ public abstract class StateSystemManager extends TmfComponent { pss.assignUpstream(realSS); /* 6 */ - realInput.assignTargetStateSystem(realSS); + realStateProvider.assignTargetStateSystem(realSS); /* 7 */ - HistoryBuilder builder = new HistoryBuilder(realInput, realSS, partialBackend, buildManually); + HistoryBuilder builder = new HistoryBuilder(realStateProvider, realSS, partialBackend, buildManually); return builder.getStateSystemQuerier(); } } diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/StatsStateProvider.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/StatsStateProvider.java index a29f9d9d70..b7d0eb32ee 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/StatsStateProvider.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/StatsStateProvider.java @@ -17,7 +17,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException; import org.eclipse.linuxtools.tmf.core.exceptions.StateValueTypeException; import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException; -import org.eclipse.linuxtools.tmf.core.statesystem.AbstractStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.AbstractTmfStateProvider; import org.eclipse.linuxtools.tmf.core.statistics.TmfStateStatistics.Attributes; import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; @@ -42,7 +42,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; * @author Alexandre Montplaisir * @version 1.0 */ -class StatsStateProvider extends AbstractStateChangeInput { +class StatsStateProvider extends AbstractTmfStateProvider { /** * Version number of this input handler. Please bump this if you modify the diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/TmfStateStatistics.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/TmfStateStatistics.java index 8afe20765e..87d5b70761 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/TmfStateStatistics.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/TmfStateStatistics.java @@ -30,7 +30,7 @@ import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval; import org.eclipse.linuxtools.tmf.core.signal.TmfSignal; import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; import org.eclipse.linuxtools.tmf.core.signal.TmfStatsUpdatedSignal; -import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput; +import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateProvider; import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem; import org.eclipse.linuxtools.tmf.core.statesystem.StateSystemManager; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; @@ -94,7 +94,7 @@ public class TmfStateStatistics implements ITmfStatistics { } final File htFile = new File(supplDirectory + File.separator + STATS_STATE_FILENAME); - final IStateChangeInput htInput = new StatsStateProvider(trace); + final ITmfStateProvider htInput = new StatsStateProvider(trace); this.stats = StateSystemManager.loadStateHistory(htFile, htInput, false); registerStateSystems(); @@ -114,7 +114,7 @@ public class TmfStateStatistics implements ITmfStatistics { */ public TmfStateStatistics(ITmfTrace trace, File historyFile) throws TmfTraceException { this.trace = trace; - final IStateChangeInput htInput = new StatsStateProvider(trace); + final ITmfStateProvider htInput = new StatsStateProvider(trace); this.stats = StateSystemManager.loadStateHistory(historyFile, htInput, true); registerStateSystems(); } -- 2.34.1