aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2013-10-04 16:30:01 (EDT)
committerAlexandre Montplaisir2013-10-04 19:01:25 (EDT)
commit944172362d018ab163480725ba56bef5d716e12a (patch)
treeb4ce3af3d05615f8a37de09cdb26ba549b1d6282
parent7721fc17a69c2a211a6172b62473db1c9a8c5016 (diff)
downloadorg.eclipse.linuxtools-944172362d018ab163480725ba56bef5d716e12a.zip
org.eclipse.linuxtools-944172362d018ab163480725ba56bef5d716e12a.tar.gz
org.eclipse.linuxtools-944172362d018ab163480725ba56bef5d716e12a.tar.bz2
[TMF] Remove TmfTrace.setIndexer and indexer param in ctorrefs/changes/51/17051/3
By removing those two ways of setting the indexer, the indexer is always instantiated in TmfTrace.createIndexer and subclasses can override it. Change-Id: Ie00b72123de19e6448b0436a1e7ec11004ad28bc Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/17051 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/shared/org/eclipse/linuxtools/tmf/core/tests/shared/TmfTestTrace.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java4
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java11
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java14
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java18
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java8
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfExperimentStub.java7
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java8
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java20
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomTxtIndexTest.java7
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomXmlIndexTest.java7
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java2
17 files changed, 64 insertions, 54 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/shared/org/eclipse/linuxtools/tmf/core/tests/shared/TmfTestTrace.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/shared/org/eclipse/linuxtools/tmf/core/tests/shared/TmfTestTrace.java
index 6d571f0..cf459c2 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/shared/org/eclipse/linuxtools/tmf/core/tests/shared/TmfTestTrace.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/shared/org/eclipse/linuxtools/tmf/core/tests/shared/TmfTestTrace.java
@@ -80,7 +80,7 @@ public enum TmfTestTrace {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(fDirectory + File.separator + fPath), null);
try {
File test = new File(FileLocator.toFileURL(location).toURI());
- trace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
+ trace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java
index aa40d54..40cefa1 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java
@@ -93,7 +93,7 @@ public class TmfEventTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.A_TEST_10K.getFullPath()), null);
final File test = new File(FileLocator.toFileURL(location).toURI());
- trace = new TmfTraceStub(test.toURI().getPath(), 500, false, null, null);
+ trace = new TmfTraceStub(test.toURI().getPath(), 500, false, null);
} catch (final TmfTraceException e) {
e.printStackTrace();
} catch (final URISyntaxException e) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
index 7fcf18a..6f26ac6 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
@@ -403,7 +403,7 @@ public class TmfCoalescedEventRequestTest {
try {
URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
File test = new File(FileLocator.toFileURL(location).toURI());
- fTrace = new TmfTraceStub(test.getPath(), 500, false, null, null);
+ fTrace = new TmfTraceStub(test.getPath(), 500, false, null);
} catch (TmfTraceException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java
index 7c292db..87af12a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java
@@ -83,7 +83,7 @@ public class TmfExperimentTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
final File test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ final TmfTraceStub trace = new TmfTraceStub(test.getPath(), 0, true, null);
fTestTraces[0] = trace;
} catch (final TmfTraceException e) {
e.printStackTrace();
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java
index 8f80200..10924ac 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java
@@ -89,12 +89,12 @@ public class TmfMultiTraceExperimentTest {
URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.O_TEST_10K.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null);
traces[0] = trace1;
location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TmfTestTrace.E_TEST_10K.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null);
traces[1] = trace2;
return traces;
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
index acb1b1a..5798d2c 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
@@ -33,9 +33,9 @@ import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
-import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
import org.eclipse.linuxtools.tmf.core.statistics.ITmfStatistics;
import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
@@ -46,7 +46,6 @@ import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
import org.junit.After;
@@ -94,7 +93,7 @@ public class TmfTraceTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
final File test = new File(FileLocator.toFileURL(location).toURI());
- fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
+ fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
fTrace.indexTrace(true);
} catch (final TmfTraceException e) {
e.printStackTrace();
@@ -116,7 +115,7 @@ public class TmfTraceTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
- TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
+ TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
trace.indexTrace(true);
assertEquals("getType", ITmfEvent.class, trace.getType());
@@ -173,7 +172,7 @@ public class TmfTraceTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
File testfile = new File(FileLocator.toFileURL(location).toURI());
- TmfTraceStub original = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, new TmfCheckpointIndexer(null), null);
+ TmfTraceStub original = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
TmfTraceStub trace = new TmfTraceStub(original);
trace.indexTrace(true);
@@ -1358,7 +1357,7 @@ public class TmfTraceTest {
try {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE.getFullPath()), null);
testfile = new File(FileLocator.toFileURL(location).toURI());
- trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
+ trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
// verify initial values
TmfTimestamp defaultInitRange = new TmfTimestamp(DEFAULT_INITIAL_OFFSET_VALUE, ITmfTimestamp.NANOSECOND_SCALE);
assertEquals("getInitialRangeOffset", defaultInitRange, trace.getInitialRangeOffset());
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java
index 6c83b91..728b130 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java
@@ -150,8 +150,12 @@ public abstract class AbstractIndexTest {
* when error occurs
*/
public TestTrace(String path, int blockSize) throws TmfTraceException {
- super(path, blockSize, false, null, null);
- setIndexer(createTestIndexer(this));
+ super(path, blockSize, false, null);
+ }
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return createTestIndexer(this);
}
@Override
@@ -163,7 +167,11 @@ public abstract class AbstractIndexTest {
private class EmptyTestTrace extends TmfEmptyTraceStub {
public EmptyTestTrace() {
super();
- setIndexer(new TestIndexer(this));
+ }
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TestIndexer(this);
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java
index 21a8697..fd03817 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java
@@ -30,6 +30,7 @@ import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
import org.eclipse.linuxtools.tmf.core.tests.shared.TmfTestTrace;
import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.ITmfCheckpointIndex;
import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfEmptyTraceStub;
@@ -93,9 +94,14 @@ public class TmfCheckpointIndexTest2 {
private class TestTrace extends TmfTraceStub {
public TestTrace(String path, int blockSize) throws TmfTraceException {
- super(path, blockSize, false, null, null);
- setIndexer(new TestIndexer(this));
+ super(path, blockSize, false, null);
}
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TestIndexer(this);
+ }
+
@Override
public TestIndexer getIndexer() {
return (TestIndexer) super.getIndexer();
@@ -103,10 +109,12 @@ public class TmfCheckpointIndexTest2 {
}
private class EmptyTestTrace extends TmfEmptyTraceStub {
- public EmptyTestTrace() {
- super();
- setIndexer(new TestIndexer(this));
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TestIndexer(this);
}
+
@Override
public TestIndexer getIndexer() {
return (TestIndexer) super.getIndexer();
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java
index 879a35f..1aa81bf 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java
@@ -87,11 +87,11 @@ public class TmfExperimentCheckpointIndexTest {
try {
URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE1.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null);
fTestTraces[0] = trace1;
location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE2.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null);
fTestTraces[1] = trace2;
} catch (final TmfTraceException e) {
e.printStackTrace();
@@ -141,11 +141,11 @@ public class TmfExperimentCheckpointIndexTest {
try {
URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE1.getFullPath()), null);
File test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, false, null, null);
+ final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, false, null);
testTraces[0] = trace1;
location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TEST_TRACE2.getFullPath()), null);
test = new File(FileLocator.toFileURL(location).toURI());
- final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, false, null, null);
+ final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, false, null);
testTraces[1] = trace2;
} catch (final TmfTraceException e) {
e.printStackTrace();
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java
index bb264f5..b4fc281 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java
@@ -46,7 +46,7 @@ public class TmfDataProviderStub extends TmfDataProvider {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
try {
final File test = new File(FileLocator.toFileURL(location).toURI());
- fTrace = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ fTrace = new TmfTraceStub(test.getPath(), 0, true, null);
} catch (final TmfTraceException e) {
e.printStackTrace();
} catch (final URISyntaxException e) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java
index 1e729ac..cd07895 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java
@@ -44,7 +44,7 @@ public class TmfEventProviderStub extends TmfEventProvider {
final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
try {
final File test = new File(FileLocator.toFileURL(location).toURI());
- fTrace = new TmfTraceStub(test.getPath(), 0, true, null, null);
+ fTrace = new TmfTraceStub(test.getPath(), 0, true, null);
} catch (final TmfTraceException e) {
e.printStackTrace();
} catch (final URISyntaxException e) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfExperimentStub.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfExperimentStub.java
index 540b468..6ca0edd 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfExperimentStub.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfExperimentStub.java
@@ -15,6 +15,7 @@ package org.eclipse.linuxtools.tmf.tests.stubs.trace;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
/**
* <b><u>TmfExperimentStub</u></b>
@@ -27,7 +28,11 @@ public class TmfExperimentStub extends TmfExperiment {
public TmfExperimentStub(String name, ITmfTrace[] traces, int blockSize) {
super(ITmfEvent.class, name, traces, blockSize);
- setIndexer(new TmfIndexerStub(this, blockSize));
+ }
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TmfIndexerStub(this, interval);
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
index a2edc41..7739b76 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
@@ -34,7 +34,6 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfPersistentlyIndexable;
-import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.ITmfCheckpoint;
import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpoint;
import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
@@ -90,7 +89,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser, ITmfPersi
public TmfTraceStub(final String path,
final int cacheSize,
final long interval) throws TmfTraceException {
- super(null, ITmfEvent.class, path, cacheSize, interval, null, null);
+ super(null, ITmfEvent.class, path, cacheSize, interval, null);
setupTrace(path);
setParser(new TmfEventParserStub(this));
}
@@ -105,8 +104,6 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser, ITmfPersi
* The cache size
* @param waitForCompletion
* Do we block the caller until the trace is indexed, or not.
- * @param indexer
- * The trace indexer to use
* @param parser
* The trace parser. If left 'null', it will use a
* {@link TmfEventParserStub}.
@@ -116,9 +113,8 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser, ITmfPersi
public TmfTraceStub(final String path,
final int cacheSize,
final boolean waitForCompletion,
- final ITmfTraceIndexer indexer,
final ITmfEventParser parser) throws TmfTraceException {
- super(null, ITmfEvent.class, path, cacheSize, 0, indexer, null);
+ super(null, ITmfEvent.class, path, cacheSize, 0, null);
setupTrace(path);
setParser((parser != null) ? parser : new TmfEventParserStub(this));
if (waitForCompletion) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
index f3f7c37..c5f0d16 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
@@ -142,6 +142,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
*/
public TmfTrace() {
super();
+ fIndexer = createIndexer(DEFAULT_BLOCK_SIZE);
}
/**
@@ -159,9 +160,6 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
* @param interval
* The trace streaming interval. You can use '0' for post-mortem
* traces.
- * @param indexer
- * The trace indexer. You can pass 'null' to use a default
- * checkpoint indexer.
* @param parser
* The trace event parser. Use 'null' if (and only if) the trace
* object itself is also the ITmfEventParser to be used.
@@ -173,14 +171,12 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
final String path,
final int cacheSize,
final long interval,
- final ITmfTraceIndexer indexer,
final ITmfEventParser parser)
throws TmfTraceException {
super();
fCacheSize = (cacheSize > 0) ? cacheSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE;
fStreamingInterval = interval;
fParser = parser;
- fIndexer = indexer;
initialize(resource, path, type);
}
@@ -256,9 +252,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
super.init(traceName, type);
// register as VIP after super.init() because TmfComponent registers to signal manager there
TmfSignalManager.registerVIP(this);
- if (fIndexer == null) {
- fIndexer = createIndexer(fCacheSize);
- }
+ fIndexer = createIndexer(fCacheSize);
}
/**
@@ -521,16 +515,6 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
}
/**
- * Set the trace indexer. Must be done at initialization time.
- *
- * @param indexer the trace indexer
- * @since 3.0
- */
- protected void setIndexer(final ITmfTraceIndexer indexer) {
- fIndexer = indexer;
- }
-
- /**
* Set the trace parser. Must be done at initialization time.
*
* @param parser the new trace parser
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomTxtIndexTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomTxtIndexTest.java
index f6928d5..9876520 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomTxtIndexTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomTxtIndexTest.java
@@ -24,6 +24,7 @@ import java.util.Date;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
/**
* Test suite for indexing using a CustomTxtTrace.
@@ -64,7 +65,11 @@ public class CustomTxtIndexTest extends AbstractCustomTraceIndexTest {
private class TestTxtTrace extends CustomTxtTrace implements TestTrace {
public TestTxtTrace(String path, CustomTxtTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
super(null, createDefinition, path, blockSize);
- setIndexer(new TestIndexer(this, blockSize));
+ }
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TestIndexer(this, interval);
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomXmlIndexTest.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomXmlIndexTest.java
index 3ee32c8..bb8b2d6 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomXmlIndexTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/trace/CustomXmlIndexTest.java
@@ -24,6 +24,7 @@ import java.util.Date;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
/**
* Test suite for indexing using a CustomXmlTrace.
@@ -66,7 +67,11 @@ public class CustomXmlIndexTest extends AbstractCustomTraceIndexTest {
private class TestXmlTrace extends CustomXmlTrace implements TestTrace {
public TestXmlTrace(String path, CustomXmlTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
super(null, createDefinition, path, blockSize);
- setIndexer(new TestIndexer(this, blockSize));
+ }
+
+ @Override
+ protected ITmfTraceIndexer createIndexer(int interval) {
+ return new TestIndexer(this, interval);
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java
index c342ae9..3d342fa 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java
@@ -134,7 +134,7 @@ public class Uml2SDTestFacility {
// Create test trace object
final URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path("tracesets/sdEvents"), null);
final File test = new File(FileLocator.toFileURL(location).toURI());
- return new TmfTraceStub(test.getPath(), 500, true, null, parser);
+ return new TmfTraceStub(test.getPath(), 500, true, parser);
} catch (final TmfTraceException e) {
e.printStackTrace();
throw new RuntimeException(e);