Merge branch 'master' into lttng-luna
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Wed, 7 Aug 2013 19:45:05 +0000 (15:45 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Wed, 7 Aug 2013 19:50:29 +0000 (15:50 -0400)
Conflicts:
lttng/org.eclipse.linuxtools.ctf.parser/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.ctf.parser/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace.core.tests/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.gdbtrace.core.tests/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace.core/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.gdbtrace.core/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace.help/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.gdbtrace.help/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace.ui.tests/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.gdbtrace.ui.tests/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace.ui/META-INF/MANIFEST.MF
lttng/org.eclipse.linuxtools.gdbtrace.ui/pom.xml
lttng/org.eclipse.linuxtools.gdbtrace/feature.xml
lttng/org.eclipse.linuxtools.gdbtrace/pom.xml
lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java

Change-Id: Iccbebfaa9e02141429f46e0bf7d973b1e6120779

201 files changed:
org.eclipse.linuxtools.ctf.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.ctf.core.tests/pom.xml
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceCallsitePerformanceTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/trace/CTFTraceTest.java
org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java
org.eclipse.linuxtools.ctf.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.ctf.core/pom.xml
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/event/types/IntegerDefinition.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFTrace.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputReader.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/CTFCallsiteComparator.java [new file with mode: 0644]
org.eclipse.linuxtools.ctf.parser/META-INF/MANIFEST.MF
org.eclipse.linuxtools.ctf.parser/pom.xml
org.eclipse.linuxtools.ctf/feature.xml
org.eclipse.linuxtools.ctf/pom.xml
org.eclipse.linuxtools.gdbtrace.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.gdbtrace.core.tests/pom.xml
org.eclipse.linuxtools.gdbtrace.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.gdbtrace.core/pom.xml
org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/GdbTrace.java
org.eclipse.linuxtools.gdbtrace.help/META-INF/MANIFEST.MF
org.eclipse.linuxtools.gdbtrace.help/pom.xml
org.eclipse.linuxtools.gdbtrace.ui.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.gdbtrace.ui.tests/pom.xml
org.eclipse.linuxtools.gdbtrace.ui/META-INF/MANIFEST.MF
org.eclipse.linuxtools.gdbtrace.ui/pom.xml
org.eclipse.linuxtools.gdbtrace/feature.xml
org.eclipse.linuxtools.gdbtrace/pom.xml
org.eclipse.linuxtools.lttng.help/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng.help/pom.xml
org.eclipse.linuxtools.lttng.releng-site/pom.xml
org.eclipse.linuxtools.lttng2.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.core.tests/pom.xml
org.eclipse.linuxtools.lttng2.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.core/pom.xml
org.eclipse.linuxtools.lttng2.kernel.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.kernel.core.tests/pom.xml
org.eclipse.linuxtools.lttng2.kernel.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.kernel.core/pom.xml
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/LttngKernelTrace.java
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java
org.eclipse.linuxtools.lttng2.kernel.ui.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.kernel.ui.tests/pom.xml
org.eclipse.linuxtools.lttng2.kernel.ui/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.kernel.ui/pom.xml
org.eclipse.linuxtools.lttng2.kernel/feature.xml
org.eclipse.linuxtools.lttng2.kernel/pom.xml
org.eclipse.linuxtools.lttng2.ui.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ui.tests/pom.xml
org.eclipse.linuxtools.lttng2.ui/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ui/pom.xml
org.eclipse.linuxtools.lttng2.ust.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ust.core.tests/pom.xml
org.eclipse.linuxtools.lttng2.ust.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ust.core/pom.xml
org.eclipse.linuxtools.lttng2.ust.ui.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ust.ui.tests/pom.xml
org.eclipse.linuxtools.lttng2.ust.ui/META-INF/MANIFEST.MF
org.eclipse.linuxtools.lttng2.ust.ui/pom.xml
org.eclipse.linuxtools.lttng2.ust/feature.xml
org.eclipse.linuxtools.lttng2.ust/pom.xml
org.eclipse.linuxtools.lttng2/feature.xml
org.eclipse.linuxtools.lttng2/pom.xml
org.eclipse.linuxtools.tmf.core.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.core.tests/pom.xml
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/AllTmfCoreTests.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/component/TmfEventProviderTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventFieldTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTraceTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/EventContextTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/headless/RequestBenchmark.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfEventTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfDataRequestTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfEventRequestTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfSchedulerTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/AllTests.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest2.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointTest.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfContextTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentCheckpointIndexTest.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfLocationTest.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfMultiTraceExperimentTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfStringLocation.java [deleted file]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AllTests.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointTest.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/AllTests.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfLocationTest.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfStringLocation.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfDataProviderStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfEventProviderStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/component/TmfSyntheticEventProviderStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/request/TmfDataRequestStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/request/TmfEventRequestStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfEmptyTraceStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfIndexerStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
org.eclipse.linuxtools.tmf.core/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.core/pom.xml
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/Activator.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/TmfExperimentLocation.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/TmfLocationArray.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/component/TmfDataProvider.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/component/TmfEventProvider.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfLocation.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfContext.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfEventField.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/Messages.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/request/ITmfDataRequest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/request/TmfDataRequest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/request/TmfEventRequest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfRangeSynchSignal.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTimeSynchSignal.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statistics/TmfEventsStatistics.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/ITmfTimePreferencesConstants.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfNanoTimestamp.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimePreferences.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestampFormat.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfCheckpoint.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfLocation.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTraceIndexer.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpoint.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpointIndexer.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfContext.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLocation.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLongLocation.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTimestampLocation.java [deleted file]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfTraceIndexer.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/ITmfLocation.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLocation.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfTimestampLocation.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.help/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.help/pom.xml
org.eclipse.linuxtools.tmf.ui.tests/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.ui.tests/pom.xml
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/views/uml2sd/loader/Uml2SDTestFacility.java
org.eclipse.linuxtools.tmf.ui/META-INF/MANIFEST.MF
org.eclipse.linuxtools.tmf.ui/plugin.properties
org.eclipse.linuxtools.tmf.ui/plugin.xml
org.eclipse.linuxtools.tmf.ui/pom.xml
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTraceContext.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTraceContext.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/properties/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/environment/TmfEnvironmentView.java [deleted file]
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramDataModel.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statesystem/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statesystem/TmfStateSystemExplorer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/rawviewer/TmfRawEventViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/ITimeGraphPresentationProvider2.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphCombo.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphPresentationProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphTimeEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/model/TimeEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/model/TimeGraphEntry.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider2.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITmfTimeGraphDrawingHelper.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/virtualtable/TmfVirtualTable.java
org.eclipse.linuxtools.tmf/feature.xml
org.eclipse.linuxtools.tmf/pom.xml
pom.xml

index aa59f38f4857ec811ae11943c7abda6a52578fe7..221d58ac60991881883584dc8dd6398ef3584392 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.ctf.core.tests;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.ctf.core.tests.CtfCoreTestPlugin
@@ -10,7 +10,7 @@ Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime;bundle-version="3.8.0",
- org.eclipse.linuxtools.ctf.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.ctf.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.ctf.core.tests,
  org.eclipse.linuxtools.ctf.core.tests.shared
 Import-Package: org.antlr.runtime;version="3.2.0"
index 53c097c3d5e6a840b946f11111d31efef0efad68..5661e93ec842feee222a82975e98d73d72674e1d 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Linux Tools CTF Core Tests Plug-in</name>
   <groupId>org.eclipse.linuxtools.ctf</groupId>
   <artifactId>org.eclipse.linuxtools.ctf.core.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
  <build>
index c361ec26481ee7c80085d175d5efd0d61979f056..2d11615d42b86cabec93db18afaea404e1b8df64 100644 (file)
@@ -15,8 +15,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
-import java.util.List;
 import java.util.Random;
+import java.util.TreeSet;
 
 import org.eclipse.linuxtools.ctf.core.event.CTFCallsite;
 import org.eclipse.linuxtools.ctf.core.tests.shared.CtfTestTraces;
@@ -93,7 +93,7 @@ public class CTFTraceCallsitePerformanceTest {
     }
 
     private long testMain() {
-        List<CTFCallsite> l = fTrace.getCallsiteCandidates(callsites[0]);
+        TreeSet<CTFCallsite> l = fTrace.getCallsiteCandidates(callsites[0]);
         CTFCallsite cs = fTrace.getCallsite(1);
         CTFCallsite cs1 = fTrace.getCallsite(callsites[0]);
         CTFCallsite cs2 = fTrace.getCallsite(callsites[0], 1);
index 6d946000049d32739c2cf3f76bf60949455ce6f3..c0a43790c9531b6a6cde41b5a4833bc39c0d2625 100644 (file)
@@ -8,6 +8,7 @@
  * Contributors:
  *     Matthew Khouzam - Initial API and implementation
  *     Marc-Andre Laperle - Test in traces directory recursively
+ *     Simon Delisle - Add test for getCallsite(eventName, ip)
  *******************************************************************************/
 
 package org.eclipse.linuxtools.ctf.core.tests.trace;
@@ -451,4 +452,26 @@ public class CTFTraceTest {
         }
     }
 
+    /**
+     * Test for getCallsite(eventName, ip)
+     */
+    @Test
+    public void callsitePosition(){
+        long ip1 = 2;
+        long ip2 = 5;
+        long ip3 = 7;
+        CTFTrace callsiteTest = CtfTestTraces.getTestTraceFromFile(TRACE_INDEX);
+        callsiteTest.addCallsite("testEvent", null, ip1, null, 23);
+        callsiteTest.addCallsite("testEvent", null, ip2, null, 50);
+        callsiteTest.addCallsite("testEvent", null, ip3, null, 15);
+
+        assertEquals(2, (callsiteTest.getCallsite("testEvent", 1)).getIp());
+        assertEquals(2, (callsiteTest.getCallsite("testEvent", 2)).getIp());
+        assertEquals(5, (callsiteTest.getCallsite("testEvent", 3)).getIp());
+        assertEquals(5, (callsiteTest.getCallsite("testEvent", 5)).getIp());
+        assertEquals(7, (callsiteTest.getCallsite("testEvent", 6)).getIp());
+        assertEquals(7, (callsiteTest.getCallsite("testEvent", 7)).getIp());
+        assertEquals(7, (callsiteTest.getCallsite("testEvent", 8)).getIp());
+    }
+
 }
index 1ce81fda243948b341c6d1787e5641a33e40231d..74db10edcf9ec3cd8855a465e072d1b3e37fe3fe 100644 (file)
@@ -105,4 +105,45 @@ public class IntegerDefinitionTest {
         String result = fixture.toString();
         assertNotNull(result);
     }
+
+    /**
+     * Run the IntegerDefinition formatNumber(Long, int, boolean) method test
+     * for unsigned values.
+     */
+    @Test
+    public void testFormatNumber_unsignedLong() {
+
+        long unsignedLongValue = -64;
+        String result = IntegerDefinition.formatNumber(unsignedLongValue, 10, false);
+        // -64 + 2^64 = 18446744073709551552
+        assertEquals("18446744073709551552", result);
+
+        unsignedLongValue = -131940199973272L;
+        result = IntegerDefinition.formatNumber(unsignedLongValue, 10, false);
+        // -131940199973272l + 2^64 = 18446612133509578344
+        assertEquals("18446612133509578344", result);
+
+        unsignedLongValue = 123456789L;
+        result = IntegerDefinition.formatNumber(unsignedLongValue, 10, false);
+        assertEquals("123456789", result);
+    }
+
+    /**
+     * Run the IntegerDefinition formatNumber(Long, int, boolean) method test
+     * for signed values.
+     */
+    @Test
+    public void testFormatNumber_signedLong() {
+        long signedValue = -64L;
+        String result = IntegerDefinition.formatNumber(signedValue, 10, true);
+        assertEquals("-64", result);
+
+        signedValue = -131940199973272L;
+        result = IntegerDefinition.formatNumber(signedValue, 10, true);
+        assertEquals("-131940199973272", result);
+
+        signedValue = 123456789L;
+        result = IntegerDefinition.formatNumber(signedValue, 10, true);
+        assertEquals("123456789", result);
+    }
 }
index e76423679f57df7708923c40fc81031945264217..a5c826b81690007262582adb1e8cc86ee19e2fda 100644 (file)
@@ -2,14 +2,14 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.ctf.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.ctf.core.Activator
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.linuxtools.ctf.parser;bundle-version="1.0.0"
+ org.eclipse.linuxtools.ctf.parser;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.ctf.core.event,
  org.eclipse.linuxtools.ctf.core.event.io,
  org.eclipse.linuxtools.ctf.core.event.types,
index c6b69ca9fceccdee49dda26f7ad611c4097b896b..f7211f8db8846e5128534afb89c5a878f54dbe09 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Linux Tools CTF Core Plug-in</name>
   <groupId>org.eclipse.linuxtools.ctf</groupId>
   <artifactId>org.eclipse.linuxtools.ctf.core</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
  <build>
index e0718b2c240bb3e6a3c04f9902ce293c1b64c37f..f9680ee107687d3f1e82be00073673a379b91f93 100644 (file)
@@ -12,6 +12,7 @@
 
 package org.eclipse.linuxtools.ctf.core.event.types;
 
+import java.math.BigInteger;
 import java.nio.ByteOrder;
 
 import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
@@ -19,8 +20,8 @@ import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
 /**
  * A CTF integer definition.
  *
- * The definition of a integer basic data type. It will take the data
- * from a trace and store it (and make it fit) as a long.
+ * The definition of a integer basic data type. It will take the data from a
+ * trace and store it (and make it fit) as a long.
  *
  * @version 1.0
  * @author Matthew Khouzam
@@ -41,9 +42,13 @@ public class IntegerDefinition extends SimpleDatatypeDefinition {
 
     /**
      * Constructor
-     * @param declaration the parent declaration
-     * @param definitionScope the parent scope
-     * @param fieldName the field name
+     *
+     * @param declaration
+     *            the parent declaration
+     * @param definitionScope
+     *            the parent scope
+     * @param fieldName
+     *            the field name
      */
     public IntegerDefinition(IntegerDeclaration declaration,
             IDefinitionScope definitionScope, String fieldName) {
@@ -57,6 +62,7 @@ public class IntegerDefinition extends SimpleDatatypeDefinition {
 
     /**
      * Gets the value of the integer
+     *
      * @return the value of the integer (in long)
      */
     public long getValue() {
@@ -65,7 +71,9 @@ public class IntegerDefinition extends SimpleDatatypeDefinition {
 
     /**
      * Sets the value of an integer
-     * @param val the value
+     *
+     * @param val
+     *            the value
      */
     public void setValue(long val) {
         value = val;
@@ -76,8 +84,6 @@ public class IntegerDefinition extends SimpleDatatypeDefinition {
         return declaration;
     }
 
-
-
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -152,6 +158,54 @@ public class IntegerDefinition extends SimpleDatatypeDefinition {
             char c = (char) value;
             return Character.toString(c);
         }
-        return String.valueOf(value);
+        return formatNumber(value, declaration.getBase(), declaration.isSigned());
+    }
+
+    /**
+     * Print a numeric value as a string in a given base
+     *
+     * @param value
+     *            The value to print as string
+     * @param base
+     *            The base for this value
+     * @param signed
+     *            Is the value signed or not
+     * @return formatted number string
+     * @since 3.0
+     */
+    public static final String formatNumber(long value, int base, boolean signed) {
+        String s;
+        /* Format the number correctly according to the integer's base */
+        switch (base) {
+        case 2:
+            s = "0b" + Long.toBinaryString(value); //$NON-NLS-1$
+            break;
+        case 8:
+            s = "0" + Long.toOctalString(value); //$NON-NLS-1$
+            break;
+        case 16:
+            s = "0x" + Long.toHexString(value); //$NON-NLS-1$
+            break;
+        case 10:
+        default:
+            /* For non-standard base, we'll just print it as a decimal number */
+            if (!signed && value < 0) {
+                /*
+                 * Since there are no 'unsigned long', handle this case with
+                 * BigInteger
+                 */
+                BigInteger bigInteger = BigInteger.valueOf(value);
+                /*
+                 * we add 2^64 to the negative number to get the real unsigned
+                 * value
+                 */
+                bigInteger = bigInteger.add(BigInteger.valueOf(1).shiftLeft(64));
+                s = bigInteger.toString();
+            } else {
+                s = Long.toString(value);
+            }
+            break;
+        }
+        return s;
     }
 }
index 40b367710bbc2d9af996dbc0a883a53bb8dd6b24..925a6845847faef8b23712071fc163e1dea7d280 100644 (file)
@@ -9,6 +9,7 @@
  * Contributors:
  *     Matthew Khouzam - Initial API and implementation
  *     Alexandre Montplaisir - Initial API and implementation
+ *     Simon Delisle - Replace LinkedList by TreeSet in callsitesByName attribute
  *******************************************************************************/
 
 package org.eclipse.linuxtools.ctf.core.trace;
@@ -23,13 +24,11 @@ import java.nio.MappedByteBuffer;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileChannel.MapMode;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.ListIterator;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -47,6 +46,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.IDefinitionScope;
 import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
+import org.eclipse.linuxtools.internal.ctf.core.event.CTFCallsiteComparator;
 import org.eclipse.linuxtools.internal.ctf.core.event.metadata.exceptions.ParseException;
 import org.eclipse.linuxtools.internal.ctf.core.trace.StreamInputPacketIndex;
 
@@ -143,7 +143,9 @@ public class CTFTrace implements IDefinitionScope {
     private final Map<StreamInput, StreamInputPacketIndex> indexes = new HashMap<StreamInput, StreamInputPacketIndex>();
 
     /** Callsite helpers */
-    private Map<String, LinkedList<CTFCallsite>> callsitesByName = new HashMap<String, LinkedList<CTFCallsite>>();
+    private CTFCallsiteComparator ctfCallsiteComparator = new CTFCallsiteComparator();
+
+    private Map<String, TreeSet<CTFCallsite>> callsitesByName = new HashMap<String, TreeSet<CTFCallsite>>();
 
     /** Callsite helpers */
     private TreeSet<CTFCallsite> callsitesByIP = new TreeSet<CTFCallsite>();
@@ -852,37 +854,29 @@ public class CTFTrace implements IDefinitionScope {
             String fileName, long lineNumber) {
         final CTFCallsite cs = new CTFCallsite(eventName, funcName, ip,
                 fileName, lineNumber);
-        LinkedList<CTFCallsite> csl = callsitesByName.get(eventName);
+        TreeSet<CTFCallsite> csl = callsitesByName.get(eventName);
         if (csl == null) {
-            csl = new LinkedList<CTFCallsite>();
+            csl = new TreeSet<CTFCallsite>(ctfCallsiteComparator);
             callsitesByName.put(eventName, csl);
         }
 
-        ListIterator<CTFCallsite> iter = csl.listIterator();
-        int index = 0;
-        for (; index < csl.size(); index++) {
-            if (iter.next().compareTo(cs) < 0) {
-                break;
-            }
-        }
-
-        csl.add(index, cs);
+        csl.add(cs);
 
         callsitesByIP.add(cs);
     }
 
     /**
-     * Gets the list of callsites associated to an event name. O(1)
+     * Gets the set of callsites associated to an event name. O(1)
      *
      * @param eventName
      *            the event name
-     * @return the callsite list can be empty
-     * @since 1.2
+     * @return the callsite set can be empty
+     * @since 3.0
      */
-    public List<CTFCallsite> getCallsiteCandidates(String eventName) {
-        LinkedList<CTFCallsite> retVal = callsitesByName.get(eventName);
+    public TreeSet<CTFCallsite> getCallsiteCandidates(String eventName) {
+        TreeSet<CTFCallsite> retVal = callsitesByName.get(eventName);
         if (retVal == null) {
-            retVal = new LinkedList<CTFCallsite>();
+            retVal = new TreeSet<CTFCallsite>(ctfCallsiteComparator);
         }
         return retVal;
     }
@@ -896,9 +890,9 @@ public class CTFTrace implements IDefinitionScope {
      * @since 1.2
      */
     public CTFCallsite getCallsite(String eventName) {
-        LinkedList<CTFCallsite> callsites = callsitesByName.get(eventName);
+        TreeSet<CTFCallsite> callsites = callsitesByName.get(eventName);
         if (callsites != null) {
-            return callsites.getFirst();
+            return callsites.first();
         }
         return null;
     }
@@ -927,15 +921,14 @@ public class CTFTrace implements IDefinitionScope {
      * @return the closest matching callsite, can be null
      */
     public CTFCallsite getCallsite(String eventName, long ip) {
-        final LinkedList<CTFCallsite> candidates = callsitesByName.get(eventName);
+        final TreeSet<CTFCallsite> candidates = callsitesByName.get(eventName);
         final CTFCallsite dummyCs = new CTFCallsite(null, null, ip, null, -1);
-        final int pos = Collections.binarySearch(candidates, dummyCs) + 1;
-        if (pos >= candidates.size()) {
-            return null;
+        final CTFCallsite callsite = candidates.ceiling(dummyCs);
+        if (callsite == null) {
+            return candidates.floor(dummyCs);
         }
-        return candidates.get(pos);
+        return callsite;
     }
-
 }
 
 class MetadataFileFilter implements FileFilter {
index 5169e26b91ebb09a61ef2b09a76ec2ca83aed9da..a9258a86c2e6746d3dcc26570421661e351eb496 100644 (file)
@@ -174,7 +174,7 @@ public class StreamInputReader {
      * Gets the event definition hashmap for this StreamInput
      *
      * @return Unmodifiable map with the event definitions
-     * @since 2.1
+     * @since 3.0
      */
     public Map<Long, EventDefinition> getEventDefinitions() {
         return Collections.unmodifiableMap(eventDefs);
@@ -188,7 +188,7 @@ public class StreamInputReader {
      *            existing definition with the same id.
      * @param def
      *            The matching event definition
-     * @since 2.1
+     * @since 3.0
      */
     public void addEventDefinition(Long id, EventDefinition def) {
         eventDefs.put(id, def);
diff --git a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/CTFCallsiteComparator.java b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/CTFCallsiteComparator.java
new file mode 100644 (file)
index 0000000..ab36f0a
--- /dev/null
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *  Simon Delisle - Initial implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.ctf.core.event;
+
+import java.util.Comparator;
+
+import org.eclipse.linuxtools.ctf.core.event.CTFCallsite;
+
+/**
+ * Comparator for CTFCallsite
+ *
+ * @author Simon Delisle
+ * @since 3.0
+ *
+ */
+public class CTFCallsiteComparator implements Comparator<CTFCallsite> {
+
+    private static final long MASK32 = 0x00000000ffffffffL;
+
+    /*
+     * The callsites will be sorted by calling addresses. To do this we take IPs
+     * (instruction pointers) and compare them. Java only supports signed
+     * operation and since memory addresses are unsigned, we will convert the
+     * longs into integers that contain the high and low bytes and compare them.
+     */
+    @Override
+    public int compare(CTFCallsite o1, CTFCallsite o2) {
+        /*
+         * mask32 is 32 zeros followed by 32 ones, when we bitwise and this it
+         * will return the lower 32 bits
+         */
+
+        long other = o2.getIp();
+        /*
+         * To get a high int: we downshift by 32 and bitwise and with the mask
+         * to get rid of the sign
+         *
+         * To get the low int: we bitwise and with the mask.
+         */
+        long otherHigh = (other >> 32) & MASK32;
+        long otherLow = other & MASK32;
+        long ownHigh = (o1.getIp() >> 32) & MASK32;
+        long ownLow = o1.getIp() & MASK32;
+        /* are the high values different, if so ignore the lower values */
+        if (ownHigh > otherHigh) {
+            return 1;
+        }
+        if (ownHigh < otherHigh ) {
+            return -1;
+        }
+        /* the high values are the same, compare the lower values */
+        if (ownLow > otherLow) {
+            return 1;
+        }
+        if (ownLow < otherLow) {
+            return -1;
+        }
+        /* the values are identical */
+        return 0;
+    }
+
+}
index 4042466e17f375b13d4c22010a46a5685c12658b..009ef089e08660243aeb18337c1bf45bcda22bac 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.ctf.parser
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
index 543c0b15268d57a262e25ac94419a5d8b310b941..1979902ed50727bada481e22b64527f0b6ae76f3 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Linux Tools CTF Parser Plug-in</name>
   <groupId>org.eclipse.linuxtools.ctf</groupId>
   <artifactId>org.eclipse.linuxtools.ctf.parser</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <build>
index 32689464d2f25548b929d0c3de43dc1f09cc4be6..5f5179678a9f5b201ef0bbfaeadda5daf505c6cf 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.linuxtools.ctf"
       label="%featureName"
-      version="2.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
index 3b74f7bdb33d1a3fdb8514619a90fbfac2aebd62..be0086185b20e3334c489a83a397371c3e1ca4b8 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Linux Tools CTF (Common Trace Format) Feature</name>
   <artifactId>org.eclipse.linuxtools.ctf</artifactId>
   <groupId>org.eclipse.linuxtools.ctf</groupId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
 
   <packaging>eclipse-feature</packaging>
 
index 887aadcf0831bb9802cc2f89bbc78125dd8ed337..1fb7a378d5e8701ec7e35ad4b38dcd7cc65d83bd 100644 (file)
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.gdbtrace.core.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.gdbtrace.core;bundle-version="1.1.0"
+ org.eclipse.linuxtools.gdbtrace.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.gdbtrace.core.tests
index 6e939442fde88f8e286b7c1410f7e926599d9248..75d1020dbc01304209c15635bd932a24808b603e 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace.core.tests</artifactId>
   <groupId>org.eclipse.linuxtools.gdbtrace</groupId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis Core Tests Plug-in</name>
index 4a89fd1cdf5660d87611c82f8fdb79b6cc3240e4..8786d48a66c9e61c65016c07f311bd39688033e3 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.linuxtools.gdbtrace.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-Activator: org.eclipse.linuxtools.internal.gdbtrace.core.GdbTraceCorePlugin
 Require-Bundle: org.eclipse.core.runtime,
@@ -10,8 +10,8 @@ Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.ui.ide,
  org.eclipse.debug.core,
  org.eclipse.debug.ui,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-Vendor: %Bundle-Vendor
index c9c918f0f8809c3af21db85205f567723c3370d1..58ac47e8e94ca5f6f132c3543c8dc1d934ebc432 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace.core</artifactId>
   <groupId>org.eclipse.linuxtools.gdbtrace</groupId>
+<<<<<<< HEAD
+  <version>3.0.0-SNAPSHOT</version>
+=======
   <version>1.1.0-SNAPSHOT</version>
+>>>>>>> master
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis Core Plug-in</name>
index 9f49f3b68d082e6dcceb86ad58588cad311beea1..431930c33ddd8cf632d796a6c843fcfc4cb5a531 100644 (file)
@@ -31,10 +31,10 @@ import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
 
 /**
  * GDB Tracepoint extension of TmfTrace. This class implements the necessary
index de1dfe05914d49fb0bd77df8a45a3bdc89038bda..8b29ff494b495aaa8478abd813136cfbc14c9329 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.gdbtrace.help;singleton:=true
 Require-Bundle: org.eclipse.help
index e6b1a956fa695f8059409f0009d2cdf43a216fc0..33c2c691a7dd5db7a315f31b323f9fa3ca0c9276 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace.help</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis Help Plug-in</name>
index e96aa718c7576a37079b3c49c6bc8d6d8a8e5858..8e729ea5f94f7edc59317410d12f5260c1064d47 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.gdbtrace.ui.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
@@ -10,5 +10,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
  org.eclipse.ui,
- org.eclipse.linuxtools.gdbtrace.ui;bundle-version="1.1.0"
+ org.eclipse.linuxtools.gdbtrace.ui;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.gdbtrace.ui.tests
index 2cb9f5aafe47b6188ea0477e9057aa9e33234a52..7ae221ef9b9855138cb18e2db16244a70d5707cf 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace.ui.tests</artifactId>
   <groupId>org.eclipse.linuxtools.gdbtrace</groupId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis UI Tests Plug-in</name>
index f506ce32eed0b169964fa194d64783eb20792564..980bae69d4f22e6a843dcc93dcb5db4558dd28b5 100644 (file)
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
 Bundle-SymbolicName: org.eclipse.linuxtools.gdbtrace.ui;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-Activator: org.eclipse.linuxtools.internal.gdbtrace.ui.GdbTraceUIPlugin
 Require-Bundle: org.eclipse.core.runtime,
@@ -12,9 +12,9 @@ Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.ui.console,
  org.eclipse.ui.ide,
  org.eclipse.debug.ui,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="2.1.0",
- org.eclipse.linuxtools.gdbtrace.core;bundle-version="1.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0",
+ org.eclipse.linuxtools.gdbtrace.core;bundle-version="3.0.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.eclipse.linuxtools.internal.gdbtrace.ui;x-friends:="org.eclipse.linuxtools.gdbtrace.ui.tests",
index 054d3a444228325d2a06716fb6c78c5ffa7b826f..042281dea32de288b9a8dff97f1761269f671fb4 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace.ui</artifactId>
   <groupId>org.eclipse.linuxtools.gdbtrace</groupId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis UI Plug-in</name>
index 00a26a1229c6a8f7e7970ccbe0c4170b01975670..58338f28c2d774f0e7cda6849867b9a91d44dfb2 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.linuxtools.gdbtrace"
       label="%featureName"
-      version="1.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
@@ -37,9 +37,9 @@
       <import plugin="org.eclipse.cdt.dsf"/>
       <import plugin="org.eclipse.cdt.dsf.gdb"/>
       <import plugin="org.eclipse.cdt.dsf.gdb.ui"/>
-      <import plugin="org.eclipse.linuxtools.tmf.core" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.tmf.ui" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.gdbtrace.core" version="1.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.gdbtrace.core" version="3.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
index dbb5b3ddbedbd137b1922e48908b3f29ec04dab5..245f7f9b3744a1d5d97ccdd841d56125b57c8671 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.gdbtrace</artifactId>
   <groupId>org.eclipse.linuxtools.gdbtrace</groupId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <name>Linux Tools GDB Tracepoint Analysis Feature</name>
index 4503273437addc39a22674b07bfd12dfb3ba2d03..f100be9a3f41291085bc2a70fd983ee64d5d672e 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng.help; singleton:=true
 Require-Bundle: org.eclipse.help
index 938fe12baf03ecf6713a97701f0cec73f03a1df5..69e58ce55a2e4967ea7752f1f28611fce630b189 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng.help</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Help Plug-in</name>
index bbe60bdb4380016d7c23062b45eb849407521750..395da01b6eb174cb8165f564a87d231bd20952f6 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng.releng-site</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <name>Linux Tools LTTng Repository</name>
   <packaging>eclipse-repository</packaging>
 
index b9c2d4a4efcd32e8b105e95bd9f138d429bb8030..db015d99861589bded784b5dbc536beb59999388 100644 (file)
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.core.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.lttng2.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.lttng2.core.tests
index 4a0e84decf5b49d810ece5032f367eb40aa8c1a3..6edb0664ddd1f567e1f0a6692c447a5293649869 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.core.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng Core Tests Plug-in</name>
index 4d05ddc7b5a106c0fdbbf2c736cfbc31bdd87343..fdf605147985cdaed3ceeb0992aecb041f730315 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.core.Activator
index bd12565f4fdaf586fe82823b935d47a7a38f54ce..48e03a6f7860895702772cd19c4a00790e056994 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.core</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Core Plug-in</name>
index b13ebac3b33dabd71be1a844633057b999eaeb2b..adbf197ddc79b6428357ded88042b574263d8c27 100644 (file)
@@ -2,14 +2,14 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.core.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core.tests;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.lttng2.kernel.core.tests
index 8c2f82d04272df8fd0fbc547bcbda50622318bfa..4483b2e6c9c2206dc97b2d4b363d5d40f61a0e8a 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.kernel.core.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng Kernel Analysis Core Tests Plug-in</name>
index 6e374ae669f2392c6e81ea528dba74788a5bb6d6..7e84ee5353fe81a12ea505e892a6bca9d1bf53b6 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator
@@ -10,8 +10,8 @@ Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.linuxtools.ctf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.ctf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.core;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.kernel.core.tests",
  org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider;x-friends:="org.eclipse.linuxtools.lttng2.kernel.core.tests",
  org.eclipse.linuxtools.lttng2.kernel.core.trace
index 756792cd4e5b67114e24efbed8438452e4f6b78f..b6476317aed274b4b10f5baf474e49eb627e80a9 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.kernel.core</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Kernel Analysis Core Plug-in</name>
index c9d658179197d627e68fc6ee9991ba10d9eaf258..6ea09e1cbb6e376b56fb531cdd05394f769aec15 100644 (file)
@@ -91,8 +91,11 @@ public class LttngKernelTrace extends CtfTmfTrace {
         return validStatus;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
-    protected void buildStateSystem() throws TmfTraceException {
+    protected IStatus buildStateSystem() {
         super.buildStateSystem();
 
         /* Build the state system specific to LTTng kernel traces */
@@ -100,8 +103,13 @@ public class LttngKernelTrace extends CtfTmfTrace {
         final File htFile = new File(directory + HISTORY_TREE_FILE_NAME);
         final ITmfStateProvider htInput = new LttngKernelStateProvider(this);
 
-        ITmfStateSystem ss = TmfStateSystemFactory.newFullHistory(htFile, htInput, false);
-        fStateSystems.put(STATE_ID, ss);
+        try {
+            ITmfStateSystem ss = TmfStateSystemFactory.newFullHistory(htFile, htInput, false);
+            fStateSystems.put(STATE_ID, ss);
+        } catch (TmfTraceException e) {
+            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+        }
+        return Status.OK_STATUS;
     }
 
 }
index e3372101c08ec7785e18535eebc51dad7a8c7a41..955ca150affc01aba90b6355e81f05915b63f856 100644 (file)
@@ -29,12 +29,12 @@ public class Messages extends NLS {
     public static String LttngKernelTrace_DomainError;
     /**
      * Malformed trace (buffer overflow maybe?)
-     * @since 2.1
+     * @since 3.0
      */
     public static String LttngKernelTrace_MalformedTrace;
     /**
      * Trace read error
-     * @since 2.1
+     * @since 3.0
      */
     public static String LttngKernelTrace_TraceReadError;
 
index ff453f810ed2eb56980df1a4221f5c34b5134659..e917574461bf3410e714d6d381fba819744c836f 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.ui.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
@@ -10,5 +10,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
  org.eclipse.ui,
- org.eclipse.linuxtools.lttng2.kernel.ui;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.kernel.ui;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.lttng2.kernel.ui.tests
index a01bf407ff3b8767f42bf7a883d673877c780a6c..0cdf56b766e9a799091aad118e76ad120ae114e3 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.kernel.ui.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng Kernel Analysis UI Tests Plug-in</name>
index 6f157d89f88e3effcaf7f3bed09d2842826a85a2..aa69287ab20f25a32d3ead92007d83373e9f18c6 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.kernel.ui;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator
@@ -12,11 +12,11 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.ide,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.ui;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.ui;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.kernel.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.internal.lttng2.kernel.ui;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui.tests",
  org.eclipse.linuxtools.internal.lttng2.kernel.ui.viewers.events;x-internal:=true,
  org.eclipse.linuxtools.internal.lttng2.kernel.ui.views;x-internal:=true,
index f304b81b4ddcf1b5f47da82fb7ec0f700e8d8423..5ac6b5bb8c87c53372d6f29116761e9f587d4a13 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.kernel.ui</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Kernel Analysis UI Plug-in</name>
index 4190e61b58b34b7d12d8a700f17e60b84a30b678..eaeedba471822d11d4188620b49c724a4acd3f7f 100644 (file)
@@ -3,7 +3,7 @@
 <feature
       id="org.eclipse.linuxtools.lttng2.kernel"
       label="%featureName"
-      version="2.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
    <requires>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.core.resources"/>
-      <import plugin="org.eclipse.linuxtools.ctf.core" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.tmf.core" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.ctf.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.ui.ide"/>
-      <import plugin="org.eclipse.linuxtools.tmf.ui" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.lttng2.core" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.lttng2.ui" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.lttng2.kernel.core" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.lttng2.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.lttng2.ui" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.lttng2.kernel.core" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.help"/>
    </requires>
 
index 3da81c00ce5340d8cb5653febcb2e9fc5d6feb51..ccfbd533e0385ab13915c5108ba2a0d2419c9f31 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.kernel</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <name>Linux Tools LTTng Kernel Analysis Feature</name>
index 89931d6a44eec08b6a5ee12066691cf197e6e3b4..3a486057b2c128cde5ea2d06eef5dde659201e6d 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ui.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
@@ -12,8 +12,8 @@ Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
  org.eclipse.ui,
  org.eclipse.ui.ide,
- org.eclipse.linuxtools.lttng2.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.lttng2.ui;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.lttng2.ui;bundle-version="3.0.0"
 Import-Package: org.eclipse.rse.core,
  org.eclipse.rse.core.model,
  org.eclipse.rse.core.subsystems,
index 66a3cba8c0f8e36e95e9f42a2355001e39ec01a3..ee48b75cf6ccf82e821842a0ef6f26a6004347b5 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ui.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng UI Tests Plug-in</name>
index 42bc460e392b18c57f13a2d59947c6dba4164eb0..2bba394069ae4552bd15e6cbdef2de1396d8c988 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ui;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ui.Activator
@@ -12,9 +12,9 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.ide,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.lttng2.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.internal.lttng2.ui;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
  org.eclipse.linuxtools.internal.lttng2.ui.views.control;x-friends:="org.eclipse.linuxtools.lttng2.kernel.ui,org.eclipse.linuxtools.lttng2.ui.tests",
  org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;x-friends:="org.eclipse.linuxtools.lttng2.ui.tests",
index 8336bceb06111050e6c5af456cb25c82a5f9eb4e..da19e0043ddac663687b6fa8b7c25179f9ed553b 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ui</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng UI Plug-in</name>
index ff91d1d990c34c010c0274be70eeceff2c293cc5..b32f5181a1deb2cd6f3c2a75fe4841b4c9a5d059 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.core.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
index e706ece19afa9ded30d46f777f9dbd1d6b326677..7f4dcd45fddf2d86ec6092df3c5656561edad8b9 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ust.core.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng Userspace Tracer Analysis Core Test Plug-in</name>
index ad33466cdd12dc3d4bb9539a2d207cd34d500dc7..06ecec5654570989f5fab63e5d3eed5df3f743a2 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.core.Activator
@@ -12,5 +12,5 @@ Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.core;x-internal:=true
  org.eclipse.linuxtools.lttng2.ust.core.trace
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.linuxtools.ctf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.ctf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0"
index 447bd28c89dc91bea57dd3d141c8368dcc6a7a1d..80a9f9f3c9a0aad765f3136d8919582f40f62ebe 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ust.core</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Userspace Tracer Analysis Core Plug-in</name>
index 496e7f4779e8797f3add7b2ac81fd91292f43f76..c037c5c0408144b3858635c1af522867c324bcb9 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.ui.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
@@ -11,5 +11,5 @@ Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.ui,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.lttng2.ust.ui;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.ust.ui;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.lttng2.ust.ui.tests
index d418548c7a3dcd58cba162ab5e154a49906c38bd..be7e01c9d6052985be15dcfedf96c87d64f6698e 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ust.ui.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools LTTng Userspace Tracer Analysis UI Tests Plug-in</name>
index 73a026544c3b137a2f247c55cea32db4f8f228b8..44f3bbc19876b543662c775a6ab720c150669529 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.lttng2.ust.ui;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.lttng2.ust.ui.Activator
@@ -11,6 +11,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.core.resources,
  org.eclipse.core.runtime,
  org.eclipse.ui,
- org.eclipse.linuxtools.lttng2.ust.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.lttng2.ust.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.internal.lttng2.ust.ui;x-friends:="org.eclipse.linuxtools.lttng2.ust.ui.tests"
index 5690d4bc770be4ccafcf42fee282015a7a052854..47c2a54caaf268a9806a0aabe755f97449bc26bf 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ust.ui</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools LTTng Userspace Tracer Analysis UI Plug-in</name>
index 1d498b14db8ed84498922b8a37675528ef9087de..8f26c95ff2be0bde02e56b546641185491b3e59b 100644 (file)
@@ -3,7 +3,7 @@
 <feature
       id="org.eclipse.linuxtools.lttng2.ust"
       label="%featureName"
-      version="2.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
    <requires>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.core.resources"/>
-      <import plugin="org.eclipse.linuxtools.ctf.core" version="2.1.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.tmf.core" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.ctf.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.ui.ide"/>
-      <import plugin="org.eclipse.linuxtools.tmf.ui" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.help"/>
    </requires>
 
index f35d31e2dabd232d6312e42579ac05cbd9dae340..167412a842d194e1fd88d1c7e4da33962dc267d0 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2.ust</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <name>Linux Tools LTTng Userspace Tracer Analysis Feature</name>
index f5282429ccf84c0e116beaedbc7e8c37667d43f5..07ddb7c42dbe024829c4f9a2fa46c5564abf658f 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.linuxtools.lttng2"
       label="%featureName"
-      version="2.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
@@ -38,9 +38,9 @@
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.core.resources"/>
-      <import plugin="org.eclipse.linuxtools.lttng2.core" version="2.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.tmf.core" version="2.0.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.linuxtools.tmf.ui" version="2.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.lttng2.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.ui" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.help"/>
       <import feature="org.eclipse.rse" version="3.1.100" match="greaterOrEqual"/>
    </requires>
index 0a5b8cb83bab31402740114aa839d0082196a771..a795fa437f9df322a14cadc6a7beabbd915e11bd 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.lttng2</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <name>Linux Tools LTTng (Linux Tracing Toolkit) Feature</name>
index 9ae86ee5b2ca8c752e58e91d9770c62208739c26..9117e0a55af4a8b699d43e3b199112672cca066a 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.core.tests;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin
@@ -11,9 +11,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.ctf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.ctf.core.tests;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.ctf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.ctf.core.tests;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.tmf.core.tests,
  org.eclipse.linuxtools.tmf.core.tests.shared,
  org.eclipse.linuxtools.tmf.tests.stubs.trace;x-friends:="org.eclipse.linuxtools.tmf.ui.tests"
index 8d96271b0ec822219fb3122aafa783fe48379ea0..9cb123e5eb313459507a170c20192b31bad42d11 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.core.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools TMF Core Tests Plug-in</name>
index 7723e75a802de6f1aa44ea67af1640cc6d337820..56ea7f2826800829105648b81a81f235e07627aa 100644 (file)
@@ -30,6 +30,8 @@ import org.junit.runners.Suite;
     org.eclipse.linuxtools.tmf.core.tests.statesystem.AllTests.class,
     org.eclipse.linuxtools.tmf.core.tests.statistics.AllTests.class,
     org.eclipse.linuxtools.tmf.core.tests.trace.AllTests.class,
+    org.eclipse.linuxtools.tmf.core.tests.trace.indexer.checkpoint.AllTests.class,
+    org.eclipse.linuxtools.tmf.core.tests.trace.location.AllTests.class,
     org.eclipse.linuxtools.tmf.core.tests.uml2sd.AllTests.class,
     org.eclipse.linuxtools.tmf.core.tests.util.AllTests.class
 })
index f393286cb9b9d35090c956bed79641cfcb641c10..70027e9bb1f16e3459d9246f5b4b3d87431802d3 100644 (file)
@@ -22,6 +22,7 @@ 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.request.TmfEventRequest;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
 import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfStartSynchSignal;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
@@ -98,7 +99,6 @@ public class TmfEventProviderTest {
      */
     @Test
     public void testGetPlainEvents() {
-        final int BLOCK_SIZE = 100;
         final int NB_EVENTS = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
@@ -108,7 +108,8 @@ public class TmfEventProviderTest {
         ITmfDataProvider provider = eventProviders[0];
 
         TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, BLOCK_SIZE) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -138,8 +139,6 @@ public class TmfEventProviderTest {
      */
     @Test
     public void testCancelRequests() {
-
-        final int BLOCK_SIZE = 100;
         final int NB_EVENTS = 1000;
         final int NUMBER_EVENTS_BEFORE_CANCEL_REQ1 = 10;
         final int NUMBER_EVENTS_BEFORE_CANCEL_REQ2 = 800;
@@ -155,7 +154,8 @@ public class TmfEventProviderTest {
         TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
 
         // Create first request
-        final TmfEventRequest request1 = new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, BLOCK_SIZE) {
+        final TmfEventRequest request1 = new TmfEventRequest(ITmfEvent.class,
+                range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -182,7 +182,8 @@ public class TmfEventProviderTest {
         assertFalse("isRunning", request1.isRunning());
 
         // Create second request
-        final TmfEventRequest request2 = new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, BLOCK_SIZE) {
+        final TmfEventRequest request2 = new TmfEventRequest(ITmfEvent.class,
+                range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -246,7 +247,7 @@ public class TmfEventProviderTest {
     }
 
     private static void getSyntheticData(final TmfTimeRange range,
-            final int nbEvents, final int blockSize) throws InterruptedException {
+            final int nbEvents) throws InterruptedException {
 
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
@@ -256,7 +257,7 @@ public class TmfEventProviderTest {
         ITmfDataProvider provider = eventProviders[0];
 
         final TmfEventRequest request = new TmfEventRequest(TmfSyntheticEventStub.class, range,
-                nbEvents, blockSize) {
+                0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -288,33 +289,7 @@ public class TmfEventProviderTest {
     public void testGetSyntheticEvents_EqualBlockSizes() {
         TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
         try {
-            getSyntheticData(range, 1000, TmfSyntheticEventProviderStub.BLOCK_SIZE);
-        } catch (InterruptedException e) {
-            fail();
-        }
-    }
-
-    /**
-     * Test getSyntheticEvents for smaller block sizes.
-     */
-    @Test
-    public void testGetSyntheticEvents_SmallerBlock() {
-        TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        try {
-            getSyntheticData(range, 1000, TmfSyntheticEventProviderStub.BLOCK_SIZE / 2);
-        } catch (InterruptedException e) {
-            fail();
-        }
-    }
-
-    /**
-     * Test getSyntheticEvents for larger block sizes.
-     */
-    @Test
-    public void testGetSyntheticEvents_LargerBlock() {
-        TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        try {
-            getSyntheticData(range, 1000, TmfSyntheticEventProviderStub.BLOCK_SIZE * 2);
+            getSyntheticData(range, 1000);
         } catch (InterruptedException e) {
             fail();
         }
@@ -329,7 +304,7 @@ public class TmfEventProviderTest {
         TmfTimestamp end = new TmfTimestamp(1000, (byte) -3, 0);
         TmfTimeRange range = new TmfTimeRange(start, end);
         try {
-            getSyntheticData(range, -1, TmfSyntheticEventProviderStub.BLOCK_SIZE);
+            getSyntheticData(range, -1);
         } catch (InterruptedException e) {
             fail();
         }
index d322e15e69685c37e34b7f7fac486571051eca1b..31d1d86d9af74bedae72e8bb936d9395027fd611 100644 (file)
@@ -194,45 +194,4 @@ public class CtfTmfEventFieldTest {
         CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
         assertEquals("test=float=9.551467814359616E-38", result.toString());
     }
-
-    /**
-     * Run the CtfTmfEventField formatNumber(Long, int, boolean) method test for
-     * unsigned values.
-     */
-    @Test
-    public void testFormatNumber_unsignedLong() {
-
-        long unsignedLongValue = -64;
-        String result = CtfTmfEventField.formatNumber(unsignedLongValue, 10, false);
-        // -64 + 2^64 = 18446744073709551552
-        assertEquals("18446744073709551552", result);
-
-        unsignedLongValue = -131940199973272L;
-        result = CtfTmfEventField.formatNumber(unsignedLongValue, 10, false);
-        // -131940199973272l + 2^64 = 18446612133509578344
-        assertEquals("18446612133509578344", result);
-
-        unsignedLongValue = 123456789L;
-        result = CtfTmfEventField.formatNumber(unsignedLongValue, 10, false);
-        assertEquals("123456789", result);
-    }
-
-    /**
-     * Run the CtfTmfEventField formatNumber(Long, int, boolean) method test for
-     * signed values.
-     */
-    @Test
-    public void testFormatNumber_signedLong() {
-        long signedValue = -64L;
-        String result = CtfTmfEventField.formatNumber(signedValue, 10, true);
-        assertEquals("-64", result);
-
-        signedValue = -131940199973272L;
-        result = CtfTmfEventField.formatNumber(signedValue, 10, true);
-        assertEquals("-131940199973272", result);
-
-        signedValue = 123456789L;
-        result = CtfTmfEventField.formatNumber(signedValue, 10, true);
-        assertEquals("123456789", result);
-    }
 }
index 1b6cb640610e2eb6299caf2eefa4f1c76925426b..5278a3978b1f3336a51aab0c2503ab95410c08a4 100644 (file)
@@ -125,6 +125,26 @@ public class CtfTmfEventTest {
         assertArrayEquals(fields2, fields);
     }
 
+    /**
+     * Run the ITmfEventField getSubFieldValue(String[]) method test.
+     */
+    @Test
+    public void testGetSubFieldValue() {
+        /* Field exists */
+        String[] names = { "pid" };
+        assertNotNull(fixture.getContent().getSubField(names));
+
+        /* First field exists, not the second */
+        String[] names2 = { "pid", "abcd" };
+        assertNull(fixture.getContent().getSubField(names2));
+
+        /* Both field do not exist */
+        String[] names3 = { "pfid", "abcd" };
+        assertNull(fixture.getContent().getSubField(names3));
+
+        /* TODO Missing case of embedded field, need event for it */
+    }
+
     /**
      * Run the long getID() method test.
      */
index 913e465d56ed6b2dcd37176ce58ea751feb3e533..235be8b825e36d7a13ae2e72369093f085e82018 100644 (file)
@@ -364,4 +364,14 @@ public class CtfTmfTraceTest {
         assertTrue(fixture.hasAtLeastOneOfEvents(names));
         assertFalse(fixture.hasAllEvents(names));
     }
+
+    /**
+     * Run the String getHostId() method test
+     */
+    @Test
+    public void testCtfHostId() {
+        String a = fixture.getHostId();
+        assertEquals("\"84db105b-b3f4-4821-b662-efc51455106a\"", a);
+    }
+
 }
index 6aeb2b015457427e59fde3628298ae42f6a75f3d..d59a5014e070aca548552f46b8008622f30b18d5 100644 (file)
@@ -227,7 +227,7 @@ public class EventContextTest {
         public EventContextTestRequest(long timestamp) {
             super(CtfTmfEvent.class,
                     new TmfTimeRange(new CtfTmfTimestamp(timestamp), TmfTimestamp.BIG_CRUNCH),
-                    0, 1, 1, ExecutionType.FOREGROUND);
+                    0, 1, ExecutionType.FOREGROUND);
         }
 
         @Override
index 540386c1759b10cf1489901741b8cbb0b2ed572f..ecd8d38fd7bef77bb1396e100ff7aaebade3f3d6 100644 (file)
@@ -30,7 +30,7 @@ public class RequestBenchmark extends TmfEventRequest {
 
     private RequestBenchmark(final Class<? extends ITmfEvent> dataType,
             final TmfTimeRange range, final int nbRequested) {
-        super(dataType, range, nbRequested, 1);
+        super(dataType, range, 0, nbRequested, ExecutionType.FOREGROUND);
     }
 
     // Path of the trace
index 5a22bc6b36e25cbbcf10b90c4c71a8ef89aebfed..2f83a2f727739a614cb162dab3d5a8757c760ad7 100644 (file)
@@ -96,7 +96,7 @@ public class TmfEventTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
             final File test = new File(FileLocator.toFileURL(location).toURI());
-            trace = new TmfTraceStub(test.toURI().getPath(), 500, false);
+            trace = new TmfTraceStub(test.toURI().getPath(), 500, false, null, null);
         } catch (final TmfTraceException e) {
             e.printStackTrace();
         } catch (final URISyntaxException e) {
index 5479df307c220dfda17e65965f523d4e0465f2a6..6869cc84765b4a4e48cf041b14f336b109bc7ed9 100644 (file)
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
 import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
 import org.eclipse.linuxtools.tmf.tests.stubs.request.TmfDataRequestStub;
 import org.junit.Before;
 import org.junit.Test;
@@ -52,20 +53,20 @@ public class TmfCoalescedDataRequestTest {
     @Before
     public void setUp() {
         TmfDataRequest.reset();
-        fRequest1 = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        fRequest2 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 100, 200);
-        fRequest3 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 200, 200);
-        fRequest4 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 200, 300);
+        fRequest1 = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        fRequest2 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 100, ExecutionType.FOREGROUND);
+        fRequest3 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 200, ExecutionType.FOREGROUND);
+        fRequest4 = new TmfCoalescedDataRequest(ITmfEvent.class, 20, 200, ExecutionType.FOREGROUND);
 
-        fRequest1b = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        fRequest1c = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
+        fRequest1b = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        fRequest1c = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
 
         fRequestCount = fRequest1c.getRequestId() + 1;
     }
 
     private static TmfCoalescedDataRequest setupTestRequest(final boolean[] flags) {
 
-        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200) {
+        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND) {
             @Override
             public void handleCompleted() {
                 super.handleCompleted();
@@ -94,63 +95,12 @@ public class TmfCoalescedDataRequestTest {
     }
 
     // ------------------------------------------------------------------------
-    // Constructors
+    // Constructor
     // ------------------------------------------------------------------------
 
-    @Test
-    public void testTmfCoalescedDataRequest() {
-        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getIndex", 0, request.getIndex());
-        assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
-    @Test
-    public void testTmfCoalescedDataRequestIndex() {
-        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getIndex", 10, request.getIndex());
-        assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
-    @Test
-    public void testTmfCoalescedDataRequestIndexNbRequested() {
-        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getIndex", 10, request.getIndex());
-        assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
     @Test
     public void testTmfCoalescedDataRequestIndexNbEventsBlocksize() {
-        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
+        TmfCoalescedDataRequest request = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
 
         assertEquals("getRequestId", fRequestCount++, request.getRequestId());
         assertEquals("getDataType", ITmfEvent.class, request.getDataType());
@@ -219,10 +169,10 @@ public class TmfCoalescedDataRequestTest {
 
     @Test
     public void testToString() {
-        String expected1 = "[TmfCoalescedDataRequest(0,ITmfEvent,FOREGROUND,10,100,200, [])]";
-        String expected2 = "[TmfCoalescedDataRequest(1,ITmfEvent,FOREGROUND,20,100,200, [])]";
-        String expected3 = "[TmfCoalescedDataRequest(2,ITmfEvent,FOREGROUND,20,200,200, [])]";
-        String expected4 = "[TmfCoalescedDataRequest(3,ITmfEvent,FOREGROUND,20,200,300, [])]";
+        String expected1 = "[TmfCoalescedDataRequest(0,ITmfEvent,FOREGROUND,10,100, [])]";
+        String expected2 = "[TmfCoalescedDataRequest(1,ITmfEvent,FOREGROUND,20,100, [])]";
+        String expected3 = "[TmfCoalescedDataRequest(2,ITmfEvent,FOREGROUND,20,200, [])]";
+        String expected4 = "[TmfCoalescedDataRequest(3,ITmfEvent,FOREGROUND,20,200, [])]";
 
         assertEquals("toString", expected1, fRequest1.toString());
         assertEquals("toString", expected2, fRequest2.toString());
@@ -236,15 +186,15 @@ public class TmfCoalescedDataRequestTest {
 
     @Test
     public void testIsCompatible() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request2 = new TmfDataRequestStub(ITmfEvent.class, 5, 100, 200);
-        TmfDataRequest request3 = new TmfDataRequestStub(ITmfEvent.class, 5, 4, 200);
-        TmfDataRequest request4 = new TmfDataRequestStub(ITmfEvent.class, 5, 5, 200);
-        TmfDataRequest request5 = new TmfDataRequestStub(ITmfEvent.class, 15, 100, 200);
-        TmfDataRequest request6 = new TmfDataRequestStub(ITmfEvent.class, 100, 100, 200);
-        TmfDataRequest request7 = new TmfDataRequestStub(ITmfEvent.class, 110, 100, 200);
-        TmfDataRequest request8 = new TmfDataRequestStub(ITmfEvent.class, 111, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        TmfDataRequest request2 = new TmfDataRequestStub(ITmfEvent.class, 5, 100);
+        TmfDataRequest request3 = new TmfDataRequestStub(ITmfEvent.class, 5, 4);
+        TmfDataRequest request4 = new TmfDataRequestStub(ITmfEvent.class, 5, 5);
+        TmfDataRequest request5 = new TmfDataRequestStub(ITmfEvent.class, 15, 100);
+        TmfDataRequest request6 = new TmfDataRequestStub(ITmfEvent.class, 100, 100);
+        TmfDataRequest request7 = new TmfDataRequestStub(ITmfEvent.class, 110, 100);
+        TmfDataRequest request8 = new TmfDataRequestStub(ITmfEvent.class, 111, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request1));
         assertTrue("isCompatible", coalescedRequest.isCompatible(request2));
@@ -255,8 +205,8 @@ public class TmfCoalescedDataRequestTest {
         assertTrue("isCompatible", coalescedRequest.isCompatible(request7));
         assertTrue("isCompatible", coalescedRequest.isCompatible(request8));
 
-        TmfDataRequest request9  = new TmfDataRequestStub(ITmfEvent.class,   5,   3, 200);
-        TmfDataRequest request10 = new TmfDataRequestStub(ITmfEvent.class, 112, 100, 200);
+        TmfDataRequest request9  = new TmfDataRequestStub(ITmfEvent.class,   5,   3);
+        TmfDataRequest request10 = new TmfDataRequestStub(ITmfEvent.class, 112, 100);
 
         assertFalse("isCompatible", coalescedRequest.isCompatible(request9));
         assertFalse("isCompatible", coalescedRequest.isCompatible(request10));
@@ -268,98 +218,90 @@ public class TmfCoalescedDataRequestTest {
 
     @Test
     public void testAddRequest1() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 10, coalescedRequest.getIndex());
         assertEquals("addRequest", 100, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest2() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 5, coalescedRequest.getIndex());
         assertEquals("addRequest", 105, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest3() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 4, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 4);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 5, coalescedRequest.getIndex());
         assertEquals("addRequest", 105, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest4() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 5, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 5, 5);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 5, coalescedRequest.getIndex());
         assertEquals("addRequest", 105, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest5() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class,  15, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class,  15, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 10, coalescedRequest.getIndex());
         assertEquals("addRequest", 105, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest6() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 100, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 100, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 10, coalescedRequest.getIndex());
         assertEquals("addRequest", 190, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest7() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 110, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 110, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 10, coalescedRequest.getIndex());
         assertEquals("addRequest", 200, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     @Test
     public void testAddRequest8() {
-        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 111, 100, 200);
+        TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(ITmfEvent.class, 10, 100, ExecutionType.FOREGROUND);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 111, 100);
 
         assertTrue("isCompatible", coalescedRequest.isCompatible(request));
         coalescedRequest.addRequest(request);
         assertEquals("addRequest", 10, coalescedRequest.getIndex());
         assertEquals("addRequest", 201, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
     }
 
     // ------------------------------------------------------------------------
@@ -371,8 +313,8 @@ public class TmfCoalescedDataRequestTest {
         // Test request
         final boolean[] crFlags = new boolean[4];
         TmfCoalescedDataRequest request = setupTestRequest(crFlags);
-        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
         request.addRequest(subRequest1);
         request.addRequest(subRequest2);
 
@@ -407,8 +349,8 @@ public class TmfCoalescedDataRequestTest {
     public void testFail() {
         final boolean[] crFlags = new boolean[4];
         TmfCoalescedDataRequest request = setupTestRequest(crFlags);
-        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
         request.addRequest(subRequest1);
         request.addRequest(subRequest2);
 
@@ -443,8 +385,8 @@ public class TmfCoalescedDataRequestTest {
     public void testCancel() {
         final boolean[] crFlags = new boolean[4];
         TmfCoalescedDataRequest request = setupTestRequest(crFlags);
-        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
         request.addRequest(subRequest1);
         request.addRequest(subRequest2);
 
@@ -479,8 +421,8 @@ public class TmfCoalescedDataRequestTest {
     public void testCancelSubRequests() {
         final boolean[] crFlags = new boolean[4];
         TmfCoalescedDataRequest request = setupTestRequest(crFlags);
-        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfDataRequest subRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        TmfDataRequest subRequest2 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
         request.addRequest(subRequest1);
         request.addRequest(subRequest2);
 
index 55b457f9a7852c050d2e7575653d4c9b8edb054e..807117108992e006367dff0b095a0c1469b87ebc 100644 (file)
@@ -75,20 +75,20 @@ public class TmfCoalescedEventRequestTest {
     @Before
     public void setUp() {
         TmfDataRequest.reset();
-        fRequest1 = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200);
-        fRequest2 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 100, 200);
-        fRequest3 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 200, 200);
-        fRequest4 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 200, 300);
+        fRequest1 = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND);
+        fRequest2 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 0, 100, ExecutionType.FOREGROUND);
+        fRequest3 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 0, 200, ExecutionType.FOREGROUND);
+        fRequest4 = new TmfCoalescedEventRequest(ITmfEvent.class, range2, 0, 200, ExecutionType.FOREGROUND);
 
-        fRequest1b = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200);
-        fRequest1c = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200);
+        fRequest1b = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND);
+        fRequest1c = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND);
 
         fRequestCount = fRequest1c.getRequestId() + 1;
     }
 
     private TmfCoalescedEventRequest setupTestRequest(final boolean[] flags) {
 
-        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200) {
+        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND) {
             @Override
             public void handleCompleted() {
                 super.handleCompleted();
@@ -117,62 +117,12 @@ public class TmfCoalescedEventRequestTest {
     }
 
     // ------------------------------------------------------------------------
-    // Constructors
+    // Constructor
     // ------------------------------------------------------------------------
 
-    @Test
-    public void testTmfCoalescedEventRequest() {
-        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getRange", range1, request.getRange());
-        assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
-    @Test
-    public void testTmfCoalescedEventRequestIndex() {
-        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getRange", range1, request.getRange());
-        assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
-    public void testTmfCoalescedEventRequestIndexNbRequested() {
-        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100);
-
-        assertEquals("getRequestId", fRequestCount++, request.getRequestId());
-        assertEquals("getDataType", ITmfEvent.class, request.getDataType());
-
-        assertEquals("getRange", range1, request.getRange());
-        assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
-
-        assertFalse("isCompleted", request.isCompleted());
-        assertFalse("isFailed", request.isFailed());
-        assertFalse("isCancelled", request.isCancelled());
-
-        assertEquals("getNbRead", 0, request.getNbRead());
-    }
-
     @Test
     public void testTmfCoalescedEventRequestIndexNbEventsBlocksize() {
-        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200);
+        TmfCoalescedEventRequest request = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND);
 
         assertEquals("getRequestId", fRequestCount++, request.getRequestId());
         assertEquals("getDataType", ITmfEvent.class, request.getDataType());
@@ -227,11 +177,20 @@ public class TmfCoalescedEventRequestTest {
     @Test
     public void testEqualsSuper() {
         TmfCoalescedDataRequest dataRequest1 = new TmfCoalescedDataRequest(
-                fRequest1.getDataType(), fRequest1.getIndex(), fRequest1.getNbRequested());
+                fRequest1.getDataType(),
+                fRequest1.getIndex(),
+                fRequest1.getNbRequested(),
+                ExecutionType.FOREGROUND);
         TmfCoalescedDataRequest dataRequest2 = new TmfCoalescedDataRequest(
-                fRequest1.getDataType(), fRequest1.getIndex(), fRequest1.getNbRequested());
+                fRequest1.getDataType(),
+                fRequest1.getIndex(),
+                fRequest1.getNbRequested(),
+                ExecutionType.FOREGROUND);
         TmfCoalescedDataRequest dataRequest3 = new TmfCoalescedDataRequest(
-                fRequest3.getDataType(), fRequest3.getIndex(), fRequest3.getNbRequested());
+                fRequest3.getDataType(),
+                fRequest3.getIndex(),
+                fRequest3.getNbRequested(),
+                ExecutionType.FOREGROUND);
 
         assertTrue("equals", fRequest1.equals(dataRequest2));
         assertTrue("equals", fRequest2.equals(dataRequest1));
@@ -256,10 +215,10 @@ public class TmfCoalescedEventRequestTest {
 
     @Test
     public void testToString() {
-        String expected1 = "[TmfCoalescedEventRequest(0,ITmfEvent,FOREGROUND," + range1 + ",0,100,200, [])]";
-        String expected2 = "[TmfCoalescedEventRequest(1,ITmfEvent,FOREGROUND," + range2 + ",0,100,200, [])]";
-        String expected3 = "[TmfCoalescedEventRequest(2,ITmfEvent,FOREGROUND," + range2 + ",0,200,200, [])]";
-        String expected4 = "[TmfCoalescedEventRequest(3,ITmfEvent,FOREGROUND," + range2 + ",0,200,300, [])]";
+        String expected1 = "[TmfCoalescedEventRequest(0,ITmfEvent,FOREGROUND," + range1 + ",0,100, [])]";
+        String expected2 = "[TmfCoalescedEventRequest(1,ITmfEvent,FOREGROUND," + range2 + ",0,100, [])]";
+        String expected3 = "[TmfCoalescedEventRequest(2,ITmfEvent,FOREGROUND," + range2 + ",0,200, [])]";
+        String expected4 = "[TmfCoalescedEventRequest(3,ITmfEvent,FOREGROUND," + range2 + ",0,200, [])]";
 
         assertEquals("toString", expected1, fRequest1.toString());
         assertEquals("toString", expected2, fRequest2.toString());
@@ -273,7 +232,7 @@ public class TmfCoalescedEventRequestTest {
 
     @Test
     public void testIsCompatible() {
-        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 100, 200);
+        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 100, ExecutionType.FOREGROUND);
         TmfEventRequest req1 = new TmfEventRequestStub(ITmfEvent.class, range1, 100, 200);
         TmfEventRequest req2 = new TmfEventRequestStub(ITmfEvent.class, range2, 100, 200);
         TmfEventRequest req3 = new TmfEventRequestStub(ITmfEvent.class, range1, 101, 200);
@@ -289,7 +248,7 @@ public class TmfCoalescedEventRequestTest {
 
     @Test
     public void testAddEvent1() {
-        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 2147483647, 200, ExecutionType.FOREGROUND);
+        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 0, 2147483647, ExecutionType.FOREGROUND);
         TmfEventRequest req1 = new TmfEventRequestStub(ITmfEvent.class, range1, 0, 2147483647, 200);
         TmfEventRequest req2 = new TmfEventRequestStub(ITmfEvent.class, range1, 1, 2147483647, 200);
 
@@ -301,13 +260,11 @@ public class TmfCoalescedEventRequestTest {
 
         assertEquals("addRequest", 0, coalescedRequest.getIndex());
         assertEquals("addRequest", 2147483647, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
-
     }
 
     @Test
     public void testAddEvent2() {
-        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 1, 2147483647, 200, ExecutionType.FOREGROUND);
+        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(ITmfEvent.class, range1, 1, 2147483647, ExecutionType.FOREGROUND);
         TmfEventRequest req1 = new TmfEventRequestStub(ITmfEvent.class, range1, 1, 2147483647, 200);
         TmfEventRequest req2 = new TmfEventRequestStub(ITmfEvent.class, range1, 0, 2147483647, 200);
 
@@ -319,8 +276,6 @@ public class TmfCoalescedEventRequestTest {
 
         assertEquals("addRequest", 0, coalescedRequest.getIndex());
         assertEquals("addRequest", 2147483647, coalescedRequest.getNbRequested());
-        assertEquals("addRequest", 200, coalescedRequest.getBlockSize());
-
     }
 
     // ------------------------------------------------------------------------
@@ -439,7 +394,6 @@ public class TmfCoalescedEventRequestTest {
     private static final String DIRECTORY = "testfiles";
     private static final String TEST_STREAM = "A-Test-10K";
     private static final int NB_EVENTS = 5000;
-    private static final int BLOCK_SIZE = 100;
 
     // Initialize the test trace
     private TmfTraceStub fTrace = null;
@@ -449,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);
+                fTrace = new TmfTraceStub(test.getPath(), 500, false, null, null);
             } catch (TmfTraceException e) {
                 e.printStackTrace();
             } catch (URISyntaxException e) {
@@ -489,14 +443,14 @@ public class TmfCoalescedEventRequestTest {
         final long REQUEST_OFFSET = 1000;
 
         requestedEvents1 = new Vector<ITmfEvent>();
-        request1 = new TmfEventRequest(ITmfEvent.class, range, signal.fIndex, NB_EVENTS, BLOCK_SIZE) {
-               int nbRead = 0;
+        request1 = new TmfEventRequest(ITmfEvent.class, range, signal.fIndex,
+                NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
                 if (!isCompleted()) {
                     requestedEvents1.add(event);
-                    if (++nbRead >= BLOCK_SIZE && signal.forceCancel) {
+                    if (signal.forceCancel) {
                         cancel();
                     }
                 }
@@ -504,7 +458,8 @@ public class TmfCoalescedEventRequestTest {
         };
 
         requestedEvents2 = new Vector<ITmfEvent>();
-        request2 = new TmfEventRequest(ITmfEvent.class, range, signal.fIndex + REQUEST_OFFSET, NB_EVENTS, BLOCK_SIZE) {
+        request2 = new TmfEventRequest(ITmfEvent.class, range,
+                signal.fIndex + REQUEST_OFFSET, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -515,7 +470,8 @@ public class TmfCoalescedEventRequestTest {
         };
 
         requestedEvents3 = new Vector<ITmfEvent>();
-        request3 = new TmfEventRequest(ITmfEvent.class, range, signal.fIndex + 2 * REQUEST_OFFSET, NB_EVENTS, BLOCK_SIZE) {
+        request3 = new TmfEventRequest(ITmfEvent.class, range,
+                signal.fIndex + 2 * REQUEST_OFFSET, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(ITmfEvent event) {
                 super.handleData(event);
@@ -590,7 +546,6 @@ public class TmfCoalescedEventRequestTest {
         request2.waitForCompletion();
         request3.waitForCompletion();
 
-        assertEquals("Request1: nbEvents", BLOCK_SIZE, requestedEvents1.size());
         assertTrue("Request1: isCompleted", request1.isCompleted());
         assertTrue("Request1: isCancelled", request1.isCancelled());
 
@@ -604,9 +559,6 @@ public class TmfCoalescedEventRequestTest {
 
         // Ensure that we have distinct events.
         // Don't go overboard: we are not validating the stub!
-        for (int i = 0; i < BLOCK_SIZE; i++) {
-            assertEquals("Distinct events", i + 1 + request1.getIndex(), requestedEvents1.get(i).getTimestamp().getValue());
-        }
         for (int i = 0; i < NB_EVENTS; i++) {
             assertEquals("Distinct events", i + 1 + request2.getIndex(), requestedEvents2.get(i).getTimestamp().getValue());
             assertEquals("Distinct events", i + 1 + request3.getIndex(), requestedEvents3.get(i).getTimestamp().getValue());
index 520649a1dfe0d768c0c45109bdaf28d55ddb36c9..b42c0be66727e7adc2bebd919125bbe1a52e534e 100644 (file)
@@ -49,18 +49,18 @@ public class TmfDataRequestTest {
     @Before
     public void setUp() {
         TmfDataRequest.reset();
-        fRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        fRequest2 = new TmfDataRequestStub(ITmfEvent.class, 20, 100, 200);
-        fRequest3 = new TmfDataRequestStub(ITmfEvent.class, 20, 200, 200);
-        fRequest4 = new TmfDataRequestStub(ITmfEvent.class, 20, 200, 300);
-        fRequest1b = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
-        fRequest1c = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        fRequest1 = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        fRequest2 = new TmfDataRequestStub(ITmfEvent.class, 20, 100);
+        fRequest3 = new TmfDataRequestStub(ITmfEvent.class, 20, 200);
+        fRequest4 = new TmfDataRequestStub(ITmfEvent.class, 20, 200);
+        fRequest1b = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
+        fRequest1c = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
         fRequestCount = fRequest1c.getRequestId() + 1;
     }
 
     private static TmfDataRequest setupTestRequest(final boolean[] flags) {
 
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200) {
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100) {
             @Override
             public void handleCompleted() {
                 super.handleCompleted();
@@ -145,7 +145,7 @@ public class TmfDataRequestTest {
 
     @Test
     public void testTmfDataRequestIndexNbEventsBlocksize() {
-        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100, 200);
+        TmfDataRequest request = new TmfDataRequestStub(ITmfEvent.class, 10, 100);
 
         assertEquals("getRequestId", fRequestCount++, request.getRequestId());
         assertEquals("getDataType", ITmfEvent.class, request.getDataType());
@@ -214,10 +214,10 @@ public class TmfDataRequestTest {
 
     @Test
     public void testToString() {
-        String expected1 = "[TmfDataRequestStub(0,ITmfEvent,FOREGROUND,10,100,200)]";
-        String expected2 = "[TmfDataRequestStub(1,ITmfEvent,FOREGROUND,20,100,200)]";
-        String expected3 = "[TmfDataRequestStub(2,ITmfEvent,FOREGROUND,20,200,200)]";
-        String expected4 = "[TmfDataRequestStub(3,ITmfEvent,FOREGROUND,20,200,300)]";
+        String expected1 = "[TmfDataRequestStub(0,ITmfEvent,FOREGROUND,10,100)]";
+        String expected2 = "[TmfDataRequestStub(1,ITmfEvent,FOREGROUND,20,100)]";
+        String expected3 = "[TmfDataRequestStub(2,ITmfEvent,FOREGROUND,20,200)]";
+        String expected4 = "[TmfDataRequestStub(3,ITmfEvent,FOREGROUND,20,200)]";
 
         assertEquals("toString", expected1, fRequest1.toString());
         assertEquals("toString", expected2, fRequest2.toString());
index ff66f6d8c0c0c40359b4a39d56b28bca13332241..aff6b7c0b4e4041a18725c4305d5f47a1f9e1011 100644 (file)
@@ -235,10 +235,10 @@ public class TmfEventRequestTest {
 
     @Test
     public void testToString() {
-        String expected1 = "[TmfEventRequestStub(0,ITmfEvent,FOREGROUND," + range1 + ",0,100,200)]";
-        String expected2 = "[TmfEventRequestStub(1,ITmfEvent,FOREGROUND," + range2 + ",0,100,200)]";
-        String expected3 = "[TmfEventRequestStub(2,ITmfEvent,FOREGROUND," + range2 + ",0,200,200)]";
-        String expected4 = "[TmfEventRequestStub(3,ITmfEvent,FOREGROUND," + range2 + ",0,200,300)]";
+        String expected1 = "[TmfEventRequestStub(0,ITmfEvent,FOREGROUND," + range1 + ",0,100)]";
+        String expected2 = "[TmfEventRequestStub(1,ITmfEvent,FOREGROUND," + range2 + ",0,100)]";
+        String expected3 = "[TmfEventRequestStub(2,ITmfEvent,FOREGROUND," + range2 + ",0,200)]";
+        String expected4 = "[TmfEventRequestStub(3,ITmfEvent,FOREGROUND," + range2 + ",0,200)]";
 
         assertEquals("toString", expected1, fRequest1.toString());
         assertEquals("toString", expected2, fRequest2.toString());
index 8573765caa1de1705f407b3cfca7be1b66ec55a1..94d57166eda077192ea21b9291337549086e60d0 100644 (file)
@@ -377,14 +377,14 @@ public class TmfSchedulerTest {
     // ------------------------------------------------------------------------
 
     private class BackgroundRequest extends TmfEventRequest {
-        private static final int CHUNK_SIZE = 0;
         private int nbEvents = 0;
         private String backgroundName;
 
         BackgroundRequest(TmfTimeRange timeRange) {
-            super(fixture.getEventType(), timeRange,
+            super(fixture.getEventType(),
+                    timeRange,
+                    0,
                     TmfDataRequest.ALL_DATA,
-                    CHUNK_SIZE,
                     ExecutionType.BACKGROUND);
             backgroundName = getExecType().toString() + ++fBackgroundId;
         }
@@ -404,14 +404,14 @@ public class TmfSchedulerTest {
     }
 
     private class ForegroundRequest extends TmfEventRequest {
-        private static final int CHUNK_SIZE = 0;
         private int nbEvents = 0;
         private String foregroundName;
 
         ForegroundRequest(TmfTimeRange timeRange) {
-            super(fixture.getEventType(), timeRange,
+            super(fixture.getEventType(),
+                    timeRange,
+                    0,
                     TmfDataRequest.ALL_DATA,
-                    CHUNK_SIZE,
                     ExecutionType.FOREGROUND);
             foregroundName = getExecType().toString() + ++fForegroundId;
         }
index 52eb7f0000a5e9a59ccec890ecbf164741e5b4d5..8317efe92b8faba2a047a98ab772692c06cfdacd 100644 (file)
@@ -22,17 +22,10 @@ import org.junit.runners.Suite;
  */
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
-    TmfCheckpointIndexTest.class,
-    TmfCheckpointIndexTest2.class,
-    TmfCheckpointTest.class,
     TmfContextTest.class,
-    TmfExperimentCheckpointIndexTest.class,
     TmfExperimentTest.class,
-    TmfLocationTest.class,
     TmfMultiTraceExperimentTest.class,
     TmfTraceManagerTest.class,
     TmfTraceTest.class
 })
-public class AllTests {
-
-}
\ No newline at end of file
+public class AllTests {}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest.java
deleted file mode 100644 (file)
index c727241..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Adapted for TMF Trace Model 1.0
- *   Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpointIndexer;
-import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfEmptyTraceStub;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test suite for the TmfCheckpointIndexTest class.
- */
-@SuppressWarnings("javadoc")
-public class TmfCheckpointIndexTest {
-
-    // ------------------------------------------------------------------------
-    // Variables
-    // ------------------------------------------------------------------------
-
-    private static final String    DIRECTORY   = "testfiles";
-    private static final String    TEST_STREAM = "A-Test-10K";
-    private static final int       BLOCK_SIZE  = 100;
-    private static final int       NB_EVENTS   = 10000;
-    private static TestTrace       fTrace      = null;
-    private static EmptyTestTrace  fEmptyTrace = null;
-
-    // ------------------------------------------------------------------------
-    // Housekeeping
-    // ------------------------------------------------------------------------
-
-    @Before
-    public void setUp() {
-        setupTrace(DIRECTORY + File.separator + TEST_STREAM);
-    }
-
-    @After
-    public void tearDown() {
-        fTrace.dispose();
-        fTrace = null;
-        fEmptyTrace.dispose();
-        fEmptyTrace = null;
-    }
-
-    // ------------------------------------------------------------------------
-    // Helper classes
-    // ------------------------------------------------------------------------
-
-    private static class TestIndexer extends TmfCheckpointIndexer {
-        @SuppressWarnings({ })
-        public TestIndexer(TestTrace testTrace) {
-            super(testTrace, BLOCK_SIZE);
-        }
-        @SuppressWarnings({ })
-        public TestIndexer(EmptyTestTrace testTrace) {
-            super(testTrace, BLOCK_SIZE);
-        }
-        public List<ITmfCheckpoint> getCheckpoints() {
-            return getTraceIndex();
-        }
-    }
-
-    private class TestTrace extends TmfTraceStub {
-        public TestTrace(String path, int blockSize) throws TmfTraceException {
-            super(path, blockSize);
-            setIndexer(new TestIndexer(this));
-        }
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-
-    private class EmptyTestTrace extends TmfEmptyTraceStub {
-        public EmptyTestTrace() {
-            super();
-            setIndexer(new TestIndexer(this));
-        }
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Helper functions
-    // ------------------------------------------------------------------------
-
-    private synchronized void setupTrace(final String path) {
-        if (fTrace == null) {
-            try {
-                final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
-                final File test = new File(FileLocator.toFileURL(location).toURI());
-                fTrace = new TestTrace(test.toURI().getPath(), BLOCK_SIZE);
-                fTrace.indexTrace(true);
-            } catch (final TmfTraceException e) {
-                e.printStackTrace();
-            } catch (final URISyntaxException e) {
-                e.printStackTrace();
-            } catch (final IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (fEmptyTrace == null) {
-            fEmptyTrace = new EmptyTestTrace();
-            fEmptyTrace.indexTrace(true);
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Verify checkpoints
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testTmfTraceIndexing() {
-        assertEquals("getCacheSize",   BLOCK_SIZE, fTrace.getCacheSize());
-        assertEquals("getTraceSize",   NB_EVENTS,  fTrace.getNbEvents());
-        assertEquals("getRange-start", 1,          fTrace.getTimeRange().getStartTime().getValue());
-        assertEquals("getRange-end",   NB_EVENTS,  fTrace.getTimeRange().getEndTime().getValue());
-        assertEquals("getStartTime",   1,          fTrace.getStartTime().getValue());
-        assertEquals("getEndTime",     NB_EVENTS,  fTrace.getEndTime().getValue());
-
-        List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints();
-        int pageSize = fTrace.getCacheSize();
-        assertTrue("Checkpoints exist",  checkpoints != null);
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
-
-        // Validate that each checkpoint points to the right event
-        for (int i = 0; i < checkpoints.size(); i++) {
-            ITmfCheckpoint checkpoint = checkpoints.get(i);
-            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
-            ITmfEvent event = fTrace.parseEvent(context);
-            assertTrue(context.getRank() == i * pageSize);
-            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
-        }
-    }
-
-    @Test
-    public void testEmptyTmfTraceIndexing() {
-        assertEquals("getCacheSize",   ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, fEmptyTrace.getCacheSize());
-        assertEquals("getTraceSize",   0,  fEmptyTrace.getNbEvents());
-        assertEquals("getRange-start", TmfTimestamp.BIG_BANG, fEmptyTrace.getTimeRange().getStartTime());
-        assertEquals("getRange-end",   TmfTimestamp.BIG_BANG, fEmptyTrace.getTimeRange().getEndTime());
-        assertEquals("getStartTime",   TmfTimestamp.BIG_BANG, fEmptyTrace.getStartTime());
-        assertEquals("getEndTime",     TmfTimestamp.BIG_BANG, fEmptyTrace.getEndTime());
-
-        List<ITmfCheckpoint> checkpoints = fEmptyTrace.getIndexer().getCheckpoints();
-        int pageSize = fEmptyTrace.getCacheSize();
-        assertTrue("Checkpoints exist",  checkpoints != null);
-        assertEquals("Checkpoints size", 0, checkpoints.size());
-
-        // Validate that each checkpoint points to the right event
-        for (int i = 0; i < checkpoints.size(); i++) {
-            ITmfCheckpoint checkpoint = checkpoints.get(i);
-            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
-            ITmfEvent event = fEmptyTrace.parseEvent(context);
-            assertTrue(context.getRank() == i * pageSize);
-            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest2.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointIndexTest2.java
deleted file mode 100644 (file)
index fd150ca..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Bernd Hufmann - Initial API and implementation
- *   Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpointIndexer;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfEmptyTraceStub;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test suite for the TmfCheckpointIndexer class (events with same
- * timestamp around checkpoint).
- */
-@SuppressWarnings("javadoc")
-public class TmfCheckpointIndexTest2 {
-
-    // ------------------------------------------------------------------------
-    // Variables
-    // ------------------------------------------------------------------------
-
-    private static final String    DIRECTORY   = "testfiles";
-    // Trace has 3 events at t=101 at rank 99, 100, 101
-    // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
-    private static final String    TEST_STREAM = "A-Test-10K-2";
-    private static final int       BLOCK_SIZE  = 100;
-    private static final int       NB_EVENTS   = 702;
-    private static TestTrace       fTrace      = null;
-    private static EmptyTestTrace  fEmptyTrace = null;
-
-    // ------------------------------------------------------------------------
-    // Housekeeping
-    // ------------------------------------------------------------------------
-
-    @Before
-    public void setUp() {
-        setupTrace(DIRECTORY + File.separator + TEST_STREAM);
-    }
-
-    @After
-    public void tearDown() {
-        fTrace.dispose();
-        fTrace = null;
-        fEmptyTrace.dispose();
-        fEmptyTrace = null;
-    }
-
-    // ------------------------------------------------------------------------
-    // Helper classes
-    // ------------------------------------------------------------------------
-
-    private static class TestIndexer extends TmfCheckpointIndexer {
-        @SuppressWarnings({ })
-        public TestIndexer(TestTrace testTrace) {
-            super(testTrace, BLOCK_SIZE);
-        }
-        @SuppressWarnings({ })
-        public TestIndexer(EmptyTestTrace testTrace) {
-            super(testTrace, BLOCK_SIZE);
-        }
-        public List<ITmfCheckpoint> getCheckpoints() {
-            return getTraceIndex();
-        }
-    }
-
-    private class TestTrace extends TmfTraceStub {
-        public TestTrace(String path, int blockSize) throws TmfTraceException {
-            super(path, blockSize);
-            setIndexer(new TestIndexer(this));
-        }
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-
-    private class EmptyTestTrace extends TmfEmptyTraceStub {
-        public EmptyTestTrace() {
-            super();
-            setIndexer(new TestIndexer(this));
-        }
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Helper functions
-    // ------------------------------------------------------------------------
-
-    private synchronized void setupTrace(final String path) {
-        if (fTrace == null) {
-            try {
-                final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
-                final File test = new File(FileLocator.toFileURL(location).toURI());
-                fTrace = new TestTrace(test.toURI().getPath(), BLOCK_SIZE);
-                fTrace.indexTrace(true);
-            } catch (final TmfTraceException e) {
-                e.printStackTrace();
-            } catch (final URISyntaxException e) {
-                e.printStackTrace();
-            } catch (final IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (fEmptyTrace == null) {
-            fEmptyTrace = new EmptyTestTrace();
-            fEmptyTrace.indexTrace(true);
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Verify checkpoints
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testTmfTraceMultiTimestamps() {
-        assertEquals("getCacheSize",   BLOCK_SIZE, fTrace.getCacheSize());
-        assertEquals("getTraceSize",   NB_EVENTS,  fTrace.getNbEvents());
-        assertEquals("getRange-start", 1,          fTrace.getTimeRange().getStartTime().getValue());
-        assertEquals("getRange-end",   102,        fTrace.getTimeRange().getEndTime().getValue());
-        assertEquals("getStartTime",   1,          fTrace.getStartTime().getValue());
-        assertEquals("getEndTime",     102,        fTrace.getEndTime().getValue());
-
-        List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints();
-        assertTrue("Checkpoints exist",  checkpoints != null);
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE + 1, checkpoints.size());
-
-        // Trace has 3 events with same timestamp (ts=101) at rank 99, 100, 101
-
-        // Verify that the event at rank=99 is returned when seeking to ts=101 (first event with this timestamp)
-        // and not the event at checkpoint boundary
-        TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0);
-        ITmfContext ctx = fTrace.seekEvent(seekTs);
-        ITmfEvent event = fTrace.getNext(ctx);
-
-        assertEquals(99, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        event = fTrace.getNext(ctx);
-
-        assertEquals(100, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        event = fTrace.getNext(ctx);
-
-        assertEquals(101, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
-        // Verify that the event at rank=102 is returned when seeking to ts=102 (first event with this timestamp)
-        // and not the event at checkpoint boundary
-        seekTs = new TmfTimestamp(102, -3, 0);
-        ctx = fTrace.seekEvent(seekTs);
-        event = fTrace.getNext(ctx);
-
-        assertEquals(102, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        // Verify seek to first checkpoint
-        seekTs = new TmfTimestamp(1, -3, 0);
-        ctx = fTrace.seekEvent(seekTs);
-        event = fTrace.getNext(ctx);
-
-        assertEquals(1, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        // Verify seek to timestamp before first event
-        seekTs = new TmfTimestamp(0, -3, 0);
-        ctx = fTrace.seekEvent(seekTs);
-        event = fTrace.getNext(ctx);
-
-        assertEquals(1, ctx.getRank());
-        assertEquals(0, new TmfTimestamp(1, -3, 0).compareTo(event.getTimestamp(), false));
-
-        // Verify seek to timestamp between first and second checkpoint
-        seekTs = new TmfTimestamp(50, -3, 0);
-        ctx = fTrace.seekEvent(seekTs);
-        event = fTrace.getNext(ctx);
-
-        assertEquals(50, ctx.getRank());
-        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
-
-        // Verify seek to timestamp after last event in trace
-        seekTs = new TmfTimestamp(103, -3, 0);
-        ctx = fTrace.seekEvent(seekTs);
-        event = fTrace.getNext(ctx);
-
-        assertEquals(-1, ctx.getRank());
-        assertNull(event);
-    }
-}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfCheckpointTest.java
deleted file mode 100644 (file)
index ce86292..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Adapted for TMF Trace Model 1.0
- *   Alexandre Montplaisir - Port to JUnit4
- *   Patrick Tasse - Updated for location in checkpoint
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpoint;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
-import org.junit.Test;
-
-/**
- * Test suite for the TmfCheckpoint class.
- */
-@SuppressWarnings("javadoc")
-public class TmfCheckpointTest {
-
-    // ------------------------------------------------------------------------
-    // Variables
-    // ------------------------------------------------------------------------
-
-    private ITmfTimestamp fTimestamp1 = new TmfTimestamp();
-    private ITmfTimestamp fTimestamp2 = TmfTimestamp.BIG_BANG;
-    private ITmfTimestamp fTimestamp3 = TmfTimestamp.BIG_CRUNCH;
-
-    private Long aLong1 = 12345L;
-    private Long aLong2 = 23456L;
-    private Long aLong3 = 34567L;
-    private ITmfLocation fLocation1 = new TmfLongLocation(aLong1);
-    private ITmfLocation fLocation2 = new TmfLongLocation(aLong2);
-    private ITmfLocation fLocation3 = new TmfLongLocation(aLong3);
-
-    private TmfCheckpoint fCheckpoint1 = new TmfCheckpoint(fTimestamp1, fLocation1);
-    private TmfCheckpoint fCheckpoint2 = new TmfCheckpoint(fTimestamp2, fLocation2);
-    private TmfCheckpoint fCheckpoint3 = new TmfCheckpoint(fTimestamp3, fLocation3);
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testTmfCheckpoint() {
-        assertEquals("TmfCheckpoint", fTimestamp1, fCheckpoint1.getTimestamp());
-        assertEquals("TmfCheckpoint", fLocation1,  fCheckpoint1.getLocation());
-    }
-
-    public void testTmfLocationCopy() {
-        final TmfCheckpoint checkpoint = new TmfCheckpoint(fCheckpoint1);
-
-        assertEquals("TmfCheckpoint", fTimestamp1, checkpoint.getTimestamp());
-        assertEquals("TmfCheckpoint", fLocation1,  checkpoint.getLocation());
-    }
-
-    @Test
-    public void testTmfLocationCopy2() {
-        try {
-            new TmfCheckpoint(null);
-            fail("null copy");
-        }
-        catch (final IllegalArgumentException e) {
-            // Success
-        }
-        catch (final Exception e) {
-            fail("wrong exception");
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // compareTo
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testCompareTo() {
-        assertEquals("compareTo",  0, fCheckpoint1.compareTo(fCheckpoint1));
-        assertEquals("compareTo",  1, fCheckpoint1.compareTo(fCheckpoint2));
-        assertEquals("compareTo", -1, fCheckpoint1.compareTo(fCheckpoint3));
-
-        assertEquals("compareTo", -1, fCheckpoint2.compareTo(fCheckpoint1));
-        assertEquals("compareTo",  0, fCheckpoint2.compareTo(fCheckpoint2));
-        assertEquals("compareTo", -1, fCheckpoint2.compareTo(fCheckpoint3));
-
-        assertEquals("compareTo",  1, fCheckpoint3.compareTo(fCheckpoint1));
-        assertEquals("compareTo",  1, fCheckpoint3.compareTo(fCheckpoint2));
-        assertEquals("compareTo",  0, fCheckpoint3.compareTo(fCheckpoint3));
-    }
-
-    @Test
-    public void testCompareToNull() {
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(null, fLocation1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(null, fLocation2);
-        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(null, fLocation3);
-        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(null, fLocation1);
-
-        // Test the various 'null' vs. '!null' combinations
-        assertEquals("compareTo",  0, checkpoint1.compareTo(fCheckpoint1));
-        assertEquals("compareTo",  0, fCheckpoint1.compareTo(checkpoint1));
-        assertEquals("compareTo", -1, checkpoint1.compareTo(fCheckpoint2));
-        assertEquals("compareTo",  1, fCheckpoint2.compareTo(checkpoint1));
-        assertEquals("compareTo", -1, checkpoint1.compareTo(fCheckpoint3));
-        assertEquals("compareTo",  1, fCheckpoint3.compareTo(checkpoint1));
-
-        // Test the 'null' vs. 'null' combinations
-        assertEquals("compareTo",  0, checkpoint1.compareTo(checkpoint4));
-        assertEquals("compareTo",  0, checkpoint4.compareTo(checkpoint1));
-        assertEquals("compareTo", -1, checkpoint1.compareTo(checkpoint2));
-        assertEquals("compareTo",  1, checkpoint2.compareTo(checkpoint1));
-        assertEquals("compareTo", -1, checkpoint1.compareTo(checkpoint3));
-        assertEquals("compareTo",  1, checkpoint3.compareTo(checkpoint1));
-    }
-
-    // ------------------------------------------------------------------------
-    // hashCode
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testHashCode() {
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fCheckpoint2);
-
-        assertTrue("hashCode", fCheckpoint1.hashCode() == checkpoint1.hashCode());
-        assertTrue("hashCode", fCheckpoint2.hashCode() == checkpoint2.hashCode());
-
-        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint2.hashCode());
-        assertTrue("hashCode", fCheckpoint2.hashCode() != checkpoint1.hashCode());
-    }
-
-    @Test
-    public void testHashCodeNull() {
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(null, fLocation1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fTimestamp1, null);
-        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(checkpoint1);
-        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(checkpoint2);
-
-        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint1.hashCode());
-        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint2.hashCode());
-
-        assertTrue("hashCode", checkpoint1.hashCode() == checkpoint3.hashCode());
-        assertTrue("hashCode", checkpoint2.hashCode() == checkpoint4.hashCode());
-    }
-
-    // ------------------------------------------------------------------------
-    // equals
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testEqualsReflexivity() {
-        assertTrue("equals", fCheckpoint1.equals(fCheckpoint1));
-        assertTrue("equals", fCheckpoint2.equals(fCheckpoint2));
-
-        assertTrue("equals", !fCheckpoint1.equals(fCheckpoint2));
-        assertTrue("equals", !fCheckpoint2.equals(fCheckpoint1));
-    }
-
-    @Test
-    public void testEqualsSymmetry() {
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fCheckpoint2);
-
-        assertTrue("equals", checkpoint1.equals(fCheckpoint1));
-        assertTrue("equals", fCheckpoint1.equals(checkpoint1));
-
-        assertTrue("equals", checkpoint2.equals(fCheckpoint2));
-        assertTrue("equals", fCheckpoint2.equals(checkpoint2));
-    }
-
-    @Test
-    public void testEqualsTransivity() {
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(checkpoint1);
-        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(checkpoint2);
-
-        assertTrue("equals", checkpoint1.equals(checkpoint2));
-        assertTrue("equals", checkpoint2.equals(checkpoint3));
-        assertTrue("equals", checkpoint1.equals(checkpoint3));
-    }
-
-    @Test
-    public void testNotEqual() {
-        // Various checkpoints
-        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fTimestamp1, fLocation1);
-        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fTimestamp2, fLocation1);
-        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(fTimestamp1, fLocation2);
-        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(fTimestamp1, null);
-        final TmfCheckpoint checkpoint5 = new TmfCheckpoint(null, fLocation1);
-
-        // Null check
-        assertFalse("equals", checkpoint1.equals(null));
-
-        // Different types
-        assertFalse("equals", checkpoint1.equals(new TmfTimestamp()));
-
-        // Null locations/location
-        assertFalse("equals", checkpoint1.equals(checkpoint4));
-        assertFalse("equals", checkpoint1.equals(checkpoint5));
-        assertFalse("equals", checkpoint4.equals(checkpoint1));
-        assertFalse("equals", checkpoint5.equals(checkpoint1));
-
-        // Different locations/location
-        assertFalse("equals", checkpoint1.equals(checkpoint2));
-        assertFalse("equals", checkpoint1.equals(checkpoint3));
-    }
-
-    // ------------------------------------------------------------------------
-    // toString
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testToString() {
-        final String expected1 = "TmfCheckpoint [fLocation=" + fCheckpoint1.getLocation() +
-                ", fTimestamp=" + fCheckpoint1.getTimestamp() + "]";
-        final String expected2 = "TmfCheckpoint [fLocation=" + fCheckpoint2.getLocation() +
-                ", fTimestamp=" + fCheckpoint2.getTimestamp() + "]";
-        final String expected3 = "TmfCheckpoint [fLocation=" + fCheckpoint3.getLocation() +
-                ", fTimestamp=" + fCheckpoint3.getTimestamp() + "]";
-
-        assertEquals("toString", expected1, fCheckpoint1.toString());
-        assertEquals("toString", expected2, fCheckpoint2.toString());
-        assertEquals("toString", expected3, fCheckpoint3.toString());
-    }
-
-}
index 17be19fe846f3372a2e14f27a5959fe71ab59f70..27038945252745d11ee7c13d009fd2d014b1d025 100644 (file)
@@ -20,11 +20,12 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.eclipse.linuxtools.tmf.core.tests.trace.location.TmfStringLocation;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
-import org.eclipse.linuxtools.tmf.core.trace.TmfTimestampLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfTimestampLocation;
 import org.junit.Test;
 
 /**
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentCheckpointIndexTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentCheckpointIndexTest.java
deleted file mode 100644 (file)
index 1ca14b0..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Alexandre Montplaisir - Port to JUnit4
- *   Patrick Tasse - Updated for ranks in experiment location
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfExperimentStub;
-import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test suite for the TmfCheckpointIndexTest class.
- */
-@SuppressWarnings("javadoc")
-public class TmfExperimentCheckpointIndexTest {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    private static final String DIRECTORY    = "testfiles";
-    private static final String TEST_STREAM1 = "O-Test-10K";
-    private static final String TEST_STREAM2 = "E-Test-10K";
-    private static final String EXPERIMENT   = "MyExperiment";
-    private static int          NB_EVENTS    = 20000;
-    private static int          BLOCK_SIZE   = 1000;
-
-    private static ITmfTrace[] fTestTraces;
-    private static TmfExperimentStub fExperiment;
-
-    // ------------------------------------------------------------------------
-    // Housekeeping
-    // ------------------------------------------------------------------------
-
-    @Before
-    public void setUp() {
-        setupTraces();
-        fExperiment = new TmfExperimentStub(EXPERIMENT, fTestTraces, BLOCK_SIZE);
-        fExperiment.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true);
-    }
-
-    @After
-    public void tearDown() {
-        fExperiment.dispose();
-        fExperiment = null;
-        for (ITmfTrace trace : fTestTraces) {
-            trace.dispose();
-        }
-        fTestTraces = null;
-    }
-
-    private static void setupTraces() {
-        final String path1 = DIRECTORY + File.separator + TEST_STREAM1;
-        final String path2 = DIRECTORY + File.separator + TEST_STREAM2;
-
-        fTestTraces = new ITmfTrace[2];
-        try {
-            URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path1), null);
-            File test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true);
-            fTestTraces[0] = trace1;
-            location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path2), null);
-            test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true);
-            fTestTraces[1] = trace2;
-        } catch (final TmfTraceException e) {
-            e.printStackTrace();
-        } catch (final URISyntaxException e) {
-            e.printStackTrace();
-        } catch (final IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Verify checkpoints
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testTmfTraceIndexing() {
-        assertEquals("getCacheSize",   BLOCK_SIZE, fExperiment.getCacheSize());
-        assertEquals("getTraceSize",   NB_EVENTS,  fExperiment.getNbEvents());
-        assertEquals("getRange-start", 1,          fExperiment.getTimeRange().getStartTime().getValue());
-        assertEquals("getRange-end",   NB_EVENTS,  fExperiment.getTimeRange().getEndTime().getValue());
-        assertEquals("getStartTime",   1,          fExperiment.getStartTime().getValue());
-        assertEquals("getEndTime",     NB_EVENTS,  fExperiment.getEndTime().getValue());
-
-        List<ITmfCheckpoint> checkpoints = fExperiment.getIndexer().getCheckpoints();
-        int pageSize = fExperiment.getCacheSize();
-        assertTrue("Checkpoints exist",  checkpoints != null);
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
-
-        // Validate that each checkpoint points to the right event
-        for (int i = 0; i < checkpoints.size(); i++) {
-            ITmfCheckpoint checkpoint = checkpoints.get(i);
-            ITmfLocation location = checkpoint.getLocation();
-            ITmfContext context = fExperiment.seekEvent(location);
-            ITmfEvent event = fExperiment.parseEvent(context);
-            assertTrue(context.getRank() == i * pageSize);
-            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // Streaming
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testGrowingIndex() {
-        ITmfTrace[] testTraces = new TmfTraceStub[2];
-        try {
-            URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM1), null);
-            File test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, false);
-            testTraces[0] = trace1;
-            location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM2), null);
-            test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, false);
-            testTraces[1] = trace2;
-        } catch (final TmfTraceException e) {
-            e.printStackTrace();
-        } catch (final URISyntaxException e) {
-            e.printStackTrace();
-        } catch (final IOException e) {
-            e.printStackTrace();
-        }
-
-        TmfExperimentStub experiment = new TmfExperimentStub(EXPERIMENT, testTraces, BLOCK_SIZE);
-        int pageSize = experiment.getCacheSize();
-
-        // Build the first half of the index
-        TmfTimeRange range = new TmfTimeRange(new TmfTimestamp(1, -3), new TmfTimestamp(NB_EVENTS / 2 - 1, -3));
-        experiment.getIndexer().buildIndex(0, range, true);
-
-        // Validate that each checkpoint points to the right event
-        List<ITmfCheckpoint> checkpoints = experiment.getIndexer().getCheckpoints();
-        assertTrue("Checkpoints exist",  checkpoints != null);
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE / 2, checkpoints.size());
-
-        // Build the second half of the index
-        experiment.getIndexer().buildIndex(NB_EVENTS / 2, TmfTimeRange.ETERNITY, true);
-
-        // Validate that each checkpoint points to the right event
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
-        for (int i = 0; i < checkpoints.size(); i++) {
-            ITmfCheckpoint checkpoint = checkpoints.get(i);
-            ITmfLocation location = checkpoint.getLocation();
-            ITmfContext context = experiment.seekEvent(location);
-            ITmfEvent event = experiment.parseEvent(context);
-            assertTrue(context.getRank() == i * pageSize);
-            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
-            assertEquals("Checkpoint value", i * pageSize + 1, checkpoint.getTimestamp().getValue());
-        }
-
-        /* Clean up (since we didn't use the class-specific fixtures) */
-        experiment.dispose();
-        for (ITmfTrace trace : testTraces) {
-            trace.dispose();
-        }
-    }
-
-}
\ No newline at end of file
index 15e06d87fcbbe66ee5e020fd6a352e0a26f2e61a..7f26716ff32ebd0e511cd1f493b069028c8913b7 100644 (file)
@@ -35,16 +35,17 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 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;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfExperimentStub;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
 import org.junit.Before;
@@ -83,7 +84,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);
+                final TmfTraceStub trace = new TmfTraceStub(test.getPath(), 0, true, null, null);
                 fTestTraces[0] = trace;
             } catch (final TmfTraceException e) {
                 e.printStackTrace();
@@ -824,40 +825,12 @@ public class TmfExperimentTest {
 
     @Test
     public void testProcessRequestForNbEvents() throws InterruptedException {
-        final int blockSize = 100;
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
-            @Override
-            public void handleData(final ITmfEvent event) {
-                super.handleData(event);
-                requestedEvents.add(event);
-            }
-        };
-        fExperiment.sendRequest(request);
-        request.waitForCompletion();
-
-        assertEquals("nbEvents", nbEvents, requestedEvents.size());
-        assertTrue("isCompleted",  request.isCompleted());
-        assertFalse("isCancelled", request.isCancelled());
-
-        // Ensure that we have distinct events.
-        // Don't go overboard: we are not validating the stub!
-        for (int i = 0; i < nbEvents; i++) {
-            assertEquals("Distinct events", i+1, requestedEvents.get(i).getTimestamp().getValue());
-        }
-    }
-
-    @Test
-    public void testProcessRequestForNbEvents2() throws InterruptedException {
-        final int blockSize = 2 * NB_EVENTS;
-        final int nbEvents = 1000;
-        final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
-
-        final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -881,12 +854,12 @@ public class TmfExperimentTest {
     @Test
     public void testProcessRequestForAllEvents() throws InterruptedException {
         final int nbEvents  = TmfDataRequest.ALL_DATA;
-        final int blockSize =  1;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
         final long nbExpectedEvents = NB_EVENTS;
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -913,24 +886,27 @@ public class TmfExperimentTest {
 
     @Test
     public void testCancel() throws InterruptedException {
-        final int nbEvents  = NB_EVENTS;
-        final int blockSize = BLOCK_SIZE;
+        final int nbEvents = NB_EVENTS;
+        final int limit = BLOCK_SIZE;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             int nbRead = 0;
+
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
                 requestedEvents.add(event);
-                if (++nbRead == blockSize) {
+                if (++nbRead == limit) {
                     cancel();
                 }
             }
+
             @Override
             public void handleCancel() {
-                if (requestedEvents.size() < blockSize) {
+                if (requestedEvents.size() < limit) {
                     System.out.println("aie");
                 }
             }
@@ -938,7 +914,7 @@ public class TmfExperimentTest {
         fExperiment.sendRequest(request);
         request.waitForCompletion();
 
-        assertEquals("nbEvents",  blockSize, requestedEvents.size());
+        assertEquals("nbEvents",  limit, requestedEvents.size());
         assertTrue("isCompleted", request.isCompleted());
         assertTrue("isCancelled", request.isCancelled());
     }
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfLocationTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfLocationTest.java
deleted file mode 100644 (file)
index 82ff267..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Alexandre Montplaisir - Port to JUnit4
- *   Patrick Tasse - Add tests for TmfExperimentLocation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.linuxtools.internal.tmf.core.trace.TmfExperimentLocation;
-import org.eclipse.linuxtools.internal.tmf.core.trace.TmfLocationArray;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
-import org.eclipse.linuxtools.tmf.core.trace.TmfTimestampLocation;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test suite for the TmfLocation class.
- */
-@SuppressWarnings("javadoc")
-public class TmfLocationTest {
-
-    // ------------------------------------------------------------------------
-    // Variables
-    // ------------------------------------------------------------------------
-
-    private String aString = "some location";
-    private Long aLong = 12345L;
-    private TmfTimestamp aTimestamp = new TmfTimestamp();
-    private TmfLocationArray aLocationArray;
-
-    private TmfStringLocation fLocation1;
-    private TmfStringLocation fLocation2;
-    private TmfLongLocation fLocation3;
-    private TmfTimestampLocation fLocation4;
-    private TmfExperimentLocation fExpLocation;
-
-    // ------------------------------------------------------------------------
-    // Housekeeping
-    // ------------------------------------------------------------------------
-
-    @Before
-    public void setUp() {
-        fLocation1 = new TmfStringLocation((String) null);
-        fLocation2 = new TmfStringLocation(aString);
-        fLocation3 = new TmfLongLocation(aLong);
-        fLocation4 = new TmfTimestampLocation(aTimestamp);
-        aLocationArray = new TmfLocationArray(
-                new ITmfLocation[] { fLocation1, fLocation2, fLocation3, fLocation4 },
-                new long[] { 1, 2, 3, 4 }
-                );
-        fExpLocation = new TmfExperimentLocation(aLocationArray);
-    }
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testTmfLocation() {
-        assertNull("TmfLocation", fLocation1.getLocationInfo());
-        assertEquals("TmfLocation", aString, fLocation2.getLocationInfo());
-        assertEquals("TmfLocation", aLong, fLocation3.getLocationInfo());
-        assertEquals("TmfLocation", aTimestamp, fLocation4.getLocationInfo());
-        assertEquals("TmfLocation", aLocationArray, fExpLocation.getLocationInfo());
-    }
-
-    @Test
-    public void testTmfLocationCopy() {
-        TmfStringLocation location1 = new TmfStringLocation(fLocation1);
-        TmfStringLocation location2 = new TmfStringLocation(fLocation2);
-        TmfLongLocation location3 = new TmfLongLocation(fLocation3);
-        TmfTimestampLocation location4 = new TmfTimestampLocation(fLocation4);
-        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
-
-        assertNull("TmfLocation", location1.getLocationInfo());
-        assertEquals("TmfLocation", aString, location2.getLocationInfo());
-        assertEquals("TmfLocation", aLong, location3.getLocationInfo());
-        assertEquals("TmfLocation", aTimestamp, location4.getLocationInfo());
-        assertEquals("TmfLocation", aLocationArray, expLocation.getLocationInfo());
-    }
-
-    // ------------------------------------------------------------------------
-    // hashCode
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testHashCode() {
-        TmfStringLocation location1 = new TmfStringLocation((String) null);
-        TmfStringLocation location2 = new TmfStringLocation(aString);
-        TmfLongLocation location3 = new TmfLongLocation(aLong);
-        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
-        TmfLocationArray locationArray1 = new TmfLocationArray(aLocationArray, 3, fLocation4, 5);
-        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(locationArray1);
-        TmfLocationArray locationArray2 = new TmfLocationArray(aLocationArray, 3, fLocation3, 4);
-        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(locationArray2);
-        TmfLocationArray locationArray3 = new TmfLocationArray(
-                new ITmfLocation[] { fLocation1, fLocation2, fLocation3 },
-                new long[] { 1, 2, 3 }
-                );
-        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(locationArray3);
-
-        assertTrue("hashCode", fLocation1.hashCode() == location1.hashCode());
-        assertTrue("hashCode", fLocation2.hashCode() == location2.hashCode());
-        assertTrue("hashCode", fLocation3.hashCode() == location3.hashCode());
-        assertTrue("hashCode", fExpLocation.hashCode() == expLocation.hashCode());
-
-        assertTrue("hashCode", fLocation2.hashCode() != location3.hashCode());
-        assertTrue("hashCode", fLocation3.hashCode() != location2.hashCode());
-        assertTrue("hashCode", fExpLocation.hashCode() != expLocation1.hashCode());
-        assertTrue("hashCode", fExpLocation.hashCode() != expLocation2.hashCode());
-        assertTrue("hashCode", fExpLocation.hashCode() != expLocation3.hashCode());
-    }
-
-    // ------------------------------------------------------------------------
-    // toEquals
-    // ------------------------------------------------------------------------
-
-    private static class TmfLocation2 extends TmfStringLocation {
-        public TmfLocation2(String location) {
-            super(location);
-        }
-    }
-
-    @Test
-    public void testEqualsWrongTypes() {
-        ITmfLocation location1 = new TmfStringLocation(aString);
-        TmfLocation2 location2 = new TmfLocation2(aString);
-
-        assertFalse("equals", location1.equals(location2));
-        assertFalse("equals", location2.equals(location1));
-    }
-
-    @Test
-    public void testEqualsWithNulls() {
-        TmfStringLocation location1 = new TmfStringLocation(aString);
-        TmfStringLocation location2 = new TmfStringLocation((String) null);
-
-        assertFalse("equals", location1.equals(location2));
-        assertFalse("equals", location2.equals(location1));
-    }
-
-    @Test
-    public void testEqualsReflexivity() {
-        assertTrue("equals", fLocation2.equals(fLocation2));
-        assertTrue("equals", fLocation3.equals(fLocation3));
-        assertTrue("equals", fExpLocation.equals(fExpLocation));
-
-        assertTrue("equals", !fLocation2.equals(fLocation3));
-        assertTrue("equals", !fLocation3.equals(fLocation2));
-        TmfLocationArray locationArray1 = new TmfLocationArray(aLocationArray, 3, fLocation4, 5);
-        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(locationArray1);
-        TmfLocationArray locationArray2 = new TmfLocationArray(aLocationArray, 3, fLocation3, 4);
-        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(locationArray2);
-        TmfLocationArray locationArray3 = new TmfLocationArray(
-                new ITmfLocation[] { fLocation1, fLocation2, fLocation3 },
-                new long[] { 1, 2, 3 }
-                );
-        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(locationArray3);
-        assertTrue("equals", !fExpLocation.equals(expLocation1));
-        assertTrue("equals", !expLocation1.equals(fExpLocation));
-        assertTrue("equals", !fExpLocation.equals(expLocation2));
-        assertTrue("equals", !expLocation2.equals(fExpLocation));
-        assertTrue("equals", !fExpLocation.equals(expLocation3));
-        assertTrue("equals", !expLocation3.equals(fExpLocation));
-    }
-
-    @Test
-    public void testEqualsSymmetry() {
-        TmfStringLocation location2 = new TmfStringLocation(aString);
-        TmfLongLocation location3 = new TmfLongLocation(aLong);
-        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
-
-        assertTrue("equals", location2.equals(fLocation2));
-        assertTrue("equals", fLocation2.equals(location2));
-
-        assertTrue("equals", location3.equals(fLocation3));
-        assertTrue("equals", fLocation3.equals(location3));
-
-        assertTrue("equals", expLocation.equals(fExpLocation));
-        assertTrue("equals", fExpLocation.equals(expLocation));
-    }
-
-    @Test
-    public void testEqualsTransivity() {
-        TmfStringLocation location1 = new TmfStringLocation(aString);
-        TmfStringLocation location2 = new TmfStringLocation(aString);
-        TmfStringLocation location3 = new TmfStringLocation(aString);
-        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(aLocationArray);
-        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(aLocationArray);
-        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(aLocationArray);
-
-        assertTrue("equals", location1.equals(location2));
-        assertTrue("equals", location2.equals(location3));
-        assertTrue("equals", location3.equals(location1));
-        assertTrue("equals", expLocation1.equals(expLocation2));
-        assertTrue("equals", expLocation2.equals(expLocation3));
-        assertTrue("equals", expLocation3.equals(expLocation1));
-    }
-
-    @Test
-    public void testEqualsNull() {
-        assertTrue("equals", !fLocation2.equals(null));
-        assertTrue("equals", !fLocation2.equals(null));
-        assertTrue("equals", !fExpLocation.equals(null));
-    }
-
-    // ------------------------------------------------------------------------
-    // toString
-    // ------------------------------------------------------------------------
-
-    @Test
-    public void testToString() {
-        String str = "some location";
-        Long lng = 12345L;
-        TmfTimestamp ts = new TmfTimestamp();
-
-        TmfStringLocation location1 = new TmfStringLocation(str);
-        TmfLongLocation location2 = new TmfLongLocation(lng);
-        TmfTimestampLocation location3 = new TmfTimestampLocation(ts);
-        TmfExperimentLocation expLocation = new TmfExperimentLocation(aLocationArray);
-
-        String expected1 = "TmfStringLocation [fLocationInfo=" + str + "]";
-        String expected2 = "TmfLongLocation [fLocationInfo=" + lng + "]";
-        String expected3 = "TmfTimestampLocation [fLocationInfo=" + ts + "]";
-        String expected4 = "TmfExperimentLocation [" + aLocationArray + "]";
-
-        assertEquals("toString", expected1, location1.toString());
-        assertEquals("toString", expected2, location2.toString());
-        assertEquals("toString", expected3, location3.toString());
-        assertEquals("toString", expected4, expLocation.toString());
-    }
-
-}
index 44a3d3abbc6b581c0d4ee563f897a5de5300cd20..356fadb598eddf8961e38983cd4376dd2ab9af3a 100644 (file)
@@ -33,13 +33,14 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 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.tests.TmfCoreTestPlugin;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfExperimentStub;
 import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
 import org.junit.AfterClass;
@@ -92,12 +93,12 @@ public class TmfMultiTraceExperimentTest {
 
             URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path1), null);
             File test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true);
+            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null, null);
             traces[0] = trace1;
 
             location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path2), null);
             test = new File(FileLocator.toFileURL(location).toURI());
-            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true);
+            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null, null);
             traces[1] = trace2;
 
             return traces;
@@ -677,40 +678,12 @@ public class TmfMultiTraceExperimentTest {
 
     @Test
     public void testProcessRequestForNbEvents() throws InterruptedException {
-        final int blockSize = 100;
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
-            @Override
-            public void handleData(final ITmfEvent event) {
-                super.handleData(event);
-                requestedEvents.add(event);
-            }
-        };
-        fExperiment.sendRequest(request);
-        request.waitForCompletion();
-
-        assertEquals("nbEvents", nbEvents, requestedEvents.size());
-        assertTrue("isCompleted",  request.isCompleted());
-        assertFalse("isCancelled", request.isCancelled());
-
-        // Ensure that we have distinct events.
-        // Don't go overboard: we are not validating the stub!
-        for (int i = 0; i < nbEvents; i++) {
-            assertEquals("Distinct events", i+1, requestedEvents.get(i).getTimestamp().getValue());
-        }
-    }
-
-    @Test
-    public void testProcessRequestForNbEvents2() throws InterruptedException {
-        final int blockSize = 2 * NB_EVENTS;
-        final int nbEvents = 1000;
-        final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
-
-        final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -734,12 +707,12 @@ public class TmfMultiTraceExperimentTest {
     @Test
     public void testProcessRequestForAllEvents() throws InterruptedException {
         final int nbEvents  = TmfDataRequest.ALL_DATA;
-        final int blockSize =  1;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
         final long nbExpectedEvents = NB_EVENTS;
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -767,31 +740,27 @@ public class TmfMultiTraceExperimentTest {
     @Test
     public void testCancel() throws InterruptedException {
         final int nbEvents  = NB_EVENTS;
-        final int blockSize = BLOCK_SIZE;
+        final int limit = BLOCK_SIZE;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             int nbRead = 0;
+
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
                 requestedEvents.add(event);
-                if (++nbRead == blockSize) {
+                if (++nbRead == limit) {
                     cancel();
                 }
             }
-            @Override
-            public void handleCancel() {
-                if (requestedEvents.size() < blockSize) {
-                    System.out.println("aie");
-                }
-            }
         };
         fExperiment.sendRequest(request);
         request.waitForCompletion();
 
-        assertEquals("nbEvents",  blockSize, requestedEvents.size());
+        assertEquals("nbEvents",  limit, requestedEvents.size());
         assertTrue("isCompleted", request.isCompleted());
         assertTrue("isCancelled", request.isCancelled());
     }
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfStringLocation.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfStringLocation.java
deleted file mode 100644 (file)
index aa707fb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.tests.trace;
-
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
-
-/**
- * <b><u>TmfStringLocation</u></b>
- * <p>
- * Implement me. Please.
- * <p>
- */
-public class TmfStringLocation extends TmfLocation {
-
-    /**
-     * @param location the concrete trace location
-     */
-    public TmfStringLocation(String location) {
-        super(location);
-    }
-
-    /**
-     * @param other the other location
-     */
-    public TmfStringLocation(TmfStringLocation other) {
-        super(other.getLocationInfo());
-    }
-
-    @Override
-    public String getLocationInfo() {
-        return (String) super.getLocationInfo();
-    }
-
-}
index e3b027792bc9bf170cee09c2f9f883a9281d9a08..979b41343529ab3e6fb0b1e0e955369b46d37697 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 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;
@@ -42,10 +43,10 @@ import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpointIndexer;
 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;
 import org.junit.Before;
@@ -94,7 +95,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(), BLOCK_SIZE);
+                fTrace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
                 fTrace.indexTrace(true);
             } catch (final TmfTraceException e) {
                 e.printStackTrace();
@@ -116,7 +117,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             File testfile = new File(FileLocator.toFileURL(location).toURI());
-            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath());
+            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
             trace.indexTrace(true);
 
             assertEquals("getType", ITmfEvent.class, trace.getType());
@@ -144,7 +145,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             File testfile = new File(FileLocator.toFileURL(location).toURI());
-            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), 0);
+            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), 0, false, null, null);
             trace.indexTrace(true);
 
             assertEquals("getType", ITmfEvent.class, trace.getType());
@@ -169,7 +170,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             File testfile = new File(FileLocator.toFileURL(location).toURI());
-            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE);
+            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
             trace.indexTrace(true);
 
             assertEquals("getType", ITmfEvent.class, trace.getType());
@@ -197,7 +198,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             File testfile = new File(FileLocator.toFileURL(location).toURI());
-            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, null);
+            TmfTraceStub trace = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, false, null, null);
             trace.indexTrace(true);
 
             assertEquals("getType", ITmfEvent.class, trace.getType());
@@ -254,7 +255,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             File testfile = new File(FileLocator.toFileURL(location).toURI());
-            TmfTraceStub original = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, new TmfCheckpointIndexer(null));
+            TmfTraceStub original = new TmfTraceStub(testfile.toURI().getPath(), BLOCK_SIZE, false, new TmfCheckpointIndexer(null), null);
             TmfTraceStub trace = new TmfTraceStub(original);
             trace.indexTrace(true);
 
@@ -1223,11 +1224,11 @@ public class TmfTraceTest {
 
     @Test
     public void testProcessEventRequestForAllEvents() throws InterruptedException {
-        final int blockSize = 1;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -1251,12 +1252,12 @@ public class TmfTraceTest {
 
     @Test
     public void testProcessEventRequestForNbEvents() throws InterruptedException {
-        final int blockSize = 100;
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -1280,13 +1281,13 @@ public class TmfTraceTest {
 
     @Test
     public void testProcessEventRequestForSomeEvents() throws InterruptedException {
-        final int blockSize = 1;
         final long startTime = 100;
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(new TmfTimestamp(startTime, SCALE), TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -1310,14 +1311,14 @@ public class TmfTraceTest {
 
     @Test
     public void testProcessEventRequestForOtherEvents() throws InterruptedException {
-        final int blockSize =  1;
         final int startIndex = 99;
         final long startTime = 100;
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(new TmfTimestamp(startTime, SCALE), TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, startIndex, nbEvents, blockSize) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, startIndex, nbEvents, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -1345,7 +1346,10 @@ public class TmfTraceTest {
         final int nbEvents  = 1000;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
-        final TmfDataRequest request = new TmfDataRequest(ITmfEvent.class, startIndex, nbEvents) {
+        final TmfDataRequest request = new TmfDataRequest(ITmfEvent.class,
+                startIndex,
+                nbEvents,
+                TmfDataRequest.ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
@@ -1373,16 +1377,19 @@ public class TmfTraceTest {
 
     @Test
     public void testCancel() throws InterruptedException {
+        final int limit = BLOCK_SIZE;
         final Vector<ITmfEvent> requestedEvents = new Vector<ITmfEvent>();
 
         final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
-        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, BLOCK_SIZE) {
+        final TmfEventRequest request = new TmfEventRequest(ITmfEvent.class,
+                range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             int nbRead = 0;
+
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
                 requestedEvents.add(event);
-                if (++nbRead == BLOCK_SIZE) {
+                if (++nbRead == limit) {
                     cancel();
                 }
             }
@@ -1391,7 +1398,7 @@ public class TmfTraceTest {
         providers[0].sendRequest(request);
         request.waitForCompletion();
 
-        assertEquals("nbEvents",  BLOCK_SIZE, requestedEvents.size());
+        assertEquals("nbEvents",  limit, requestedEvents.size());
         assertTrue("isCompleted", request.isCompleted());
         assertTrue("isCancelled", request.isCancelled());
     }
@@ -1405,7 +1412,6 @@ public class TmfTraceTest {
         assertFalse ("Open trace", fTrace == null);
         assertEquals("getType",  ITmfEvent.class, fTrace.getType());
         assertNull  ("getResource", fTrace.getResource());
-        assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
         assertEquals("getStreamingInterval", 0, fTrace.getStreamingInterval());
         assertEquals("getName", TEST_STREAM, fTrace.getName());
 
@@ -1434,7 +1440,7 @@ public class TmfTraceTest {
         try {
             final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
             testfile = new File(FileLocator.toFileURL(location).toURI());
-            trace = new TmfTraceStub(testfile.toURI().getPath());
+            trace = new TmfTraceStub(testfile.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null);
             // verify initial values
             TmfTimestamp defaultInitRange = new TmfTimestamp(DEFAULT_INITIAL_OFFSET_VALUE, ITmfTimestamp.NANOSECOND_SCALE);
             assertEquals("getInitialRangeOffset", defaultInitRange, trace.getInitialRangeOffset());
@@ -1450,4 +1456,13 @@ public class TmfTraceTest {
         TmfTimestamp initRange = new TmfTimestamp(5, ITmfTimestamp.MILLISECOND_SCALE);
         assertEquals("getInitialRangeOffset", initRange, trace.getInitialRangeOffset());
     }
+
+    /**
+     * Run the String getHostId() method test
+     */
+    @Test
+    public void testTraceHostId() {
+        String a = fTrace.getHostId();
+        assertEquals("A-Test-10K", a);
+    }
 }
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AllTests.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AllTests.java
new file mode 100644 (file)
index 0000000..0c5856a
--- /dev/null
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * 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.linuxtools.tmf.core.tests.trace.indexer.checkpoint;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite for org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TmfCheckpointIndexTest.class,
+    TmfCheckpointIndexTest2.class,
+    TmfCheckpointTest.class,
+    TmfExperimentCheckpointIndexTest.class,
+})
+public class AllTests {}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest.java
new file mode 100644 (file)
index 0000000..9ff4898
--- /dev/null
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Adapted for TMF Trace Model 1.0
+ *   Alexandre Montplaisir - Port to JUnit4
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.indexer.checkpoint;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+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.indexer.checkpoint.ITmfCheckpoint;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfEmptyTraceStub;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for the TmfCheckpointIndexTest class.
+ */
+@SuppressWarnings("javadoc")
+public class TmfCheckpointIndexTest {
+
+    // ------------------------------------------------------------------------
+    // Variables
+    // ------------------------------------------------------------------------
+
+    private static final String    DIRECTORY   = "testfiles";
+    private static final String    TEST_STREAM = "A-Test-10K";
+    private static final int       BLOCK_SIZE  = 100;
+    private static final int       NB_EVENTS   = 10000;
+    private static TestTrace       fTrace      = null;
+    private static EmptyTestTrace  fEmptyTrace = null;
+
+    // ------------------------------------------------------------------------
+    // Housekeeping
+    // ------------------------------------------------------------------------
+
+    @Before
+    public void setUp() {
+        setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+    }
+
+    @After
+    public void tearDown() {
+        fTrace.dispose();
+        fTrace = null;
+        fEmptyTrace.dispose();
+        fEmptyTrace = null;
+    }
+
+    // ------------------------------------------------------------------------
+    // Helper classes
+    // ------------------------------------------------------------------------
+
+    private static class TestIndexer extends TmfCheckpointIndexer {
+        @SuppressWarnings({ })
+        public TestIndexer(TestTrace testTrace) {
+            super(testTrace, BLOCK_SIZE);
+        }
+        @SuppressWarnings({ })
+        public TestIndexer(EmptyTestTrace testTrace) {
+            super(testTrace, BLOCK_SIZE);
+        }
+        public List<ITmfCheckpoint> getCheckpoints() {
+            return getTraceIndex();
+        }
+    }
+
+    private class TestTrace extends TmfTraceStub {
+        public TestTrace(String path, int blockSize) throws TmfTraceException {
+            super(path, blockSize, false, null, null);
+            setIndexer(new TestIndexer(this));
+        }
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+
+    private class EmptyTestTrace extends TmfEmptyTraceStub {
+        public EmptyTestTrace() {
+            super();
+            setIndexer(new TestIndexer(this));
+        }
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Helper functions
+    // ------------------------------------------------------------------------
+
+    private synchronized void setupTrace(final String path) {
+        if (fTrace == null) {
+            try {
+                final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
+                final File test = new File(FileLocator.toFileURL(location).toURI());
+                fTrace = new TestTrace(test.toURI().getPath(), BLOCK_SIZE);
+                fTrace.indexTrace(true);
+            } catch (final TmfTraceException e) {
+                e.printStackTrace();
+            } catch (final URISyntaxException e) {
+                e.printStackTrace();
+            } catch (final IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        if (fEmptyTrace == null) {
+            fEmptyTrace = new EmptyTestTrace();
+            fEmptyTrace.indexTrace(true);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Verify checkpoints
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testTmfTraceIndexing() {
+        assertEquals("getCacheSize",   BLOCK_SIZE, fTrace.getCacheSize());
+        assertEquals("getTraceSize",   NB_EVENTS,  fTrace.getNbEvents());
+        assertEquals("getRange-start", 1,          fTrace.getTimeRange().getStartTime().getValue());
+        assertEquals("getRange-end",   NB_EVENTS,  fTrace.getTimeRange().getEndTime().getValue());
+        assertEquals("getStartTime",   1,          fTrace.getStartTime().getValue());
+        assertEquals("getEndTime",     NB_EVENTS,  fTrace.getEndTime().getValue());
+
+        List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints();
+        int pageSize = fTrace.getCacheSize();
+        assertTrue("Checkpoints exist",  checkpoints != null);
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
+
+        // Validate that each checkpoint points to the right event
+        for (int i = 0; i < checkpoints.size(); i++) {
+            ITmfCheckpoint checkpoint = checkpoints.get(i);
+            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
+            ITmfEvent event = fTrace.parseEvent(context);
+            assertTrue(context.getRank() == i * pageSize);
+            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
+        }
+    }
+
+    @Test
+    public void testEmptyTmfTraceIndexing() {
+        assertEquals("getCacheSize",   ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, fEmptyTrace.getCacheSize());
+        assertEquals("getTraceSize",   0,  fEmptyTrace.getNbEvents());
+        assertEquals("getRange-start", TmfTimestamp.BIG_BANG, fEmptyTrace.getTimeRange().getStartTime());
+        assertEquals("getRange-end",   TmfTimestamp.BIG_BANG, fEmptyTrace.getTimeRange().getEndTime());
+        assertEquals("getStartTime",   TmfTimestamp.BIG_BANG, fEmptyTrace.getStartTime());
+        assertEquals("getEndTime",     TmfTimestamp.BIG_BANG, fEmptyTrace.getEndTime());
+
+        List<ITmfCheckpoint> checkpoints = fEmptyTrace.getIndexer().getCheckpoints();
+        int pageSize = fEmptyTrace.getCacheSize();
+        assertTrue("Checkpoints exist",  checkpoints != null);
+        assertEquals("Checkpoints size", 0, checkpoints.size());
+
+        // Validate that each checkpoint points to the right event
+        for (int i = 0; i < checkpoints.size(); i++) {
+            ITmfCheckpoint checkpoint = checkpoints.get(i);
+            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
+            ITmfEvent event = fEmptyTrace.parseEvent(context);
+            assertTrue(context.getRank() == i * pageSize);
+            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointIndexTest2.java
new file mode 100644 (file)
index 0000000..2e5c2f6
--- /dev/null
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Bernd Hufmann - Initial API and implementation
+ *   Alexandre Montplaisir - Port to JUnit4
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.indexer.checkpoint;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.ITmfCheckpoint;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfEmptyTraceStub;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for the TmfCheckpointIndexer class (events with same
+ * timestamp around checkpoint).
+ */
+@SuppressWarnings("javadoc")
+public class TmfCheckpointIndexTest2 {
+
+    // ------------------------------------------------------------------------
+    // Variables
+    // ------------------------------------------------------------------------
+
+    private static final String    DIRECTORY   = "testfiles";
+    // Trace has 3 events at t=101 at rank 99, 100, 101
+    // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
+    private static final String    TEST_STREAM = "A-Test-10K-2";
+    private static final int       BLOCK_SIZE  = 100;
+    private static final int       NB_EVENTS   = 702;
+    private static TestTrace       fTrace      = null;
+    private static EmptyTestTrace  fEmptyTrace = null;
+
+    // ------------------------------------------------------------------------
+    // Housekeeping
+    // ------------------------------------------------------------------------
+
+    @Before
+    public void setUp() {
+        setupTrace(DIRECTORY + File.separator + TEST_STREAM);
+    }
+
+    @After
+    public void tearDown() {
+        fTrace.dispose();
+        fTrace = null;
+        fEmptyTrace.dispose();
+        fEmptyTrace = null;
+    }
+
+    // ------------------------------------------------------------------------
+    // Helper classes
+    // ------------------------------------------------------------------------
+
+    private static class TestIndexer extends TmfCheckpointIndexer {
+        @SuppressWarnings({ })
+        public TestIndexer(TestTrace testTrace) {
+            super(testTrace, BLOCK_SIZE);
+        }
+        @SuppressWarnings({ })
+        public TestIndexer(EmptyTestTrace testTrace) {
+            super(testTrace, BLOCK_SIZE);
+        }
+        public List<ITmfCheckpoint> getCheckpoints() {
+            return getTraceIndex();
+        }
+    }
+
+    private class TestTrace extends TmfTraceStub {
+        public TestTrace(String path, int blockSize) throws TmfTraceException {
+            super(path, blockSize, false, null, null);
+            setIndexer(new TestIndexer(this));
+        }
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+
+    private class EmptyTestTrace extends TmfEmptyTraceStub {
+        public EmptyTestTrace() {
+            super();
+            setIndexer(new TestIndexer(this));
+        }
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Helper functions
+    // ------------------------------------------------------------------------
+
+    private synchronized void setupTrace(final String path) {
+        if (fTrace == null) {
+            try {
+                final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path), null);
+                final File test = new File(FileLocator.toFileURL(location).toURI());
+                fTrace = new TestTrace(test.toURI().getPath(), BLOCK_SIZE);
+                fTrace.indexTrace(true);
+            } catch (final TmfTraceException e) {
+                e.printStackTrace();
+            } catch (final URISyntaxException e) {
+                e.printStackTrace();
+            } catch (final IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        if (fEmptyTrace == null) {
+            fEmptyTrace = new EmptyTestTrace();
+            fEmptyTrace.indexTrace(true);
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Verify checkpoints
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testTmfTraceMultiTimestamps() {
+        assertEquals("getCacheSize",   BLOCK_SIZE, fTrace.getCacheSize());
+        assertEquals("getTraceSize",   NB_EVENTS,  fTrace.getNbEvents());
+        assertEquals("getRange-start", 1,          fTrace.getTimeRange().getStartTime().getValue());
+        assertEquals("getRange-end",   102,        fTrace.getTimeRange().getEndTime().getValue());
+        assertEquals("getStartTime",   1,          fTrace.getStartTime().getValue());
+        assertEquals("getEndTime",     102,        fTrace.getEndTime().getValue());
+
+        List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints();
+        assertTrue("Checkpoints exist",  checkpoints != null);
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE + 1, checkpoints.size());
+
+        // Trace has 3 events with same timestamp (ts=101) at rank 99, 100, 101
+
+        // Verify that the event at rank=99 is returned when seeking to ts=101 (first event with this timestamp)
+        // and not the event at checkpoint boundary
+        TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0);
+        ITmfContext ctx = fTrace.seekEvent(seekTs);
+        ITmfEvent event = fTrace.getNext(ctx);
+
+        assertEquals(99, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        event = fTrace.getNext(ctx);
+
+        assertEquals(100, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        event = fTrace.getNext(ctx);
+
+        assertEquals(101, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        // Trace has events with same timestamp (ts=102) for ranks 102..702 -> 2 checkpoints with same timestamp are created
+        // Verify that the event at rank=102 is returned when seeking to ts=102 (first event with this timestamp)
+        // and not the event at checkpoint boundary
+        seekTs = new TmfTimestamp(102, -3, 0);
+        ctx = fTrace.seekEvent(seekTs);
+        event = fTrace.getNext(ctx);
+
+        assertEquals(102, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        // Verify seek to first checkpoint
+        seekTs = new TmfTimestamp(1, -3, 0);
+        ctx = fTrace.seekEvent(seekTs);
+        event = fTrace.getNext(ctx);
+
+        assertEquals(1, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        // Verify seek to timestamp before first event
+        seekTs = new TmfTimestamp(0, -3, 0);
+        ctx = fTrace.seekEvent(seekTs);
+        event = fTrace.getNext(ctx);
+
+        assertEquals(1, ctx.getRank());
+        assertEquals(0, new TmfTimestamp(1, -3, 0).compareTo(event.getTimestamp(), false));
+
+        // Verify seek to timestamp between first and second checkpoint
+        seekTs = new TmfTimestamp(50, -3, 0);
+        ctx = fTrace.seekEvent(seekTs);
+        event = fTrace.getNext(ctx);
+
+        assertEquals(50, ctx.getRank());
+        assertEquals(0, seekTs.compareTo(event.getTimestamp(), false));
+
+        // Verify seek to timestamp after last event in trace
+        seekTs = new TmfTimestamp(103, -3, 0);
+        ctx = fTrace.seekEvent(seekTs);
+        event = fTrace.getNext(ctx);
+
+        assertEquals(-1, ctx.getRank());
+        assertNull(event);
+    }
+}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfCheckpointTest.java
new file mode 100644 (file)
index 0000000..cb0871c
--- /dev/null
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Adapted for TMF Trace Model 1.0
+ *   Alexandre Montplaisir - Port to JUnit4
+ *   Patrick Tasse - Updated for location in checkpoint
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.indexer.checkpoint;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpoint;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
+import org.junit.Test;
+
+/**
+ * Test suite for the TmfCheckpoint class.
+ */
+@SuppressWarnings("javadoc")
+public class TmfCheckpointTest {
+
+    // ------------------------------------------------------------------------
+    // Variables
+    // ------------------------------------------------------------------------
+
+    private ITmfTimestamp fTimestamp1 = new TmfTimestamp();
+    private ITmfTimestamp fTimestamp2 = TmfTimestamp.BIG_BANG;
+    private ITmfTimestamp fTimestamp3 = TmfTimestamp.BIG_CRUNCH;
+
+    private Long aLong1 = 12345L;
+    private Long aLong2 = 23456L;
+    private Long aLong3 = 34567L;
+    private ITmfLocation fLocation1 = new TmfLongLocation(aLong1);
+    private ITmfLocation fLocation2 = new TmfLongLocation(aLong2);
+    private ITmfLocation fLocation3 = new TmfLongLocation(aLong3);
+
+    private TmfCheckpoint fCheckpoint1 = new TmfCheckpoint(fTimestamp1, fLocation1);
+    private TmfCheckpoint fCheckpoint2 = new TmfCheckpoint(fTimestamp2, fLocation2);
+    private TmfCheckpoint fCheckpoint3 = new TmfCheckpoint(fTimestamp3, fLocation3);
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testTmfCheckpoint() {
+        assertEquals("TmfCheckpoint", fTimestamp1, fCheckpoint1.getTimestamp());
+        assertEquals("TmfCheckpoint", fLocation1,  fCheckpoint1.getLocation());
+    }
+
+    public void testTmfLocationCopy() {
+        final TmfCheckpoint checkpoint = new TmfCheckpoint(fCheckpoint1);
+
+        assertEquals("TmfCheckpoint", fTimestamp1, checkpoint.getTimestamp());
+        assertEquals("TmfCheckpoint", fLocation1,  checkpoint.getLocation());
+    }
+
+    @Test
+    public void testTmfLocationCopy2() {
+        try {
+            new TmfCheckpoint(null);
+            fail("null copy");
+        }
+        catch (final IllegalArgumentException e) {
+            // Success
+        }
+        catch (final Exception e) {
+            fail("wrong exception");
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // compareTo
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testCompareTo() {
+        assertEquals("compareTo",  0, fCheckpoint1.compareTo(fCheckpoint1));
+        assertEquals("compareTo",  1, fCheckpoint1.compareTo(fCheckpoint2));
+        assertEquals("compareTo", -1, fCheckpoint1.compareTo(fCheckpoint3));
+
+        assertEquals("compareTo", -1, fCheckpoint2.compareTo(fCheckpoint1));
+        assertEquals("compareTo",  0, fCheckpoint2.compareTo(fCheckpoint2));
+        assertEquals("compareTo", -1, fCheckpoint2.compareTo(fCheckpoint3));
+
+        assertEquals("compareTo",  1, fCheckpoint3.compareTo(fCheckpoint1));
+        assertEquals("compareTo",  1, fCheckpoint3.compareTo(fCheckpoint2));
+        assertEquals("compareTo",  0, fCheckpoint3.compareTo(fCheckpoint3));
+    }
+
+    @Test
+    public void testCompareToNull() {
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(null, fLocation1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(null, fLocation2);
+        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(null, fLocation3);
+        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(null, fLocation1);
+
+        // Test the various 'null' vs. '!null' combinations
+        assertEquals("compareTo",  0, checkpoint1.compareTo(fCheckpoint1));
+        assertEquals("compareTo",  0, fCheckpoint1.compareTo(checkpoint1));
+        assertEquals("compareTo", -1, checkpoint1.compareTo(fCheckpoint2));
+        assertEquals("compareTo",  1, fCheckpoint2.compareTo(checkpoint1));
+        assertEquals("compareTo", -1, checkpoint1.compareTo(fCheckpoint3));
+        assertEquals("compareTo",  1, fCheckpoint3.compareTo(checkpoint1));
+
+        // Test the 'null' vs. 'null' combinations
+        assertEquals("compareTo",  0, checkpoint1.compareTo(checkpoint4));
+        assertEquals("compareTo",  0, checkpoint4.compareTo(checkpoint1));
+        assertEquals("compareTo", -1, checkpoint1.compareTo(checkpoint2));
+        assertEquals("compareTo",  1, checkpoint2.compareTo(checkpoint1));
+        assertEquals("compareTo", -1, checkpoint1.compareTo(checkpoint3));
+        assertEquals("compareTo",  1, checkpoint3.compareTo(checkpoint1));
+    }
+
+    // ------------------------------------------------------------------------
+    // hashCode
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testHashCode() {
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fCheckpoint2);
+
+        assertTrue("hashCode", fCheckpoint1.hashCode() == checkpoint1.hashCode());
+        assertTrue("hashCode", fCheckpoint2.hashCode() == checkpoint2.hashCode());
+
+        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint2.hashCode());
+        assertTrue("hashCode", fCheckpoint2.hashCode() != checkpoint1.hashCode());
+    }
+
+    @Test
+    public void testHashCodeNull() {
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(null, fLocation1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fTimestamp1, null);
+        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(checkpoint1);
+        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(checkpoint2);
+
+        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint1.hashCode());
+        assertTrue("hashCode", fCheckpoint1.hashCode() != checkpoint2.hashCode());
+
+        assertTrue("hashCode", checkpoint1.hashCode() == checkpoint3.hashCode());
+        assertTrue("hashCode", checkpoint2.hashCode() == checkpoint4.hashCode());
+    }
+
+    // ------------------------------------------------------------------------
+    // equals
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testEqualsReflexivity() {
+        assertTrue("equals", fCheckpoint1.equals(fCheckpoint1));
+        assertTrue("equals", fCheckpoint2.equals(fCheckpoint2));
+
+        assertTrue("equals", !fCheckpoint1.equals(fCheckpoint2));
+        assertTrue("equals", !fCheckpoint2.equals(fCheckpoint1));
+    }
+
+    @Test
+    public void testEqualsSymmetry() {
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fCheckpoint2);
+
+        assertTrue("equals", checkpoint1.equals(fCheckpoint1));
+        assertTrue("equals", fCheckpoint1.equals(checkpoint1));
+
+        assertTrue("equals", checkpoint2.equals(fCheckpoint2));
+        assertTrue("equals", fCheckpoint2.equals(checkpoint2));
+    }
+
+    @Test
+    public void testEqualsTransivity() {
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fCheckpoint1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(checkpoint1);
+        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(checkpoint2);
+
+        assertTrue("equals", checkpoint1.equals(checkpoint2));
+        assertTrue("equals", checkpoint2.equals(checkpoint3));
+        assertTrue("equals", checkpoint1.equals(checkpoint3));
+    }
+
+    @Test
+    public void testNotEqual() {
+        // Various checkpoints
+        final TmfCheckpoint checkpoint1 = new TmfCheckpoint(fTimestamp1, fLocation1);
+        final TmfCheckpoint checkpoint2 = new TmfCheckpoint(fTimestamp2, fLocation1);
+        final TmfCheckpoint checkpoint3 = new TmfCheckpoint(fTimestamp1, fLocation2);
+        final TmfCheckpoint checkpoint4 = new TmfCheckpoint(fTimestamp1, null);
+        final TmfCheckpoint checkpoint5 = new TmfCheckpoint(null, fLocation1);
+
+        // Null check
+        assertFalse("equals", checkpoint1.equals(null));
+
+        // Different types
+        assertFalse("equals", checkpoint1.equals(new TmfTimestamp()));
+
+        // Null locations/location
+        assertFalse("equals", checkpoint1.equals(checkpoint4));
+        assertFalse("equals", checkpoint1.equals(checkpoint5));
+        assertFalse("equals", checkpoint4.equals(checkpoint1));
+        assertFalse("equals", checkpoint5.equals(checkpoint1));
+
+        // Different locations/location
+        assertFalse("equals", checkpoint1.equals(checkpoint2));
+        assertFalse("equals", checkpoint1.equals(checkpoint3));
+    }
+
+    // ------------------------------------------------------------------------
+    // toString
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testToString() {
+        final String expected1 = "TmfCheckpoint [fLocation=" + fCheckpoint1.getLocation() +
+                ", fTimestamp=" + fCheckpoint1.getTimestamp() + "]";
+        final String expected2 = "TmfCheckpoint [fLocation=" + fCheckpoint2.getLocation() +
+                ", fTimestamp=" + fCheckpoint2.getTimestamp() + "]";
+        final String expected3 = "TmfCheckpoint [fLocation=" + fCheckpoint3.getLocation() +
+                ", fTimestamp=" + fCheckpoint3.getTimestamp() + "]";
+
+        assertEquals("toString", expected1, fCheckpoint1.toString());
+        assertEquals("toString", expected2, fCheckpoint2.toString());
+        assertEquals("toString", expected3, fCheckpoint3.toString());
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfExperimentCheckpointIndexTest.java
new file mode 100644 (file)
index 0000000..e02aa7e
--- /dev/null
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Alexandre Montplaisir - Port to JUnit4
+ *   Patrick Tasse - Updated for ranks in experiment location
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.indexer.checkpoint;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.tests.TmfCoreTestPlugin;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+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.indexer.checkpoint.ITmfCheckpoint;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfExperimentStub;
+import org.eclipse.linuxtools.tmf.tests.stubs.trace.TmfTraceStub;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for the TmfCheckpointIndexTest class.
+ */
+@SuppressWarnings("javadoc")
+public class TmfExperimentCheckpointIndexTest {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+    private static final String DIRECTORY    = "testfiles";
+    private static final String TEST_STREAM1 = "O-Test-10K";
+    private static final String TEST_STREAM2 = "E-Test-10K";
+    private static final String EXPERIMENT   = "MyExperiment";
+    private static int          NB_EVENTS    = 20000;
+    private static int          BLOCK_SIZE   = 1000;
+
+    private static ITmfTrace[] fTestTraces;
+    private static TmfExperimentStub fExperiment;
+
+    // ------------------------------------------------------------------------
+    // Housekeeping
+    // ------------------------------------------------------------------------
+
+    @Before
+    public void setUp() {
+        setupTraces();
+        fExperiment = new TmfExperimentStub(EXPERIMENT, fTestTraces, BLOCK_SIZE);
+        fExperiment.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true);
+    }
+
+    @After
+    public void tearDown() {
+        fExperiment.dispose();
+        fExperiment = null;
+        for (ITmfTrace trace : fTestTraces) {
+            trace.dispose();
+        }
+        fTestTraces = null;
+    }
+
+    private static void setupTraces() {
+        final String path1 = DIRECTORY + File.separator + TEST_STREAM1;
+        final String path2 = DIRECTORY + File.separator + TEST_STREAM2;
+
+        fTestTraces = new ITmfTrace[2];
+        try {
+            URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path1), null);
+            File test = new File(FileLocator.toFileURL(location).toURI());
+            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+            fTestTraces[0] = trace1;
+            location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(path2), null);
+            test = new File(FileLocator.toFileURL(location).toURI());
+            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, true, null, null);
+            fTestTraces[1] = trace2;
+        } catch (final TmfTraceException e) {
+            e.printStackTrace();
+        } catch (final URISyntaxException e) {
+            e.printStackTrace();
+        } catch (final IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Verify checkpoints
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testTmfTraceIndexing() {
+        assertEquals("getCacheSize",   BLOCK_SIZE, fExperiment.getCacheSize());
+        assertEquals("getTraceSize",   NB_EVENTS,  fExperiment.getNbEvents());
+        assertEquals("getRange-start", 1,          fExperiment.getTimeRange().getStartTime().getValue());
+        assertEquals("getRange-end",   NB_EVENTS,  fExperiment.getTimeRange().getEndTime().getValue());
+        assertEquals("getStartTime",   1,          fExperiment.getStartTime().getValue());
+        assertEquals("getEndTime",     NB_EVENTS,  fExperiment.getEndTime().getValue());
+
+        List<ITmfCheckpoint> checkpoints = fExperiment.getIndexer().getCheckpoints();
+        int pageSize = fExperiment.getCacheSize();
+        assertTrue("Checkpoints exist",  checkpoints != null);
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
+
+        // Validate that each checkpoint points to the right event
+        for (int i = 0; i < checkpoints.size(); i++) {
+            ITmfCheckpoint checkpoint = checkpoints.get(i);
+            ITmfLocation location = checkpoint.getLocation();
+            ITmfContext context = fExperiment.seekEvent(location);
+            ITmfEvent event = fExperiment.parseEvent(context);
+            assertTrue(context.getRank() == i * pageSize);
+            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Streaming
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testGrowingIndex() {
+        ITmfTrace[] testTraces = new TmfTraceStub[2];
+        try {
+            URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM1), null);
+            File test = new File(FileLocator.toFileURL(location).toURI());
+            final TmfTraceStub trace1 = new TmfTraceStub(test.getPath(), 0, false, null, null);
+            testTraces[0] = trace1;
+            location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM2), null);
+            test = new File(FileLocator.toFileURL(location).toURI());
+            final TmfTraceStub trace2 = new TmfTraceStub(test.getPath(), 0, false, null, null);
+            testTraces[1] = trace2;
+        } catch (final TmfTraceException e) {
+            e.printStackTrace();
+        } catch (final URISyntaxException e) {
+            e.printStackTrace();
+        } catch (final IOException e) {
+            e.printStackTrace();
+        }
+
+        TmfExperimentStub experiment = new TmfExperimentStub(EXPERIMENT, testTraces, BLOCK_SIZE);
+        int pageSize = experiment.getCacheSize();
+
+        // Build the first half of the index
+        TmfTimeRange range = new TmfTimeRange(new TmfTimestamp(1, -3), new TmfTimestamp(NB_EVENTS / 2 - 1, -3));
+        experiment.getIndexer().buildIndex(0, range, true);
+
+        // Validate that each checkpoint points to the right event
+        List<ITmfCheckpoint> checkpoints = experiment.getIndexer().getCheckpoints();
+        assertTrue("Checkpoints exist",  checkpoints != null);
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE / 2, checkpoints.size());
+
+        // Build the second half of the index
+        experiment.getIndexer().buildIndex(NB_EVENTS / 2, TmfTimeRange.ETERNITY, true);
+
+        // Validate that each checkpoint points to the right event
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
+        for (int i = 0; i < checkpoints.size(); i++) {
+            ITmfCheckpoint checkpoint = checkpoints.get(i);
+            ITmfLocation location = checkpoint.getLocation();
+            ITmfContext context = experiment.seekEvent(location);
+            ITmfEvent event = experiment.parseEvent(context);
+            assertTrue(context.getRank() == i * pageSize);
+            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp(), false) == 0));
+            assertEquals("Checkpoint value", i * pageSize + 1, checkpoint.getTimestamp().getValue());
+        }
+
+        /* Clean up (since we didn't use the class-specific fixtures) */
+        experiment.dispose();
+        for (ITmfTrace trace : testTraces) {
+            trace.dispose();
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/AllTests.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/AllTests.java
new file mode 100644 (file)
index 0000000..3593f4c
--- /dev/null
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Adjusted for new Trace Model
+ *   Alexandre Montplaisir - Port to JUnit4
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.location;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite for org.eclipse.linuxtools.tmf.core.trace.location
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    TmfLocationTest.class,
+})
+public class AllTests {}
\ No newline at end of file
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfLocationTest.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfLocationTest.java
new file mode 100644 (file)
index 0000000..a7c51d1
--- /dev/null
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Alexandre Montplaisir - Port to JUnit4
+ *   Patrick Tasse - Add tests for TmfExperimentLocation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.location;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.linuxtools.internal.tmf.core.trace.TmfExperimentLocation;
+import org.eclipse.linuxtools.internal.tmf.core.trace.TmfLocationArray;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfTimestampLocation;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test suite for the TmfLocation class.
+ */
+@SuppressWarnings("javadoc")
+public class TmfLocationTest {
+
+    // ------------------------------------------------------------------------
+    // Variables
+    // ------------------------------------------------------------------------
+
+    private String aString = "some location";
+    private Long aLong = 12345L;
+    private TmfTimestamp aTimestamp = new TmfTimestamp();
+    private TmfLocationArray aLocationArray;
+
+    private TmfStringLocation fLocation1;
+    private TmfStringLocation fLocation2;
+    private TmfLongLocation fLocation3;
+    private TmfTimestampLocation fLocation4;
+    private TmfExperimentLocation fExpLocation;
+
+    // ------------------------------------------------------------------------
+    // Housekeeping
+    // ------------------------------------------------------------------------
+
+    @Before
+    public void setUp() {
+        fLocation1 = new TmfStringLocation((String) null);
+        fLocation2 = new TmfStringLocation(aString);
+        fLocation3 = new TmfLongLocation(aLong);
+        fLocation4 = new TmfTimestampLocation(aTimestamp);
+        aLocationArray = new TmfLocationArray(
+                new ITmfLocation[] { fLocation1, fLocation2, fLocation3, fLocation4 },
+                new long[] { 1, 2, 3, 4 }
+                );
+        fExpLocation = new TmfExperimentLocation(aLocationArray);
+    }
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testTmfLocation() {
+        assertNull("TmfLocation", fLocation1.getLocationInfo());
+        assertEquals("TmfLocation", aString, fLocation2.getLocationInfo());
+        assertEquals("TmfLocation", aLong, fLocation3.getLocationInfo());
+        assertEquals("TmfLocation", aTimestamp, fLocation4.getLocationInfo());
+        assertEquals("TmfLocation", aLocationArray, fExpLocation.getLocationInfo());
+    }
+
+    @Test
+    public void testTmfLocationCopy() {
+        TmfStringLocation location1 = new TmfStringLocation(fLocation1);
+        TmfStringLocation location2 = new TmfStringLocation(fLocation2);
+        TmfLongLocation location3 = new TmfLongLocation(fLocation3);
+        TmfTimestampLocation location4 = new TmfTimestampLocation(fLocation4);
+        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
+
+        assertNull("TmfLocation", location1.getLocationInfo());
+        assertEquals("TmfLocation", aString, location2.getLocationInfo());
+        assertEquals("TmfLocation", aLong, location3.getLocationInfo());
+        assertEquals("TmfLocation", aTimestamp, location4.getLocationInfo());
+        assertEquals("TmfLocation", aLocationArray, expLocation.getLocationInfo());
+    }
+
+    // ------------------------------------------------------------------------
+    // hashCode
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testHashCode() {
+        TmfStringLocation location1 = new TmfStringLocation((String) null);
+        TmfStringLocation location2 = new TmfStringLocation(aString);
+        TmfLongLocation location3 = new TmfLongLocation(aLong);
+        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
+        TmfLocationArray locationArray1 = new TmfLocationArray(aLocationArray, 3, fLocation4, 5);
+        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(locationArray1);
+        TmfLocationArray locationArray2 = new TmfLocationArray(aLocationArray, 3, fLocation3, 4);
+        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(locationArray2);
+        TmfLocationArray locationArray3 = new TmfLocationArray(
+                new ITmfLocation[] { fLocation1, fLocation2, fLocation3 },
+                new long[] { 1, 2, 3 }
+                );
+        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(locationArray3);
+
+        assertTrue("hashCode", fLocation1.hashCode() == location1.hashCode());
+        assertTrue("hashCode", fLocation2.hashCode() == location2.hashCode());
+        assertTrue("hashCode", fLocation3.hashCode() == location3.hashCode());
+        assertTrue("hashCode", fExpLocation.hashCode() == expLocation.hashCode());
+
+        assertTrue("hashCode", fLocation2.hashCode() != location3.hashCode());
+        assertTrue("hashCode", fLocation3.hashCode() != location2.hashCode());
+        assertTrue("hashCode", fExpLocation.hashCode() != expLocation1.hashCode());
+        assertTrue("hashCode", fExpLocation.hashCode() != expLocation2.hashCode());
+        assertTrue("hashCode", fExpLocation.hashCode() != expLocation3.hashCode());
+    }
+
+    // ------------------------------------------------------------------------
+    // toEquals
+    // ------------------------------------------------------------------------
+
+    private static class TmfLocation2 extends TmfStringLocation {
+        public TmfLocation2(String location) {
+            super(location);
+        }
+    }
+
+    @Test
+    public void testEqualsWrongTypes() {
+        ITmfLocation location1 = new TmfStringLocation(aString);
+        TmfLocation2 location2 = new TmfLocation2(aString);
+
+        assertFalse("equals", location1.equals(location2));
+        assertFalse("equals", location2.equals(location1));
+    }
+
+    @Test
+    public void testEqualsWithNulls() {
+        TmfStringLocation location1 = new TmfStringLocation(aString);
+        TmfStringLocation location2 = new TmfStringLocation((String) null);
+
+        assertFalse("equals", location1.equals(location2));
+        assertFalse("equals", location2.equals(location1));
+    }
+
+    @Test
+    public void testEqualsReflexivity() {
+        assertTrue("equals", fLocation2.equals(fLocation2));
+        assertTrue("equals", fLocation3.equals(fLocation3));
+        assertTrue("equals", fExpLocation.equals(fExpLocation));
+
+        assertTrue("equals", !fLocation2.equals(fLocation3));
+        assertTrue("equals", !fLocation3.equals(fLocation2));
+        TmfLocationArray locationArray1 = new TmfLocationArray(aLocationArray, 3, fLocation4, 5);
+        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(locationArray1);
+        TmfLocationArray locationArray2 = new TmfLocationArray(aLocationArray, 3, fLocation3, 4);
+        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(locationArray2);
+        TmfLocationArray locationArray3 = new TmfLocationArray(
+                new ITmfLocation[] { fLocation1, fLocation2, fLocation3 },
+                new long[] { 1, 2, 3 }
+                );
+        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(locationArray3);
+        assertTrue("equals", !fExpLocation.equals(expLocation1));
+        assertTrue("equals", !expLocation1.equals(fExpLocation));
+        assertTrue("equals", !fExpLocation.equals(expLocation2));
+        assertTrue("equals", !expLocation2.equals(fExpLocation));
+        assertTrue("equals", !fExpLocation.equals(expLocation3));
+        assertTrue("equals", !expLocation3.equals(fExpLocation));
+    }
+
+    @Test
+    public void testEqualsSymmetry() {
+        TmfStringLocation location2 = new TmfStringLocation(aString);
+        TmfLongLocation location3 = new TmfLongLocation(aLong);
+        TmfExperimentLocation expLocation = new TmfExperimentLocation(fExpLocation);
+
+        assertTrue("equals", location2.equals(fLocation2));
+        assertTrue("equals", fLocation2.equals(location2));
+
+        assertTrue("equals", location3.equals(fLocation3));
+        assertTrue("equals", fLocation3.equals(location3));
+
+        assertTrue("equals", expLocation.equals(fExpLocation));
+        assertTrue("equals", fExpLocation.equals(expLocation));
+    }
+
+    @Test
+    public void testEqualsTransivity() {
+        TmfStringLocation location1 = new TmfStringLocation(aString);
+        TmfStringLocation location2 = new TmfStringLocation(aString);
+        TmfStringLocation location3 = new TmfStringLocation(aString);
+        TmfExperimentLocation expLocation1 = new TmfExperimentLocation(aLocationArray);
+        TmfExperimentLocation expLocation2 = new TmfExperimentLocation(aLocationArray);
+        TmfExperimentLocation expLocation3 = new TmfExperimentLocation(aLocationArray);
+
+        assertTrue("equals", location1.equals(location2));
+        assertTrue("equals", location2.equals(location3));
+        assertTrue("equals", location3.equals(location1));
+        assertTrue("equals", expLocation1.equals(expLocation2));
+        assertTrue("equals", expLocation2.equals(expLocation3));
+        assertTrue("equals", expLocation3.equals(expLocation1));
+    }
+
+    @Test
+    public void testEqualsNull() {
+        assertTrue("equals", !fLocation2.equals(null));
+        assertTrue("equals", !fLocation2.equals(null));
+        assertTrue("equals", !fExpLocation.equals(null));
+    }
+
+    // ------------------------------------------------------------------------
+    // toString
+    // ------------------------------------------------------------------------
+
+    @Test
+    public void testToString() {
+        String str = "some location";
+        Long lng = 12345L;
+        TmfTimestamp ts = new TmfTimestamp();
+
+        TmfStringLocation location1 = new TmfStringLocation(str);
+        TmfLongLocation location2 = new TmfLongLocation(lng);
+        TmfTimestampLocation location3 = new TmfTimestampLocation(ts);
+        TmfExperimentLocation expLocation = new TmfExperimentLocation(aLocationArray);
+
+        String expected1 = "TmfStringLocation [fLocationInfo=" + str + "]";
+        String expected2 = "TmfLongLocation [fLocationInfo=" + lng + "]";
+        String expected3 = "TmfTimestampLocation [fLocationInfo=" + ts + "]";
+        String expected4 = "TmfExperimentLocation [" + aLocationArray + "]";
+
+        assertEquals("toString", expected1, location1.toString());
+        assertEquals("toString", expected2, location2.toString());
+        assertEquals("toString", expected3, location3.toString());
+        assertEquals("toString", expected4, expLocation.toString());
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfStringLocation.java b/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfStringLocation.java
new file mode 100644 (file)
index 0000000..fad258f
--- /dev/null
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.tests.trace.location;
+
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLocation;
+
+/**
+ * <b><u>TmfStringLocation</u></b>
+ * <p>
+ * Implement me. Please.
+ * <p>
+ */
+public class TmfStringLocation extends TmfLocation {
+
+    /**
+     * @param location the concrete trace location
+     */
+    public TmfStringLocation(String location) {
+        super(location);
+    }
+
+    /**
+     * @param other the other location
+     */
+    public TmfStringLocation(TmfStringLocation other) {
+        super(other.getLocationInfo());
+    }
+
+    @Override
+    public String getLocationInfo() {
+        return (String) super.getLocationInfo();
+    }
+
+}
index db9304c146f8a6f5d1140c87da148096be49d7b6..bb264f5e2e6244f36c2b3da4ec668d366e7b2ea0 100644 (file)
@@ -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);
+            fTrace = new TmfTraceStub(test.getPath(), 0, true, null, null);
         } catch (final TmfTraceException e) {
             e.printStackTrace();
         } catch (final URISyntaxException e) {
index bbcee8a8a94bdeb0a3d877ec07d02a9db893235b..2728caf1bb90e69b0c4d305218095afdf556c372 100644 (file)
@@ -46,7 +46,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);
+            fTrace = new TmfTraceStub(test.getPath(), 0, true, null, null);
         } catch (final TmfTraceException e) {
             e.printStackTrace();
         } catch (final URISyntaxException e) {
index d6d6081b8afcfa96bed3f3763d4c212cbc7108aa..524d5127375111e812a903ba11769bbdac7bf181 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
 import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest;
 import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
@@ -34,7 +35,6 @@ import org.eclipse.linuxtools.tmf.tests.stubs.event.TmfSyntheticEventStub;
 @SuppressWarnings("javadoc")
 public class TmfSyntheticEventProviderStub extends TmfEventProvider {
 
-    public static final int BLOCK_SIZE = 100;
     public static final int NB_EVENTS  = 1000;
 
     public TmfSyntheticEventProviderStub() {
@@ -57,7 +57,7 @@ public class TmfSyntheticEventProviderStub extends TmfEventProvider {
         final TmfEventRequest eventRequest = (TmfEventRequest) request;
         final TmfTimeRange range = eventRequest.getRange();
         final TmfEventRequest subRequest =
-                new TmfEventRequest(ITmfEvent.class, range, NB_EVENTS, BLOCK_SIZE) {
+                new TmfEventRequest(ITmfEvent.class, range, 0, NB_EVENTS, ExecutionType.FOREGROUND) {
             @Override
             public void handleData(final ITmfEvent event) {
                 super.handleData(event);
index c15798fbe41130884cfcc716954eeaebec529929..e36dd2c939b8b10b2218c0ee7cc4edaa7d98a7b0 100644 (file)
@@ -26,7 +26,7 @@ public class TmfDataRequestStub extends TmfDataRequest {
      * @param dataType the request data type
      */
     public TmfDataRequestStub(final Class<? extends ITmfEvent> dataType) {
-        super(dataType);
+        super(dataType, 0, ALL_DATA, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -34,7 +34,7 @@ public class TmfDataRequestStub extends TmfDataRequest {
      * @param index the initial event index
      */
     public TmfDataRequestStub(final Class<? extends ITmfEvent> dataType, final int index) {
-        super(dataType, index);
+        super(dataType, index, ALL_DATA, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -42,18 +42,9 @@ public class TmfDataRequestStub extends TmfDataRequest {
      * @param index the initial event index
      * @param nbRequested the number of events requested
      */
-    public TmfDataRequestStub(final Class<? extends ITmfEvent> dataType, final int index, final int nbRequested) {
-        super(dataType, index, nbRequested);
-    }
-
-    /**
-     * @param dataType the request data type
-     * @param index the initial event index
-     * @param nbRequested the number of events requested
-     * @param blockSize the event block size
-     */
-    public TmfDataRequestStub(final Class<? extends ITmfEvent> dataType, final int index, final int nbRequested, final int blockSize) {
-        super(dataType, index, nbRequested, blockSize);
+    public TmfDataRequestStub(final Class<? extends ITmfEvent> dataType,
+            final int index, final int nbRequested) {
+        super(dataType, index, nbRequested, ExecutionType.FOREGROUND);
     }
 
     @Override
index 25e94223eee3a6c47f3b5d59cf2256932097f70b..eb1d741f3e0a871c6c8f84a00d62384a49e21be6 100644 (file)
@@ -25,7 +25,7 @@ public class TmfEventRequestStub extends TmfEventRequest {
      * @param dataType the event type
      */
     public TmfEventRequestStub(final Class<? extends ITmfEvent> dataType) {
-        super(dataType);
+        super(dataType, TmfTimeRange.ETERNITY, 0, ALL_DATA, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -33,7 +33,7 @@ public class TmfEventRequestStub extends TmfEventRequest {
      * @param range the requested time range
      */
     public TmfEventRequestStub(final Class<? extends ITmfEvent> dataType, final TmfTimeRange range) {
-        super(dataType, range);
+        super(dataType, range, 0, ALL_DATA, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -42,7 +42,7 @@ public class TmfEventRequestStub extends TmfEventRequest {
      * @param nbRequested the number of events requested
      */
     public TmfEventRequestStub(final Class<? extends ITmfEvent> dataType, final TmfTimeRange range, final int nbRequested) {
-        super(dataType, range, nbRequested);
+        super(dataType, range, 0, nbRequested, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -52,7 +52,7 @@ public class TmfEventRequestStub extends TmfEventRequest {
      * @param blockSize the event block size
      */
     public TmfEventRequestStub(final Class<? extends ITmfEvent> dataType, final TmfTimeRange range, final int nbRequested, final int blockSize) {
-        super(dataType, range, nbRequested, blockSize);
+        super(dataType, range, 0, nbRequested, ExecutionType.FOREGROUND);
     }
 
     /**
@@ -63,7 +63,7 @@ public class TmfEventRequestStub extends TmfEventRequest {
      * @param blockSize the event block size
      */
     public TmfEventRequestStub(final Class<? extends ITmfEvent> dataType, final TmfTimeRange range, final long index, final int nbRequested, final int blockSize) {
-        super(dataType, range, index, nbRequested, blockSize);
+        super(dataType, range, index, nbRequested, ExecutionType.FOREGROUND);
     }
 
     @Override
index 9c9e3210716a0134f2641e74ee68958cebda1671..3a5df51e0634ba7a58190b5c724417aa092cc4d5 100644 (file)
@@ -14,8 +14,8 @@ package org.eclipse.linuxtools.tmf.tests.stubs.trace;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * <b><u>TmfEmptyTraceStub</u></b>
index 1812d938f3f4efdc7613f2f883284ea89beed7da..a633f36b0a3c97544c485310d95af631164e2a82 100644 (file)
@@ -14,9 +14,9 @@ package org.eclipse.linuxtools.tmf.tests.stubs.trace;
 
 import java.util.List;
 
-import org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpointIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.ITmfCheckpoint;
 
 /**
  * <b><u>TmfIndexerStub</u></b>
index bac3cf0e5469a3a0d907beba24fa131bfbcf974b..8eadfd7266143002b390a6e1bbb575dac5bc9bdf 100644 (file)
@@ -29,19 +29,17 @@ import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceIndexer;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
 
 /**
  * <b><u>TmfTraceStub</u></b>
  * <p>
  * Dummy test trace. Use in conjunction with TmfEventParserStub.
  */
-@SuppressWarnings("javadoc")
 public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
 
     // ------------------------------------------------------------------------
@@ -63,126 +61,92 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     // Constructors
     // ------------------------------------------------------------------------
 
+    /**
+     * Default constructor
+     */
     public TmfTraceStub() {
         super();
         setParser(new TmfEventParserStub(this));
     }
 
     /**
+     * Constructor with which you can specify a custom streaming interval. The
+     * parser and indexer won't be specified.
+     *
      * @param path
-     * @throws FileNotFoundException
-     */
-    public TmfTraceStub(final String path) throws TmfTraceException {
-        this(path, ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false);
-    }
-
-    /**
-     * @param path
+     *            The path to the trace file
      * @param cacheSize
-     * @throws FileNotFoundException
+     *            The cache size
+     * @param interval
+     *            The trace streaming interval
+     * @throws TmfTraceException
+     *             If an error occurred opening the trace
      */
-    public TmfTraceStub(final String path, final int cacheSize) throws TmfTraceException {
-        this(path, cacheSize, false);
-    }
-
-    /**
-     * @param path
-     * @param cacheSize
-     * @throws FileNotFoundException
-     */
-    public TmfTraceStub(final String path, final int cacheSize, final long interval) throws TmfTraceException {
+    public TmfTraceStub(final String path,
+            final int cacheSize,
+            final long interval) throws TmfTraceException {
         super(null, ITmfEvent.class, path, cacheSize, interval, null, null);
-        try {
-            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
-        } catch (FileNotFoundException e) {
-            throw new TmfTraceException(e.getMessage());
-        }
+        setupTrace(path);
         setParser(new TmfEventParserStub(this));
     }
 
     /**
+     * Constructor to specify the parser and indexer. The streaming interval
+     * will be 0.
+     *
      * @param path
+     *            The path to the trace file
      * @param cacheSize
-     * @throws FileNotFoundException
-     */
-    public TmfTraceStub(final String path, final int cacheSize, final ITmfTraceIndexer indexer) throws TmfTraceException {
-        this(path, cacheSize, false, null, indexer);
-    }
-
-    /**
-     * @param path
-     * @param waitForCompletion
-     * @throws FileNotFoundException
-     */
-    public TmfTraceStub(final String path, final boolean waitForCompletion) throws TmfTraceException {
-        this(path, ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, waitForCompletion);
-    }
-
-    /**
-     * @param path
-     * @param cacheSize
+     *            The cache size
      * @param waitForCompletion
-     * @throws FileNotFoundException
+     *            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}.
+     * @throws TmfTraceException
+     *             If an error occurred opening the trace
      */
-    public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
-        super(null, ITmfEvent.class, path, cacheSize, 0, null, null);
-        try {
-            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
-        } catch (FileNotFoundException e) {
-            throw new TmfTraceException(e.getMessage());
-        }
-        setParser(new TmfEventParserStub(this));
+    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);
+        setupTrace(path);
+        setParser((parser != null) ? parser : new TmfEventParserStub(this));
         if (waitForCompletion) {
             indexTrace(true);
         }
     }
 
     /**
-     * @param path
-     * @param cacheSize
-     * @param waitForCompletion
-     * @throws FileNotFoundException
+     * Copy constructor
+     *
+     * @param trace
+     *            The trace to copy
+     * @throws TmfTraceException
+     *             If an error occurred opening the trace
      */
-    public TmfTraceStub(final IResource resource,  final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
-        super(resource, ITmfEvent.class, path, cacheSize, 0, null, null);
-        try {
-            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
-        } catch (FileNotFoundException e) {
-            throw new TmfTraceException(e.getMessage());
-        }
+    public TmfTraceStub(final TmfTraceStub trace) throws TmfTraceException {
+        super(trace);
+        setupTrace(getPath()); // fPath will be set by the super-constructor
         setParser(new TmfEventParserStub(this));
     }
 
-    /**
-     * @param path
-     * @param cacheSize
-     * @param waitForCompletion
-     * @param parser
-     * @throws FileNotFoundException
-     */
-    public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion,
-            final ITmfEventParser parser, final ITmfTraceIndexer indexer) throws TmfTraceException {
-        super(null, ITmfEvent.class, path, cacheSize, 0, indexer, null);
+
+    private void setupTrace(String path) throws TmfTraceException {
         try {
             fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
-        setParser((parser != null) ? parser : new TmfEventParserStub(this));
     }
 
-    /**
-     * Copy constructor
-     */
-    public TmfTraceStub(final TmfTraceStub trace) throws TmfTraceException {
-        super(trace);
-        try {
-            fTrace = new RandomAccessFile(getPath(), "r"); //$NON-NLS-1$
-        } catch (FileNotFoundException e) {
-            throw new TmfTraceException(e.getMessage());
-        }
-        setParser(new TmfEventParserStub(this));
-    }
+    // ------------------------------------------------------------------------
+    // Initializers
+    // ------------------------------------------------------------------------
 
     @Override
     public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
@@ -204,10 +168,19 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     // Accessors
     // ------------------------------------------------------------------------
 
+    /**
+     * @return The file stream to the trace
+     */
     public RandomAccessFile getStream() {
         return fTrace;
     }
 
+    /**
+     * Set the initial range offset.
+     *
+     * @param initOffset
+     *            The new initial range offset
+     */
     public void setInitialRangeOffset(ITmfTimestamp initOffset) {
         fInitialRangeOffset = initOffset;
     }
index 417d6d4869bff08d9380d474e7a59cf53555d4c8..4364e38caa35b9981abc8004f7a58e6908ff34d8 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.core;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.tmf.core.Activator
@@ -10,7 +10,7 @@ Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.linuxtools.ctf.core;bundle-version="2.1.0"
+ org.eclipse.linuxtools.ctf.core;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.internal.tmf.core;x-friends:="org.eclipse.linuxtools.tmf.core.tests",
  org.eclipse.linuxtools.internal.tmf.core.component;x-friends:="org.eclipse.linuxtools.tmf.core.tests",
  org.eclipse.linuxtools.internal.tmf.core.request;x-friends:="org.eclipse.linuxtools.tmf.core.tests",
@@ -38,5 +38,8 @@ Export-Package: org.eclipse.linuxtools.internal.tmf.core;x-friends:="org.eclipse
  org.eclipse.linuxtools.tmf.core.statistics,
  org.eclipse.linuxtools.tmf.core.timestamp,
  org.eclipse.linuxtools.tmf.core.trace,
+ org.eclipse.linuxtools.tmf.core.trace.indexer,
+ org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint,
+ org.eclipse.linuxtools.tmf.core.trace.location,
  org.eclipse.linuxtools.tmf.core.uml2sd,
  org.eclipse.linuxtools.tmf.core.util
index 55aab210eaf2166cd7cb61f17efc4fa0228018b6..d6065d9590bb22e7ed99a9477173efb7d64b003d 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.core</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools TMF Core Plug-in</name>
index f2f2b95df31def04988b0dc6149aacd136834210..0fa9eaff54b8ee9e72fbb0ccfed27d7200cec943 100644 (file)
@@ -90,6 +90,21 @@ public class Activator extends Plugin {
         super.stop(context);
     }
 
+
+    // ------------------------------------------------------------------------
+    // Log an IStatus
+    // ------------------------------------------------------------------------
+
+    /**
+     * Log an IStatus object directly
+     *
+     * @param status
+     *            The status to log
+     */
+    public static void log(IStatus status) {
+        fPlugin.getLog().log(status);
+    }
+
     // ------------------------------------------------------------------------
     // Log INFO
     // ------------------------------------------------------------------------
@@ -172,5 +187,4 @@ public class Activator extends Plugin {
     public static void logError(String message, Throwable exception) {
         fPlugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
     }
-
 }
index 7968a2a9107793c0d6210dccc85fc712aa7ab076..2b8d0b71ec4f3ca62b1cd512bf9552aeb7e2b28f 100644 (file)
@@ -12,7 +12,8 @@
 
 package org.eclipse.linuxtools.internal.tmf.core.request;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
@@ -30,109 +31,35 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
     // Attributes
     // ------------------------------------------------------------------------
 
-       /**
-        * The list of coalesced requests
-        */
-       protected Vector<ITmfDataRequest> fRequests = new Vector<ITmfDataRequest>();
+    /**
+     * The list of coalesced requests
+     */
+    protected final List<ITmfDataRequest> fRequests = new ArrayList<ITmfDataRequest>();
 
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
 
-    /**
-     * Request all the events of a given type (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType) {
-        this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, ExecutionType priority) {
-        this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request all the events of a given type from the given index (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index) {
-        this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type from the given index (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index, ExecutionType priority) {
-        this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested) {
-        this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, ExecutionType priority) {
-        this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (high priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, int blockSize) {
-        super(ITmfEvent.class, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
-    }
-
     /**
      * Request 'n' events of a given type from the given index (given priority).
      * Events are returned in blocks of the given size.
      *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
+     * @param dataType
+     *            The requested data type
+     * @param index
+     *            The index of the first event to retrieve. Use '0' to start at
+     *            the beginning.
+     * @param nbRequested
+     *            The number of events requested. You can use
+     *            {@link TmfDataRequest#ALL_DATA} to request all events.
+     * @param priority
+     *            The requested execution priority
      */
-    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, int blockSize, ExecutionType priority) {
-        super(ITmfEvent.class, index, nbRequested, blockSize, priority);
+    public TmfCoalescedDataRequest(Class<? extends ITmfEvent> dataType,
+            long index,
+            int nbRequested,
+            ExecutionType priority) {
+        super(ITmfEvent.class, index, nbRequested, priority);
     }
 
     // ------------------------------------------------------------------------
@@ -142,7 +69,8 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
     /**
      * Add a request to this one.
      *
-     * @param request The request to add
+     * @param request
+     *            The request to add
      */
     public void addRequest(ITmfDataRequest request) {
         fRequests.add(request);
@@ -183,7 +111,7 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
             fIndex = start;
         }
         if ((request.getNbRequested() == TmfDataRequest.ALL_DATA) ||
-             (fNbRequested == TmfDataRequest.ALL_DATA))
+                (fNbRequested == TmfDataRequest.ALL_DATA))
         {
             fNbRequested = TmfDataRequest.ALL_DATA;
         } else {
@@ -191,36 +119,36 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
         }
     }
 
-       /**
-        * @return The list of IDs of the sub-requests
-        */
-       @SuppressWarnings("nls")
+    /**
+     * @return The list of IDs of the sub-requests
+     */
+    @SuppressWarnings("nls")
     public String getSubRequestIds() {
-           StringBuffer result = new StringBuffer("[");
-           for (int i = 0; i < fRequests.size(); i++) {
-               if (i != 0) {
+        StringBuffer result = new StringBuffer("[");
+        for (int i = 0; i < fRequests.size(); i++) {
+            if (i != 0) {
                 result.append(", ");
             }
-               result.append(fRequests.get(i).getRequestId());
-           }
-           result.append("]");
-           return result.toString();
-       }
+            result.append(fRequests.get(i).getRequestId());
+        }
+        result.append("]");
+        return result.toString();
+    }
 
     // ------------------------------------------------------------------------
     // ITmfDataRequest
     // ------------------------------------------------------------------------
 
     @Override
-       public void handleData(ITmfEvent data) {
-               super.handleData(data);
-       // Don't call sub-requests handleData() unless this is a
-               // TmfCoalescedDataRequest; extended classes should call
-               // the sub-requests handleData().
-               if (getClass() == TmfCoalescedDataRequest.class) {
-                   long index = getIndex() + getNbRead() - 1;
-               for (ITmfDataRequest request : fRequests) {
-                   if (!request.isCompleted()) {
+    public void handleData(ITmfEvent data) {
+        super.handleData(data);
+        // Don't call sub-requests handleData() unless this is a
+        // TmfCoalescedDataRequest; extended classes should call
+        // the sub-requests handleData().
+        if (getClass() == TmfCoalescedDataRequest.class) {
+            long index = getIndex() + getNbRead() - 1;
+            for (ITmfDataRequest request : fRequests) {
+                if (!request.isCompleted()) {
                     if (request.getDataType().isInstance(data)) {
                         long start = request.getIndex();
                         long end = start + request.getNbRequested();
@@ -243,32 +171,32 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
         super.start();
     }
 
-       @Override
+    @Override
     public void done() {
-       for (ITmfDataRequest request : fRequests) {
-           if (!request.isCompleted()) {
-               request.done();
-           }
-       }
-       super.done();
+        for (ITmfDataRequest request : fRequests) {
+            if (!request.isCompleted()) {
+                request.done();
+            }
+        }
+        super.done();
     }
 
     @Override
     public void fail() {
-       for (ITmfDataRequest request : fRequests) {
-               request.fail();
-       }
-       super.fail();
+        for (ITmfDataRequest request : fRequests) {
+            request.fail();
+        }
+        super.fail();
     }
 
     @Override
     public void cancel() {
-       for (ITmfDataRequest request : fRequests) {
-           if (!request.isCompleted()) {
-               request.cancel();
-           }
-       }
-       super.cancel();
+        for (ITmfDataRequest request : fRequests) {
+            if (!request.isCompleted()) {
+                request.cancel();
+            }
+        }
+        super.cancel();
     }
 
     @Override
@@ -318,7 +246,6 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
 
     }
 
-
     // ------------------------------------------------------------------------
     // Object
     // ------------------------------------------------------------------------
@@ -326,26 +253,26 @@ public class TmfCoalescedDataRequest extends TmfDataRequest {
     @Override
     // All requests have a unique id
     public int hashCode() {
-       return super.hashCode();
+        return super.hashCode();
     }
 
     @Override
     public boolean equals(Object other) {
-       if (other instanceof TmfCoalescedDataRequest) {
-               TmfCoalescedDataRequest request = (TmfCoalescedDataRequest) other;
-                       return  (request.getDataType()    == getDataType())   &&
-                                       (request.getIndex()       == getIndex())      &&
-                                       (request.getNbRequested() == getNbRequested() &&
-                               (request.getExecType()    == getExecType()));
-               }
-               return false;
+        if (other instanceof TmfCoalescedDataRequest) {
+            TmfCoalescedDataRequest request = (TmfCoalescedDataRequest) other;
+            return (request.getDataType() == getDataType()) &&
+                    (request.getIndex() == getIndex()) &&
+                    (request.getNbRequested() == getNbRequested() &&
+                    (request.getExecType() == getExecType()));
+        }
+        return false;
     }
 
     @Override
     @SuppressWarnings("nls")
     public String toString() {
         return "[TmfCoalescedDataRequest(" + getRequestId() + "," + getDataType().getSimpleName()
-                + "," + getExecType() + "," + getIndex() + "," + getNbRequested() + ","
-                + getBlockSize() + ", " + fRequests.toString() + ")]";
+                + "," + getExecType() + "," + getIndex() + "," + getNbRequested() + ", "
+                + fRequests.toString() + ")]";
     }
 }
index d7eac1d019aea09000675606f8dff4dfd6c0f8c0..1cd07f01465dcaff768c635798da80ec2a7d57de 100644 (file)
@@ -32,121 +32,36 @@ public class TmfCoalescedEventRequest extends TmfCoalescedDataRequest implements
     // Attributes
     // ------------------------------------------------------------------------
 
-       private TmfTimeRange fRange;    // The requested events time range
+    private TmfTimeRange fRange; // The requested events time range
 
     // ------------------------------------------------------------------------
     // Constructor
     // ------------------------------------------------------------------------
 
     /**
-     * Request all the events of a given type (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+     * Request 'n' events of a given type for the given time range (given
+     * priority). Events are returned in blocks of the given size.
      *
-     * @param dataType the requested data type
+     * @param dataType
+     *            The requested data type
+     * @param range
+     *            The range of the request. You can use
+     *            {@link TmfTimeRange#ETERNITY} to request all events.
+     * @param index
+     *            The index of the first event to retrieve. Use '0' to start at
+     *            the beginning.
+     * @param nbRequested
+     *            The number of events requested. You can use
+     *            {@link TmfDataRequest#ALL_DATA} to request all events.
+     * @param priority
+     *            The requested execution priority
      */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType) {
-        this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, ExecutionType priority) {
-        this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request all the events of a given type for the given time range (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range) {
-        this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type for the given time range (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, ExecutionType priority) {
-        this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given time range (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested) {
-        this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, ExecutionType priority) {
-        this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (high priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, int blockSize) {
-        this(dataType, range, 0, nbRequested, blockSize, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, int blockSize, ExecutionType priority) {
-        this(dataType, range, 0, nbRequested, blockSize, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
-     */
-    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize, ExecutionType priority) {
-        super(ITmfEvent.class, index, nbRequested, blockSize, priority);
+    public TmfCoalescedEventRequest(Class<? extends ITmfEvent> dataType,
+            TmfTimeRange range,
+            long index,
+            int nbRequested,
+            ExecutionType priority) {
+        super(ITmfEvent.class, index, nbRequested, priority);
         fRange = range;
 
         if (TmfCoreTracer.isRequestTraced()) {
@@ -174,25 +89,25 @@ public class TmfCoalescedEventRequest extends TmfCoalescedDataRequest implements
         }
     }
 
-       @Override
-       public boolean isCompatible(ITmfDataRequest request) {
-           if (request instanceof ITmfEventRequest) {
-               if (super.isCompatible(request)) {
-                   return overlaps((ITmfEventRequest) request);
-               }
-           }
-           return false;
-       }
+    @Override
+    public boolean isCompatible(ITmfDataRequest request) {
+        if (request instanceof ITmfEventRequest) {
+            if (super.isCompatible(request)) {
+                return overlaps((ITmfEventRequest) request);
+            }
+        }
+        return false;
+    }
 
     private boolean overlaps(ITmfEventRequest request) {
         ITmfTimestamp startTime = request.getRange().getStartTime();
-        ITmfTimestamp endTime   = request.getRange().getEndTime();
+        ITmfTimestamp endTime = request.getRange().getEndTime();
         return (startTime.compareTo(endTime) <= 0) && (fRange.getStartTime().compareTo(fRange.getEndTime()) <= 0);
     }
 
     private void merge(ITmfEventRequest request) {
         ITmfTimestamp startTime = request.getRange().getStartTime();
-        ITmfTimestamp endTime   = request.getRange().getEndTime();
+        ITmfTimestamp endTime = request.getRange().getEndTime();
         if (!fRange.contains(startTime) && fRange.getStartTime().compareTo(startTime) > 0) {
             fRange = new TmfTimeRange(startTime, fRange.getEndTime());
         }
@@ -242,15 +157,15 @@ public class TmfCoalescedEventRequest extends TmfCoalescedDataRequest implements
     // ITmfEventRequest
     // ------------------------------------------------------------------------
 
-       @Override
-       public TmfTimeRange getRange() {
-               return fRange;
-       }
+    @Override
+    public TmfTimeRange getRange() {
+        return fRange;
+    }
 
-       @Override
-       public void setStartIndex(int index) {
-               setIndex(index);
-       }
+    @Override
+    public void setStartIndex(int index) {
+        setIndex(index);
+    }
 
     // ------------------------------------------------------------------------
     // Object
@@ -259,22 +174,22 @@ public class TmfCoalescedEventRequest extends TmfCoalescedDataRequest implements
     @Override
     // All requests have a unique id
     public int hashCode() {
-       return super.hashCode();
+        return super.hashCode();
     }
 
     @Override
     public boolean equals(Object other) {
-       if (other instanceof TmfCoalescedEventRequest) {
-               TmfCoalescedEventRequest request = (TmfCoalescedEventRequest) other;
-                       return  (request.getDataType()    == getDataType()) &&
-                                       (request.getIndex()       == getIndex())    &&
-                                       (request.getNbRequested() == getNbRequested()) &&
-                               (request.getRange().equals(getRange()));
-               }
-       if (other instanceof TmfCoalescedDataRequest) {
-                       return super.equals(other);
-       }
-               return false;
+        if (other instanceof TmfCoalescedEventRequest) {
+            TmfCoalescedEventRequest request = (TmfCoalescedEventRequest) other;
+            return (request.getDataType() == getDataType()) &&
+                    (request.getIndex() == getIndex()) &&
+                    (request.getNbRequested() == getNbRequested()) &&
+                    (request.getRange().equals(getRange()));
+        }
+        if (other instanceof TmfCoalescedDataRequest) {
+            return super.equals(other);
+        }
+        return false;
     }
 
     @Override
@@ -282,7 +197,7 @@ public class TmfCoalescedEventRequest extends TmfCoalescedDataRequest implements
     public String toString() {
         return "[TmfCoalescedEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
                 + "," + getExecType() + "," + getRange() + "," + getIndex() + "," + getNbRequested()
-                + "," + getBlockSize() + ", " + fRequests.toString() + ")]";
+                + ", " + fRequests.toString() + ")]";
     }
 
 }
index e56f39a314df0f500dad2370577ca7552ab0c056..6abe91c55da31b3fc8fbafdcca943efd23e941b5 100644 (file)
@@ -225,10 +225,6 @@ public class HistoryBuilder extends TmfComponent {
 }
 
 class StateSystemBuildRequest extends TmfEventRequest {
-
-    /** The amount of events queried at a time through the requests */
-    private static final int CHUNK_SIZE = 50000;
-
     private final HistoryBuilder builder;
     private final ITmfStateProvider sci;
     private final ITmfTrace trace;
@@ -236,8 +232,8 @@ class StateSystemBuildRequest extends TmfEventRequest {
     StateSystemBuildRequest(HistoryBuilder builder) {
         super(builder.getStateProvider().getExpectedEventType(),
                 TmfTimeRange.ETERNITY,
+                0,
                 TmfDataRequest.ALL_DATA,
-                CHUNK_SIZE,
                 ITmfDataRequest.ExecutionType.BACKGROUND);
         this.builder = builder;
         this.sci = builder.getStateProvider();
index 5568d9f2a3f0400e9a17b41b8f4a64c62665a3c3..a73c5c0e8d223a9cf4bbcebc5ce509d47243979a 100644 (file)
@@ -283,10 +283,6 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
     // ------------------------------------------------------------------------
 
     private class CheckpointsRequest extends TmfEventRequest {
-
-        /** The amount of events queried at a time through the requests */
-        private static final int CHUNK_SIZE = 50000;
-
         private final ITmfTrace trace;
         private final Map<Long, Long> checkpts;
         private long eventCount;
@@ -295,8 +291,8 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
         public CheckpointsRequest(ITmfStateProvider input, Map<Long, Long> checkpoints) {
             super(input.getExpectedEventType(),
                     TmfTimeRange.ETERNITY,
+                    0,
                     TmfDataRequest.ALL_DATA,
-                    CHUNK_SIZE,
                     ITmfDataRequest.ExecutionType.BACKGROUND);
             checkpoints.clear();
             this.trace = input.getTrace();
@@ -330,16 +326,14 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
     }
 
     private class PartialStateSystemRequest extends TmfEventRequest {
-
-        private static final int CHUNK_SIZE = 50000;
         private final ITmfStateProvider sci;
         private final ITmfTrace trace;
 
         PartialStateSystemRequest(ITmfStateProvider sci, TmfTimeRange range) {
             super(sci.getExpectedEventType(),
                     range,
+                    0,
                     TmfDataRequest.ALL_DATA,
-                    CHUNK_SIZE,
                     ITmfDataRequest.ExecutionType.BACKGROUND);
             this.sci = sci;
             this.trace = sci.getTrace();
index 459493b31584df2c48c1d7208ecccc5ca5401925..bbd7b650dfdcfbaf2624ac6461057f140538833f 100644 (file)
@@ -14,7 +14,7 @@
 
 package org.eclipse.linuxtools.internal.tmf.core.trace;
 
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 
 /**
index 13deef2d00934425e74d6aa844f357dd93f66bd6..d0f5c38b6e2bdcc5634b71c94e2444c648b9c55b 100644 (file)
@@ -16,7 +16,7 @@ package org.eclipse.linuxtools.internal.tmf.core.trace;
 
 import java.util.Arrays;
 
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 
 /**
index fda7d41ca8ec8673b1788e02d63a87c8faee21af..cb0e3484893a008d81379cccf08f1bafef57fa1e 100644 (file)
@@ -264,7 +264,7 @@ public abstract class TmfDataProvider extends TmfComponent implements ITmfDataPr
     protected void newCoalescedDataRequest(ITmfDataRequest request) {
         synchronized (fLock) {
             TmfCoalescedDataRequest coalescedRequest = new TmfCoalescedDataRequest(request.getDataType(), request.getIndex(),
-                    request.getNbRequested(), request.getBlockSize(), request.getExecType());
+                    request.getNbRequested(), request.getExecType());
             coalescedRequest.addRequest(request);
             if (TmfCoreTracer.isRequestTraced()) {
                 TmfCoreTracer.traceRequest(request, "COALESCED with " + coalescedRequest.getRequestId()); //$NON-NLS-1$
@@ -304,7 +304,7 @@ public abstract class TmfDataProvider extends TmfComponent implements ITmfDataPr
         if (request.getExecType() == ExecutionType.FOREGROUND) {
             queueRequest(request);
         } else {
-            queueBackgroundRequest(request, request.getBlockSize(), true);
+            queueBackgroundRequest(request, true);
         }
     }
 
@@ -335,12 +335,11 @@ public abstract class TmfDataProvider extends TmfComponent implements ITmfDataPr
      *
      * @param request
      *            The request
-     * @param blockSize
-     *            The request should be split in chunks of this size
      * @param indexing
      *            Should we index the chunks
+     * @since 3.0
      */
-    protected void queueBackgroundRequest(final ITmfDataRequest request, final int blockSize, final boolean indexing) {
+    protected void queueBackgroundRequest(final ITmfDataRequest request, final boolean indexing) {
         queueRequest(request);
     }
 
index 9a84d00b317cd09198123141819ca001da342691..7f661679f4d009c3f8145b21721057102a0e2a01 100644 (file)
@@ -98,8 +98,12 @@ public abstract class TmfEventProvider extends TmfDataProvider {
     protected synchronized void newCoalescedDataRequest(ITmfDataRequest request) {
         if (request instanceof ITmfEventRequest) {
             ITmfEventRequest eventRequest = (ITmfEventRequest) request;
-            TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(eventRequest.getDataType(), eventRequest.getRange(),
-                    eventRequest.getIndex(), eventRequest.getNbRequested(), eventRequest.getBlockSize(), eventRequest.getExecType());
+            TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(
+                            eventRequest.getDataType(),
+                            eventRequest.getRange(),
+                            eventRequest.getIndex(),
+                            eventRequest.getNbRequested(),
+                            eventRequest.getExecType());
             coalescedRequest.addRequest(eventRequest);
             if (TmfCoreTracer.isRequestTraced()) {
                 TmfCoreTracer.traceRequest(request, "COALESCED with " + coalescedRequest.getRequestId()); //$NON-NLS-1$
index 8311e7acb8fc351abd3183feab786cb491110e6f..9635d55a68481cdcd96f205b892e58bc95b7b23d 100644 (file)
@@ -13,7 +13,7 @@ package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
 import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * The CTF trace reader iterator.
@@ -202,6 +202,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext,
     /**
      * Method setLocation.
      * @param location ITmfLocation<?>
+     * @since 3.0
      */
     @Override
     public void setLocation(final ITmfLocation location) {
index 6cb87d918ffe02be71e1c26a2aa76ed345305794..b310f822c81eb433697b861498e3a631c88f7817 100644 (file)
@@ -13,7 +13,7 @@
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLocation;
 
 /**
  * The nugget of information that is unique to a location in a CTF trace.
index b1ef6d79559a2f8479c37527276aafb2570815e9..50278cbba445f9333a2ffb5dbd2d8b89a16c6358 100644 (file)
@@ -12,7 +12,7 @@
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * Lightweight Context for CtfTmf traces. Should only use 3 references, 1 ref to
@@ -58,6 +58,9 @@ public class CtfTmfContext implements ITmfContext {
         return curRank;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public ITmfLocation getLocation() {
         return curLocation;
@@ -68,6 +71,9 @@ public class CtfTmfContext implements ITmfContext {
         return curRank != CtfLocation.INVALID_LOCATION.getTimestamp();
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public void setLocation(ITmfLocation location) {
         curLocation = (CtfLocation) location;
index 3c4de5ddc53e5234499d29ac65ef9b68685c8b0b..4b82324fd3fa0168c6e5b0ab57103df029810a23 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -187,57 +186,6 @@ public abstract class CtfTmfEventField extends TmfEventField {
     public String toString() {
         return getName() + '=' + getFormattedValue();
     }
-
-    /**
-     * Print a numeric value as a string in a given base
-     *
-     * @param value
-     *            The value to print as string
-     * @param base
-     *            The base for this value
-     * @param signed
-     *            Is the value signed or not
-     * @return formatted number string
-     * @since 2.0
-     */
-    public final static String formatNumber(long value, int base, boolean signed) {
-        String s;
-
-        /* Format the number correctly according to the integer's base */
-        switch (base) {
-        case 2:
-            s = "0b" + Long.toBinaryString(value); //$NON-NLS-1$
-            break;
-        case 8:
-            s = "0" + Long.toOctalString(value); //$NON-NLS-1$
-
-            break;
-        case 16:
-            s = "0x" + Long.toHexString(value); //$NON-NLS-1$
-            break;
-        case 10:
-        default:
-            /* For non-standard base, we'll just print it as a decimal number */
-            if (!signed && value < 0) {
-                /* Since there are no 'unsigned long', handle this case with BigInteger */
-                BigInteger bigInteger = BigInteger.valueOf(value);
-                /*
-                 * powerOfTwo = 2^64 we add 2^64 to the negative number to get
-                 * the real unsigned value
-                 */
-                BigInteger powerOfTwo = (BigInteger.valueOf(Long.MAX_VALUE)).add(BigInteger.valueOf(1));
-                powerOfTwo = powerOfTwo.multiply(BigInteger.valueOf(2));
-                bigInteger = bigInteger.add(powerOfTwo);
-
-                s = bigInteger.toString();
-            } else {
-                s = Long.toString(value);
-            }
-            break;
-        }
-        return s;
-    }
-
 }
 
 /**
@@ -274,7 +222,7 @@ final class CTFIntegerField extends CtfTmfEventField {
 
     @Override
     public String getFormattedValue() {
-        return formatNumber(getValue(), base, signed);
+        return IntegerDefinition.formatNumber(getValue(), base, signed);
     }
 
 }
@@ -342,7 +290,7 @@ final class CTFIntegerArrayField extends CtfTmfEventField {
         if (formattedValue == null) {
             List<String> strings = new ArrayList<String>();
             for (Long value : getValue()) {
-                strings.add(formatNumber(value, base, signed));
+                strings.add(IntegerDefinition.formatNumber(value, base, signed));
             }
             formattedValue = strings.toString();
         }
index e26d535c509d0c68291e0a4881eed766401cba54..648550d54333ea4cc2c5b1100f4bf5023d34eb5f 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
+import org.eclipse.linuxtools.ctf.core.event.CTFClock;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTraceReader;
@@ -32,9 +33,9 @@ import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceProperties;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * The CTf trace handler
@@ -53,6 +54,11 @@ public class CtfTmfTrace extends TmfTrace
      */
     protected static final int DEFAULT_CACHE_SIZE = 50000;
 
+    /*
+     * The Ctf clock unique identifier field
+     */
+    private static final String CLOCK_HOST_PROPERTY = "uuid"; //$NON-NLS-1$
+
     // -------------------------------------------
     // Fields
     // -------------------------------------------
@@ -164,12 +170,16 @@ public class CtfTmfTrace extends TmfTrace
      *
      * @return null, since the trace has no knowledge of the current location
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getCurrentLocation()
+     * @since 3.0
      */
     @Override
     public ITmfLocation getCurrentLocation() {
         return null;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public double getLocationRatio(ITmfLocation location) {
         final CtfLocation curLocation = (CtfLocation) location;
@@ -189,6 +199,7 @@ public class CtfTmfTrace extends TmfTrace
      * @param location
      *            ITmfLocation<?>
      * @return ITmfContext
+     * @since 3.0
      */
     @Override
     public synchronized ITmfContext seekEvent(final ITmfLocation location) {
@@ -281,6 +292,25 @@ public class CtfTmfTrace extends TmfTrace
         return fTrace;
     }
 
+    /**
+     * Ctf traces have a clock with a unique uuid that will be used to identify
+     * the host. Traces with the same clock uuid will be known to have been made
+     * on the same machine.
+     *
+     * Note: uuid is an optional field, it may not be there for a clock.
+     */
+    @Override
+    public String getHostId() {
+        CTFClock clock = getCTFTrace().getClock();
+        if (clock != null) {
+            String clockHost = (String) clock.getProperty(CLOCK_HOST_PROPERTY);
+            if (clockHost != null) {
+                return clockHost;
+            }
+        }
+        return super.getHostId();
+    }
+
     // -------------------------------------------
     // ITmfTraceProperties
     // -------------------------------------------
@@ -317,7 +347,7 @@ public class CtfTmfTrace extends TmfTrace
      * @param eventName
      *            The name of the event to check
      * @return Whether the event is in the metadata or not
-     * @since 2.1
+     * @since 3.0
      */
     public boolean hasEvent(final String eventName) {
         Map<Long, IEventDeclaration> events = fTrace.getEvents(0L);
@@ -337,7 +367,7 @@ public class CtfTmfTrace extends TmfTrace
      * @param names
      *            The array of events to check for
      * @return Whether all events are in the metadata
-     * @since 2.1
+     * @since 3.0
      */
     public boolean hasAllEvents(String[] names) {
         for (String name : names) {
@@ -355,7 +385,7 @@ public class CtfTmfTrace extends TmfTrace
      * @param names
      *            The array of event names of check for
      * @return Whether one of the event is present in trace metadata
-     * @since 2.1
+     * @since 3.0
      */
     public boolean hasAtLeastOneOfEvents(String[] names) {
         for (String name : names) {
index 6d51e613eece8373423f1e113b8c77bee099f4ff..73ac06438e22bb2bb39c848f10f338679830d934 100644 (file)
@@ -24,7 +24,7 @@ public class Messages extends NLS {
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.core.ctfadaptor.messages"; //$NON-NLS-1$
 
     /** Buffer overflow detected
-     * @since 2.1*/
+     * @since 3.0*/
     public static String CtfTmfTrace_BufferOverflowErrorMessage;
 
     /** Major version number not set */
index ae2176e77d6d2d806252cfb5985495d18487daeb..f8fcb6a65f9d35deff7fcc08ce10abf6bb513677 100644 (file)
@@ -81,4 +81,15 @@ public interface ITmfEventField {
      */
     ITmfEventField getField(int index);
 
+    /**
+     * Gets the a sub-field of this field, which may be multiple levels down.
+     *
+     * @param path
+     *            Array of field names to recursively go through
+     * @return The field at the end, or null if a field in the path cannot be
+     *         found
+     * @since 3.0
+     */
+    ITmfEventField getSubField(String[] path);
+
 }
index 14f13e8b9211e1f1b31e40e9456d4ce66aa4f3f6..4123369cc07c41ea19918d7766ee43cde178db78 100644 (file)
@@ -135,6 +135,21 @@ public class TmfEventField implements ITmfEventField {
         return null;
     }
 
+    /**
+     * @since 3.0
+     */
+    @Override
+    public ITmfEventField getSubField(final String[] names) {
+        ITmfEventField field = this;
+        for (String name : names) {
+            field = field.getField(name);
+            if (field == null) {
+                return null;
+            }
+        }
+        return field;
+    }
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
index f41bf094ba9ffabacbb40c115bfd9197facea686..36dbdbf5f2bc2ca70e0c648185532e8ac626abeb 100644 (file)
@@ -69,11 +69,6 @@ public interface ITmfDataRequest {
      */
     int getNbRequested();
 
-    /**
-     * @return the block size (for BG requests)
-     */
-    int getBlockSize();
-
     /**
      * @return the number of events read so far
      */
index 650b4e7c057582d6a799ea8dc93e27cfd905d8ae..2076525d845992f8268045a299821205652dac5a 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
+ *   Alexandre Montplaisir - Consolidated constructors
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.request;
@@ -18,19 +19,20 @@ import org.eclipse.linuxtools.internal.tmf.core.TmfCoreTracer;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 
 /**
- * TmfDataRequests are used to obtain blocks of contiguous data from a data provider. Open ranges can be used,
- * especially for continuous streaming.
+ * TmfDataRequests are used to obtain blocks of contiguous data from a data
+ * provider. Open ranges can be used, especially for continuous streaming.
  * <p>
- * The request is processed asynchronously by a TmfProvider and, as blocks of data become available, handleData() is
- * invoked synchronously for each block. Upon return, the data instances go out of scope and become eligible for gc. It
- * is is thus the responsibility of the requester to either clone or keep a reference to the data it wishes to track
- * specifically.
+ * The request is processed asynchronously by a TmfProvider and, as blocks of
+ * data become available, handleData() is invoked synchronously for each block.
+ * Upon return, the data instances go out of scope and become eligible for gc.
+ * It is is thus the responsibility of the requester to either clone or keep a
+ * reference to the data it wishes to track specifically.
  * <p>
- * This data block approach is used to avoid busting the heap for very large trace files. The block size is
- * configurable.
+ * This data block approach is used to avoid busting the heap for very large
+ * trace files. The block size is configurable.
  * <p>
- * The TmfProvider indicates that the request is completed by calling done(). The request can be canceled at any time
- * with cancel().
+ * The TmfProvider indicates that the request is completed by calling done().
+ * The request can be canceled at any time with cancel().
  * <p>
  * Typical usage:
  *
@@ -60,10 +62,12 @@ import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
  * </i></code>
  * </pre>
  *
- * TODO: Consider decoupling from "time range", "rank", etc and for the more generic notion of "criteria". This would
- * allow to extend for "time range", etc instead of providing specialized constructors. This also means removing the
- * criteria info from the data structure (with the possible exception of fNbRequested). The nice thing about it is that
- * it would prepare us well for the coming generation of analysis tools.
+ * TODO: Consider decoupling from "time range", "rank", etc and for the more
+ * generic notion of "criteria". This would allow to extend for "time range",
+ * etc instead of providing specialized constructors. This also means removing
+ * the criteria info from the data structure (with the possible exception of
+ * fNbRequested). The nice thing about it is that it would prepare us well for
+ * the coming generation of analysis tools.
  *
  * TODO: Implement request failures (codes, etc...)
  *
@@ -76,9 +80,6 @@ public abstract class TmfDataRequest implements ITmfDataRequest {
     // Constants
     // ------------------------------------------------------------------------
 
-    /** The default maximum number of events per chunk */
-    public static final int DEFAULT_BLOCK_SIZE = 1000;
-
     /** The request count for all the events */
     public static final int ALL_DATA = Integer.MAX_VALUE;
 
@@ -100,9 +101,6 @@ public abstract class TmfDataRequest implements ITmfDataRequest {
     /** The number of requested events (ALL_DATA for all) */
     protected int fNbRequested;
 
-    /** The block size (for BG requests) */
-    private final int fBlockSize;
-
     /** The number of reads so far */
     private int fNbRead;
 
@@ -124,104 +122,30 @@ public abstract class TmfDataRequest implements ITmfDataRequest {
         fRequestNumber = 0;
     }
 
-    /**
-     * Request all the events of a given type (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType) {
-        this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param priority the requested execution priority
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, ExecutionType priority) {
-        this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request all the events of a given type from the given index (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index) {
-        this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type from the given index (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param priority the requested execution priority
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index, ExecutionType priority) {
-        this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested) {
-        this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param priority the requested execution priority
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, ExecutionType priority) {
-        this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given index (high priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, int blockSize) {
-        this(dataType, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
-    }
-
     /**
      * Request 'n' events of a given type from the given index (given priority).
      * Events are returned in blocks of the given size.
      *
-     * @param dataType the requested data type
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
+     * @param dataType
+     *            The requested data type.
+     * @param index
+     *            The index of the first event to retrieve. Use '0' to start at
+     *            the beginning of the trace.
+     * @param nbRequested
+     *            The number of events requested. You can use
+     *            {@link TmfDataRequest#ALL_DATA} to specify you want all events
+     *            in the trace.
+     * @param priority
+     *            The requested execution priority.
      */
-    public TmfDataRequest(Class<? extends ITmfEvent> dataType, long index, int nbRequested, int blockSize, ExecutionType priority) {
+    public TmfDataRequest(Class<? extends ITmfEvent> dataType,
+            long index,
+            int nbRequested,
+            ExecutionType priority) {
         fRequestId = fRequestNumber++;
         fDataType = dataType;
         fIndex = index;
         fNbRequested = nbRequested;
-        fBlockSize = blockSize;
         fExecType = priority;
         fNbRead = 0;
 
@@ -278,14 +202,6 @@ public abstract class TmfDataRequest implements ITmfDataRequest {
         return fNbRequested;
     }
 
-    /**
-     * @return the block size (for BG requests)
-     */
-    @Override
-    public int getBlockSize() {
-        return fBlockSize;
-    }
-
     /**
      * @return the number of events read so far
      */
@@ -542,6 +458,6 @@ public abstract class TmfDataRequest implements ITmfDataRequest {
             name = name.substring(dot + 1);
         }
         return "[" + name + "(" + fRequestId + "," + fDataType.getSimpleName()+ "," + getExecType()
-                + "," + fIndex + "," + fNbRequested + "," + getBlockSize() + ")]";
+                + "," + fIndex + "," + fNbRequested + ")]";
     }
 }
index 11f966f3593c64a72a1e2ce44f7908be7fd8bce1..32dd8fb211545f591615e6bfaade76d168fe6dc9 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
+ *   Alexandre Montplaisir - Consolidated constructors
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.request;
@@ -28,136 +29,40 @@ public abstract class TmfEventRequest extends TmfDataRequest implements ITmfEven
     // Attributes
     // ------------------------------------------------------------------------
 
-    private final TmfTimeRange fRange; // The requested events time range
+    private final TmfTimeRange fRange; // The requested events time range
 
     // ------------------------------------------------------------------------
-    // Constructors
+    // Constructor
     // ------------------------------------------------------------------------
 
     /**
-     * Request all the events of a given type (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+     * Request 'n' events of a given type for the given time range (given
+     * priority). Events are returned in blocks of the given size.
      *
-     * @param dataType the requested data type
+     * @param dataType
+     *            The requested data type.
+     * @param range
+     *            The time range of the requested events. You can use
+     *            {@link TmfTimeRange#ETERNITY} to indicate you want to cover
+     *            the whole trace.
+     * @param index
+     *            The index of the first event to retrieve. You can use '0' to
+     *            start at the beginning of the trace.
+     * @param nbRequested
+     *            The number of events requested. You can use
+     *            {@link TmfEventRequest#ALL_DATA} to indicate you want all
+     *            events in the time range.
+     * @param priority
+     *            The requested execution priority.
+     * @since 3.0
      */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType) {
-        this(dataType, TmfTimeRange.ETERNITY, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param priority the requested execution priority
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, ExecutionType priority) {
-        this(dataType, TmfTimeRange.ETERNITY, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request all the events of a given type for the given time range (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range) {
-        this(dataType, range, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request all the events of a given type for the given time range (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param priority the requested execution priority
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, ExecutionType priority) {
-        this(dataType, range, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type from the given time range (high priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested) {
-        this(dataType, range, 0, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority)
-     * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param priority the requested execution priority
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, ExecutionType priority) {
-        this(dataType, range, 0, nbRequested, DEFAULT_BLOCK_SIZE, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (high priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, int blockSize) {
-       this(dataType, range, 0, nbRequested, blockSize, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (high priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize) {
-        this(dataType, range, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, int nbRequested, int blockSize, ExecutionType priority) {
-       this(dataType, range, 0, nbRequested, blockSize, priority);
-    }
-
-    /**
-     * Request 'n' events of a given type for the given time range (given priority).
-     * Events are returned in blocks of the given size.
-     *
-     * @param dataType the requested data type
-     * @param range the time range of the requested events
-     * @param index the index of the first event to retrieve
-     * @param nbRequested the number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
-     */
-    public TmfEventRequest(Class<? extends ITmfEvent> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize, ExecutionType priority) {
-       super(dataType, index, nbRequested, blockSize, priority);
-       fRange = range;
+    public TmfEventRequest(Class<? extends ITmfEvent> dataType,
+            TmfTimeRange range,
+            long index,
+            int nbRequested,
+            ExecutionType priority) {
+        super(dataType, index, nbRequested, priority);
+        fRange = range;
 
         if (TmfCoreTracer.isRequestTraced()) {
             String type = getClass().getName();
@@ -181,7 +86,7 @@ public abstract class TmfEventRequest extends TmfDataRequest implements ITmfEven
      * @since 2.0
      */
     @Override
-       public TmfTimeRange getRange() {
+    public TmfTimeRange getRange() {
         return fRange;
     }
 
@@ -190,14 +95,15 @@ public abstract class TmfEventRequest extends TmfDataRequest implements ITmfEven
     // ------------------------------------------------------------------------
 
     /**
-     * this method is called by the event provider to set the index corresponding
-     * to the time range start time once it is known
+     * this method is called by the event provider to set the index
+     * corresponding to the time range start time once it is known
      *
-     * @param index the start index
+     * @param index
+     *            the start index
      */
     @Override
-       public void setStartIndex(int index) {
-       setIndex(index);
+    public void setStartIndex(int index) {
+        setIndex(index);
     }
 
     // ------------------------------------------------------------------------
@@ -207,16 +113,16 @@ public abstract class TmfEventRequest extends TmfDataRequest implements ITmfEven
     @Override
     // All requests have a unique id
     public int hashCode() {
-       return getRequestId();
+        return getRequestId();
     }
 
     @Override
     public boolean equals(Object other) {
-       if (other instanceof TmfEventRequest) {
-               TmfEventRequest request = (TmfEventRequest) other;
-               return super.equals(other) && request.fRange.equals(fRange);
-       }
-       return false;
+        if (other instanceof TmfEventRequest) {
+            TmfEventRequest request = (TmfEventRequest) other;
+            return super.equals(other) && request.fRange.equals(fRange);
+        }
+        return false;
     }
 
     @Override
@@ -228,7 +134,7 @@ public abstract class TmfEventRequest extends TmfDataRequest implements ITmfEven
             name = name.substring(dot + 1);
         }
         return "[" + name + "(" + getRequestId() + "," + getDataType().getSimpleName() + "," + getExecType()
-                + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
+                + "," + getRange() + "," + getIndex() + "," + getNbRequested() + ")]";
     }
 
 }
index ce12780ff20031f15073079d0485a3cb31c33ec4..87185f73edb7a96d2b5bba3e7bda364191fad29b 100644 (file)
@@ -55,7 +55,7 @@ public class TmfRangeSynchSignal extends TmfSignal {
      *            Object sending this signal
      * @param range
      *            The new time range
-     * @since 2.1
+     * @since 3.0
      */
     public TmfRangeSynchSignal(Object source, TmfTimeRange range) {
         super(source);
index 6fa68e2913b5b1c847a74838bfdbf07d8b5cdc68..bdc826c441dedffbaa89e3b6c60f96748c8015fe 100644 (file)
@@ -53,7 +53,7 @@ public class TmfTimeSynchSignal extends TmfSignal {
      *            Timestamp of begin of selection range
      * @param end
      *            Timestamp of end of selection range
-     * @since 2.1
+     * @since 3.0
      */
     public TmfTimeSynchSignal(Object source, ITmfTimestamp begin, ITmfTimestamp end) {
         super(source);
@@ -73,7 +73,7 @@ public class TmfTimeSynchSignal extends TmfSignal {
 
     /**
      * @return The begin timestamp of selection
-     * @since 2.1
+     * @since 3.0
      */
     public ITmfTimestamp getBeginTime() {
         return fBeginTime;
@@ -81,7 +81,7 @@ public class TmfTimeSynchSignal extends TmfSignal {
 
     /**
      * @return The end timestamp of selection
-     * @since 2.1
+     * @since 3.0
      */
     public ITmfTimestamp getEndTime() {
         return fEndTime;
index b47a6a9c8cd90a505fb2d656ce585032a47013fa..e770b33744661c8335dbbe931625d46b0755db25 100644 (file)
@@ -223,8 +223,8 @@ public class TmfEventsStatistics implements ITmfStatistics {
         private long total;
 
         public StatsTotalRequest(ITmfTrace trace, TmfTimeRange range) {
-            super(trace.getEventType(), range, TmfDataRequest.ALL_DATA,
-                    trace.getCacheSize(), ITmfDataRequest.ExecutionType.BACKGROUND);
+            super(trace.getEventType(), range, 0, TmfDataRequest.ALL_DATA,
+                    ITmfDataRequest.ExecutionType.BACKGROUND);
             total = 0;
         }
 
@@ -253,8 +253,8 @@ public class TmfEventsStatistics implements ITmfStatistics {
         private final Map<String, Long> stats;
 
         public StatsPerTypeRequest(ITmfTrace trace, TmfTimeRange range) {
-            super(trace.getEventType(), range, TmfDataRequest.ALL_DATA,
-                    trace.getCacheSize(), ITmfDataRequest.ExecutionType.BACKGROUND);
+            super(trace.getEventType(), range, 0, TmfDataRequest.ALL_DATA,
+                    ITmfDataRequest.ExecutionType.BACKGROUND);
             this.stats = new HashMap<String, Long>();
         }
 
@@ -308,8 +308,8 @@ public class TmfEventsStatistics implements ITmfStatistics {
                     new TmfTimeRange(
                             new TmfTimestamp(borders[0], SCALE),
                             new TmfTimestamp(endTime, SCALE)),
+                    0,
                     TmfDataRequest.ALL_DATA,
-                    trace.getCacheSize(),
                     ITmfDataRequest.ExecutionType.BACKGROUND);
 
             /* Prepare the results map, with all counts at 0 */
index 805043f15a9bf285d566a8afa049d2863b498e55..036c1bf6858f9cd4009704c28fc5b3b89d50cd62 100644 (file)
@@ -13,7 +13,7 @@
 package org.eclipse.linuxtools.tmf.core.timestamp;
 
 /**
- * @since 2.1
+ * @since 3.0
  */
 @SuppressWarnings({ "javadoc", "nls" })
 public interface ITmfTimePreferencesConstants {
index 64d79825795bf39fa9e1c567f009ee0bd6129ab9..96b82da2bb93b5a4c2202b214641c93bd851557f 100644 (file)
@@ -16,7 +16,7 @@ package org.eclipse.linuxtools.tmf.core.timestamp;
 /**
  * A simplified timestamp where scale is nanoseconds and precision is set to 0.
  *
- * @since 2.1
+ * @since 3.0
  */
 public class TmfNanoTimestamp extends TmfTimestamp {
 
index 900208ab9a53919bee2d9fe2b016cca3f2f66e88..379625cd3209e6f0e663aa9d7ea558009aaf467f 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.linuxtools.internal.tmf.core.Activator;
  *
  * @author Francois Chouinard
  * @version 1.0
- * @since 2.1
+ * @since 3.0
  */
 public class TmfTimePreferences {
 
index bbf2d342909b7b82136790f8899905f032d32d68..a04af811b815f32a7fd383f57b38ec876265e565 100644 (file)
@@ -268,7 +268,7 @@ public class TmfTimestampFormat extends SimpleDateFormat {
      *
      * @param pattern the format pattern
      * @param timeZone the time zone
-     * @since 2.1
+     * @since 3.0
      */
     public TmfTimestampFormat(String pattern, TimeZone timeZone) {
         setTimeZone(timeZone);
@@ -289,7 +289,7 @@ public class TmfTimestampFormat extends SimpleDateFormat {
     // ------------------------------------------------------------------------
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     public static void updateDefaultFormats() {
         fDefaultTimeFormat = new TmfTimestampFormat(TmfTimePreferences.getInstance().getTimePattern(), TmfTimePreferences.getInstance().getTimeZone());
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfCheckpoint.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfCheckpoint.java
deleted file mode 100644 (file)
index e2e4e1b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Patrick Tasse - Updated for location in checkpoint
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-
-/**
- * The basic trace checkpoint structure in TMF. The purpose of the checkpoint is
- * to associate a trace location to an event timestamp.
- *
- * @version 1.0
- * @author Francois Chouinard
- *
- * @see ITmfTimestamp
- * @see ITmfLocation
- */
-public interface ITmfCheckpoint extends Comparable<ITmfCheckpoint> {
-
-    // ------------------------------------------------------------------------
-    // Getters
-    // ------------------------------------------------------------------------
-
-    /**
-     * @return the timestamp of the event referred to by the context
-     * @since 2.0
-     */
-    ITmfTimestamp getTimestamp();
-
-    /**
-     * @return the location of the event referred to by the checkpoint
-     */
-    ITmfLocation getLocation();
-
-    // ------------------------------------------------------------------------
-    // Comparable
-    // ------------------------------------------------------------------------
-
-    @Override
-    int compareTo(ITmfCheckpoint checkpoint);
-
-}
index 5413d9b8dac53ea811923c50d5afc00de9b2672d..f3b526e117e2771fcc5eaea1cadaaadf3ba175a4 100644 (file)
@@ -14,6 +14,8 @@
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+
 /**
  * The basic trace context structure in TMF. The purpose of the context is to
  * associate a trace location to an event at a specific rank (order).
@@ -49,6 +51,7 @@ public interface ITmfContext {
 
     /**
      * @return the location of the event at the context rank
+     * @since 3.0
      */
     ITmfLocation getLocation();
 
@@ -63,6 +66,7 @@ public interface ITmfContext {
 
     /**
      * @param location the new location
+     * @since 3.0
      */
     void setLocation(ITmfLocation location);
 
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfLocation.java
deleted file mode 100644 (file)
index 3f7b527..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Updated as per TMF Trace Model 1.0
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-/**
- * The generic trace location in TMF.
- * <p>
- * An ITmfLocation is the equivalent of a random-access file position, holding
- * enough information to allow the positioning of the trace 'pointer' to read an
- * arbitrary event.
- * <p>
- * This location is trace-specific, must be comparable and immutable.
- *
- * @version 2.0
- * @author Francois Chouinard
- */
-public interface ITmfLocation {
-
-    // ------------------------------------------------------------------------
-    // Getters
-    // ------------------------------------------------------------------------
-
-    /**
-     * Returns the concrete trace location information
-     *
-     * @return the location information
-     * @since 2.0
-     */
-    Comparable<?> getLocationInfo();
-
-}
index 24ccaa1a919e749d6487ec1a26c8de15a4ac57f7..6abe83791b6bf10caa3a3710d952cfef11020784 100644 (file)
@@ -26,6 +26,8 @@ import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
 import org.eclipse.linuxtools.tmf.core.statistics.ITmfStatistics;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * The event stream structure in TMF. In its basic form, a trace has:
@@ -259,6 +261,7 @@ public interface ITmfTrace extends ITmfDataProvider {
 
     /**
      * @return the current trace location
+     * @since 3.0
      */
     ITmfLocation getCurrentLocation();
 
@@ -267,6 +270,7 @@ public interface ITmfTrace extends ITmfDataProvider {
      *
      * @param location a trace specific location
      * @return a floating-point number between 0.0 (beginning) and 1.0 (end)
+     * @since 3.0
      */
     double getLocationRatio(ITmfLocation location);
 
@@ -285,6 +289,7 @@ public interface ITmfTrace extends ITmfDataProvider {
      * <p>
      * @param location the trace specific location
      * @return a context which can later be used to read the corresponding event
+     * @since 3.0
      */
     ITmfContext seekEvent(ITmfLocation location);
 
@@ -339,4 +344,18 @@ public interface ITmfTrace extends ITmfDataProvider {
      * @since 2.0
      */
     ITmfTimestamp getInitialRangeOffset();
+
+    /**
+     * Returns the ID of the host this trace is from. The host ID is not
+     * necessarily the hostname, but should be a unique identifier for the
+     * machine on which the trace was taken. It can be used to determine if two
+     * traces were taken on the exact same machine (timestamp are already
+     * synchronized, resources with same id are the same if taken at the same
+     * time, etc).
+     *
+     * @return The host id of this trace
+     * @since 3.0
+     */
+   String getHostId();
+
 }
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTraceIndexer.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTraceIndexer.java
deleted file mode 100644 (file)
index a36b3e0..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
-
-/**
- * The generic trace indexer in TMF with support for incremental indexing.
- *
- * @version 1.0
- * @author Francois Chouinard
- *
- * @see ITmfTrace
- * @see ITmfEvent
- */
-public interface ITmfTraceIndexer {
-
-    /**
-     * Start an asynchronous index building job and waits for the job completion
-     * if required. Typically, the indexing job sends notifications at regular
-     * intervals to indicate its progress.
-     * <p>
-     * <b>Example 1</b>: Index a whole trace asynchronously
-     *
-     * <pre>
-     * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false);
-     * </pre>
-     *
-     * <b>Example 2</b>: Index a whole trace synchronously
-     *
-     * <pre>
-     * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true);
-     * </pre>
-     *
-     * <b>Example 3</b>: Index a trace asynchronously, starting at rank 100
-     *
-     * <pre>
-     * trace.getIndexer().buildIndex(100, TmfTimeRange.ETERNITY, false);
-     * </pre>
-     *
-     * <b>Example 4</b>: Index a trace asynchronously, starting at rank 100 for
-     * events between T1 and T2 (inclusive). This is used for incremental
-     * indexing.
-     *
-     * <pre>
-     * TmfTimeRange range = new TmfTimeRange(T1, T2);
-     * trace.getIndexer().buildIndex(100, range, false);
-     * </pre>
-     *
-     * @param offset
-     *            The offset of the first event to consider
-     * @param range
-     *            The time range to consider
-     * @param waitForCompletion
-     *            Should we block the calling thread until the build is
-     *            complete?
-     * @since 2.0
-     */
-    void buildIndex(long offset, TmfTimeRange range, boolean waitForCompletion);
-
-    /**
-     * Indicates that the indexer is busy indexing the trace.
-     * Will always return false if the indexing is done synchronously.
-     *
-     * @return the state of the indexer (indexing or not)
-     */
-    boolean isIndexing();
-
-    /**
-     * Adds an entry to the trace index.
-     *
-     * @param context The trace context to save
-     * @param timestamp The timestamp matching this context
-     * @since 2.0
-     */
-    void updateIndex(ITmfContext context, ITmfTimestamp timestamp);
-
-    /**
-     * Returns the context of the checkpoint immediately preceding the requested
-     * timestamp (or at the timestamp if it coincides with a checkpoint).
-     *
-     * @param timestamp the requested timestamp
-     * @return the checkpoint context
-     * @since 2.0
-     */
-    ITmfContext seekIndex(ITmfTimestamp timestamp);
-
-    /**
-     * Returns the context of the checkpoint immediately preceding the requested
-     * rank (or at rank if it coincides with a checkpoint).
-     *
-     * @param rank the requested event rank
-     * @return the checkpoint context
-     */
-    ITmfContext seekIndex(long rank);
-
-    /**
-     * Perform cleanup when the indexer is no longer required.
-     */
-    void dispose();
-
-}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpoint.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpoint.java
deleted file mode 100644 (file)
index 9c93ddc..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Updated as per TMF Trace Model 1.0
- *   Patrick Tasse - Updated for location in checkpoint
- ******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-
-/**
- * A basic implementation of ITmfCheckpoint. It simply maps an event timestamp
- * to a generic location.
- *
- * @version 1.0
- * @author Francois Chouinard
- *
- * @see ITmfLocation
- * @see ITmfTimestamp
- */
-public class TmfCheckpoint implements ITmfCheckpoint {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    // The checkpoint location
-    private final ITmfLocation fLocation;
-
-    // The checkpoint timestamp
-    private final ITmfTimestamp fTimestamp;
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    /**
-     * Full constructor
-     *
-     * @param timestamp the checkpoint timestamp
-     * @param location the corresponding trace location
-     * @since 2.0
-     */
-    public TmfCheckpoint(final ITmfTimestamp timestamp, final ITmfLocation location) {
-        fTimestamp = timestamp;
-        fLocation = location;
-    }
-
-    /**
-     * Copy constructor
-     *
-     * @param other the other checkpoint
-     */
-    public TmfCheckpoint(final TmfCheckpoint other) {
-        if (other == null) {
-            throw new IllegalArgumentException();
-        }
-        fTimestamp = other.fTimestamp;
-        fLocation = other.fLocation;
-    }
-
-    // ------------------------------------------------------------------------
-    // ITmfCheckpoint
-    // ------------------------------------------------------------------------
-
-    /**
-     * @since 2.0
-     */
-    @Override
-    public ITmfTimestamp getTimestamp() {
-        return fTimestamp;
-    }
-
-    @Override
-    public ITmfLocation getLocation() {
-        return fLocation;
-    }
-
-    // ------------------------------------------------------------------------
-    // Comparable
-    // ------------------------------------------------------------------------
-
-    @Override
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    public int compareTo(final ITmfCheckpoint other) {
-        int comp = 0;
-        if ((fTimestamp != null) && (other.getTimestamp() != null)) {
-            comp = fTimestamp.compareTo(other.getTimestamp(), false);
-            if (comp != 0) {
-                return comp;
-            }
-            // compare locations if timestamps are the same
-        }
-
-        if ((fLocation == null) && (other.getLocation() == null)) {
-            return 0;
-        }
-
-        // treat location of other as null location which is before any location
-        if ((fLocation != null) && (other.getLocation() == null)) {
-            return 1;
-        }
-
-        // treat this as null location which is before any other locations
-        if ((fLocation == null) && (other.getLocation() != null)) {
-            return -1;
-        }
-
-        // compare location
-        final Comparable location1 = getLocation().getLocationInfo();
-        final Comparable location2 = other.getLocation().getLocationInfo();
-        return location1.compareTo(location2);
-    }
-
-    // ------------------------------------------------------------------------
-    // Object
-    // ------------------------------------------------------------------------
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((fLocation == null) ? 0 : fLocation.hashCode());
-        result = prime * result + ((fTimestamp == null) ? 0 : fTimestamp.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof TmfCheckpoint)) {
-            return false;
-        }
-        final TmfCheckpoint other = (TmfCheckpoint) obj;
-        if (fLocation == null) {
-            if (other.fLocation != null) {
-                return false;
-            }
-        } else if (!fLocation.equals(other.fLocation)) {
-            return false;
-        }
-        if (fTimestamp == null) {
-            if (other.fTimestamp != null) {
-                return false;
-            }
-        } else if (!fTimestamp.equals(other.fTimestamp)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    @SuppressWarnings("nls")
-    public String toString() {
-        return getClass().getSimpleName() + " [fLocation=" + fLocation + ", fTimestamp=" + fTimestamp + "]";
-    }
-
-}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpointIndexer.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfCheckpointIndexer.java
deleted file mode 100644 (file)
index f8964ea..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.linuxtools.internal.tmf.core.Messages;
-import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-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.signal.TmfTraceUpdatedSignal;
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
-
-/**
- * A simple indexer that manages the trace index as an array of trace
- * checkpoints. Checkpoints are stored at fixed intervals (event rank) in
- * ascending timestamp order.
- * <p>
- * The goal being to access a random trace event reasonably fast from the user's
- * standpoint, picking the right interval value becomes a trade-off between speed
- * and memory usage (a shorter inter-event interval is faster but requires more
- * checkpoints).
- * <p>
- * Locating a specific checkpoint is trivial for both rank (rank % interval) and
- * timestamp (bsearch in the array).
- *
- * @version 1.0
- * @author Francois Chouinard
- *
- * @see ITmfTrace
- * @see ITmfEvent
- */
-public class TmfCheckpointIndexer implements ITmfTraceIndexer {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /** The event trace to index */
-    protected final ITmfTrace fTrace;
-
-    /** The interval between checkpoints */
-    private final int fCheckpointInterval;
-
-    /** The event trace to index */
-    private boolean fIsIndexing;
-
-    /**
-     * The trace index. It is composed of checkpoints taken at intervals of
-     * fCheckpointInterval events.
-     */
-    protected final List<ITmfCheckpoint> fTraceIndex;
-
-    /**
-     * The indexing request
-     */
-    private ITmfEventRequest fIndexingRequest = null;
-
-    // ------------------------------------------------------------------------
-    // Construction
-    // ------------------------------------------------------------------------
-
-    /**
-     * Basic constructor that uses the default trace block size as checkpoints
-     * intervals
-     *
-     * @param trace the trace to index
-     */
-    public TmfCheckpointIndexer(final ITmfTrace trace) {
-        this(trace, TmfDataProvider.DEFAULT_BLOCK_SIZE);
-    }
-
-    /**
-     * Full trace indexer
-     *
-     * @param trace the trace to index
-     * @param interval the checkpoints interval
-     */
-    public TmfCheckpointIndexer(final ITmfTrace trace, final int interval) {
-        fTrace = trace;
-        fCheckpointInterval = interval;
-        fTraceIndex = new ArrayList<ITmfCheckpoint>();
-        fIsIndexing = false;
-    }
-
-    @Override
-    public void dispose() {
-        if ((fIndexingRequest != null) && !fIndexingRequest.isCompleted()) {
-            fIndexingRequest.cancel();
-            fTraceIndex.clear();
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // ITmfTraceIndexer - isIndexing
-    // ------------------------------------------------------------------------
-
-    @Override
-    public boolean isIndexing() {
-        return fIsIndexing;
-    }
-
-    // ------------------------------------------------------------------------
-    // ITmfTraceIndexer - buildIndex
-    // ------------------------------------------------------------------------
-
-    /**
-     * @since 2.0
-     */
-    @Override
-    public void buildIndex(final long offset, final TmfTimeRange range, final boolean waitForCompletion) {
-
-        // Don't do anything if we are already indexing
-        synchronized (fTraceIndex) {
-            if (fIsIndexing) {
-                return;
-            }
-            fIsIndexing = true;
-        }
-
-        // The monitoring job
-        final Job job = new Job("Indexing " + fTrace.getName() + "...") { //$NON-NLS-1$ //$NON-NLS-2$
-            @Override
-            protected IStatus run(final IProgressMonitor monitor) {
-                monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
-                while (!monitor.isCanceled()) {
-                    try {
-                        long prevNbEvents = fTrace.getNbEvents();
-                        Thread.sleep(250);
-                        long nbEvents = fTrace.getNbEvents();
-                        setName(Messages.TmfCheckpointIndexer_Indexing + ' ' + fTrace.getName() + " (" + nbEvents + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-                        // setName doesn't refresh the UI, setTaskName does
-                        long rate = (nbEvents - prevNbEvents) * 4;
-                        monitor.setTaskName(rate + " " + Messages.TmfCheckpointIndexer_EventsPerSecond); //$NON-NLS-1$
-                    } catch (final InterruptedException e) {
-                        return Status.OK_STATUS;
-                    }
-                }
-                monitor.done();
-                return Status.OK_STATUS;
-            }
-        };
-        job.schedule();
-
-        // Build a background request for all the trace data. The index is
-        // updated as we go by readNextEvent().
-        fIndexingRequest = new TmfEventRequest(ITmfEvent.class,
-                range, offset, TmfDataRequest.ALL_DATA, fCheckpointInterval, ITmfDataRequest.ExecutionType.BACKGROUND)
-        {
-            @Override
-            public void handleData(final ITmfEvent event) {
-                super.handleData(event);
-                if (event != null) {
-                    // Update the trace status at regular intervals
-                    if ((getNbRead() % fCheckpointInterval) == 0) {
-                        updateTraceStatus();
-                    }
-                }
-            }
-
-            @Override
-            public void handleSuccess() {
-                updateTraceStatus();
-            }
-
-            @Override
-            public void handleCompleted() {
-                job.cancel();
-                super.handleCompleted();
-                fIsIndexing = false;
-            }
-
-            private void updateTraceStatus() {
-                if (fTrace.getNbEvents() > 0) {
-                    signalNewTimeRange(fTrace.getStartTime(), fTrace.getEndTime());
-                }
-            }
-        };
-
-        // Submit the request and wait for completion if required
-        fTrace.sendRequest(fIndexingRequest);
-        if (waitForCompletion) {
-            try {
-                fIndexingRequest.waitForCompletion();
-            } catch (final InterruptedException e) {
-            }
-        }
-    }
-
-    /**
-     * Notify the interested parties that the trace time range has changed
-     *
-     * @param startTime the new start time
-     * @param endTime the new end time
-     */
-    private void signalNewTimeRange(final ITmfTimestamp startTime, final ITmfTimestamp endTime) {
-        fTrace.broadcast(new TmfTraceUpdatedSignal(fTrace, fTrace, new TmfTimeRange(startTime, endTime)));
-    }
-
-    // ------------------------------------------------------------------------
-    // ITmfTraceIndexer - updateIndex
-    // ------------------------------------------------------------------------
-
-    /**
-     * @since 2.0
-     */
-    @Override
-    public synchronized void updateIndex(final ITmfContext context, final ITmfTimestamp timestamp) {
-        if ((context.getRank() % fCheckpointInterval) == 0) {
-            // Determine the table position
-            final long position = context.getRank() / fCheckpointInterval;
-            // Add new entry at proper location (if empty)
-            if (fTraceIndex.size() == position) {
-                fTraceIndex.add(new TmfCheckpoint(timestamp, context.getLocation()));
-            }
-        }
-    }
-
-    // ------------------------------------------------------------------------
-    // ITmfTraceIndexer - seekIndex
-    // ------------------------------------------------------------------------
-
-    /**
-     * @since 2.0
-     */
-    @Override
-    public synchronized ITmfContext seekIndex(final ITmfTimestamp timestamp) {
-
-        // A null timestamp indicates to seek the first event
-        if (timestamp == null) {
-            return fTrace.seekEvent(0);
-        }
-
-        // Find the checkpoint at or before the requested timestamp.
-        // In the very likely event that the timestamp is not at a checkpoint
-        // boundary, bsearch will return index = (- (insertion point + 1)).
-        // It is then trivial to compute the index of the previous checkpoint.
-        int index = Collections.binarySearch(fTraceIndex, new TmfCheckpoint(timestamp, null));
-        if (index < 0) {
-            index = Math.max(0, -(index + 2));
-        } else {
-            // If timestamp was in the list, use previous index to be able to find the
-            // first event with the same timestamp before the checkpoint
-            index = Math.max(0, index - 1);
-        }
-
-        // Position the trace at the checkpoint
-        return restoreCheckpoint(index);
-    }
-
-    @Override
-    public ITmfContext seekIndex(final long rank) {
-
-        // A rank < 0 indicates to seek the first event
-        if (rank < 0) {
-            return fTrace.seekEvent(0);
-        }
-
-        // Find the checkpoint at or before the requested rank.
-        final int index = (int) rank / fCheckpointInterval;
-
-        // Position the trace at the checkpoint
-        return restoreCheckpoint(index);
-    }
-
-    /**
-     * Position the trace at the given checkpoint
-     *
-     * @param checkpoint the checkpoint index
-     * @return the corresponding context
-     */
-    private ITmfContext restoreCheckpoint(final int checkpoint) {
-        ITmfLocation location = null;
-        int index = 0;
-        synchronized (fTraceIndex) {
-            if (!fTraceIndex.isEmpty()) {
-                index = checkpoint;
-                if (index >= fTraceIndex.size()) {
-                    index = fTraceIndex.size() - 1;
-                }
-                location = fTraceIndex.get(index).getLocation();
-            }
-        }
-        final ITmfContext context = fTrace.seekEvent(location);
-        context.setRank((long) index * fCheckpointInterval);
-        return context;
-    }
-
-    // ------------------------------------------------------------------------
-    // Getters
-    // ------------------------------------------------------------------------
-
-    /**
-     * @return the trace index
-     */
-    protected List<ITmfCheckpoint> getTraceIndex() {
-        return fTraceIndex;
-    }
-
-}
index 96a5b93c15806fab831e79b51101c24ff6c443e4..3b55ebe1ecb4c2384ecd18d99543e62a3c4f20d2 100644 (file)
@@ -14,6 +14,8 @@
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+
 /**
  * A basic implementation of ITmfContext.
  * <p>
@@ -52,6 +54,7 @@ public class TmfContext implements ITmfContext {
      * Simple constructor (unknown rank)
      *
      * @param location the event location
+     * @since 3.0
      */
     public TmfContext(final ITmfLocation location) {
         this(location, UNKNOWN_RANK);
@@ -62,6 +65,7 @@ public class TmfContext implements ITmfContext {
      *
      * @param location the event location
      * @param rank the event rank
+     * @since 3.0
      */
     public TmfContext(final ITmfLocation location, final long rank) {
         fLocation = location;
@@ -85,11 +89,17 @@ public class TmfContext implements ITmfContext {
     // ITmfContext
     // ------------------------------------------------------------------------
 
+    /**
+     * @since 3.0
+     */
     @Override
     public ITmfLocation getLocation() {
         return fLocation;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public void setLocation(final ITmfLocation location) {
         fLocation = location;
index fd36a951c8d13b38268eca6d1faea2ca486e7df7..8ecd7ed5da814b10788fa385d808c6b37ae6626b 100644 (file)
@@ -33,6 +33,8 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * TmfExperiment presents a time-ordered, unified view of a set of ITmfTrace:s
@@ -254,6 +256,9 @@ public class TmfExperiment extends TmfTrace implements ITmfEventParser {
     // ITmfTrace trace positioning
     // ------------------------------------------------------------------------
 
+    /**
+     * @since 3.0
+     */
     @Override
     public synchronized ITmfContext seekEvent(final ITmfLocation location) {
         // Validate the location
@@ -306,6 +311,9 @@ public class TmfExperiment extends TmfTrace implements ITmfEventParser {
         return context;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public double getLocationRatio(final ITmfLocation location) {
         if (location instanceof TmfExperimentLocation) {
@@ -319,6 +327,9 @@ public class TmfExperiment extends TmfTrace implements ITmfEventParser {
         return 0.0;
     }
 
+    /**
+     * @since 3.0
+     */
     @Override
     public ITmfLocation getCurrentLocation() {
         // never used
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLocation.java
deleted file mode 100644 (file)
index 5c9bdd1..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Updated as per TMF Trace Model 1.0
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-
-/**
- * A abstract implementation of ITmfLocation. The concrete classes must provide
- * comparable location information.
- *
- * @version 2.0
- * @author Francois Chouinard
- */
-public abstract class TmfLocation implements ITmfLocation {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    private final Comparable<?> fLocationInfo;
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    /**
-     * Standard constructor.
-     *
-     * @param locationInfo
-     *            The concrete trace location
-     */
-    public TmfLocation(final Comparable<?> locationInfo) {
-        fLocationInfo = locationInfo;
-    }
-
-    /**
-     * Copy constructor
-     *
-     * @param location
-     *            The original trace location
-     */
-    public TmfLocation(final TmfLocation location) {
-        fLocationInfo = location.fLocationInfo;
-    }
-
-    // ------------------------------------------------------------------------
-    // Getters
-    // ------------------------------------------------------------------------
-
-    /**
-     * @since 2.0
-     */
-    @Override
-    public Comparable<?> getLocationInfo() {
-        return fLocationInfo;
-    }
-
-    // ------------------------------------------------------------------------
-    // Object
-    // ------------------------------------------------------------------------
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((fLocationInfo != null) ? fLocationInfo.hashCode() : 0);
-        return result;
-    }
-
-    @Override
-    public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final TmfLocation other = (TmfLocation) obj;
-        if (fLocationInfo == null) {
-            if (other.fLocationInfo != null) {
-                return false;
-            }
-        } else if (!fLocationInfo.equals(other.fLocationInfo)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    @SuppressWarnings("nls")
-    public String toString() {
-        return getClass().getSimpleName() + " [fLocationInfo=" + fLocationInfo + "]";
-    }
-
-}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLongLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfLongLocation.java
deleted file mode 100644 (file)
index 905e372..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-/**
- * A concrete implementation of TmfLocation based on Long:s
- *
- * @author Francois Chouinard
- * @since 2.0
- */
-public final class TmfLongLocation extends TmfLocation {
-
-    /**
-     * The normal constructor
-     *
-     * @param locationInfo the concrete location
-     */
-    public TmfLongLocation(final Long locationInfo) {
-        super(locationInfo);
-    }
-
-    /**
-     * The copy constructor
-     *
-     * @param other the other location
-     */
-    public TmfLongLocation(final TmfLongLocation other) {
-        super(other.getLocationInfo());
-    }
-
-    @Override
-    public Long getLocationInfo() {
-        return (Long) super.getLocationInfo();
-    }
-
-}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTimestampLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTimestampLocation.java
deleted file mode 100644 (file)
index 5136d6d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.trace;
-
-import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
-
-/**
- * A concrete implementation of TmfLocation based on ITmfTimestamp:s
- *
- * @author Francois Chouinard
- * @since 2.0
- */
-public final class TmfTimestampLocation extends TmfLocation {
-
-    /**
-     * The normal constructor
-     *
-     * @param locationInfo the concrete location
-     */
-    public TmfTimestampLocation(final ITmfTimestamp locationInfo) {
-        super(locationInfo);
-    }
-
-    /**
-     * The copy constructor
-     *
-     * @param other the other location
-     */
-    public TmfTimestampLocation(final TmfTimestampLocation other) {
-        super(other.getLocationInfo());
-    }
-
-    @Override
-    public ITmfTimestamp getLocationInfo() {
-        return (ITmfTimestamp) super.getLocationInfo();
-    }
-
-}
index 8543d66ff16a97e955db766321d18d1387d89eb9..817d85254701bcf6e7ad3143bbea4de063197804 100644 (file)
@@ -22,6 +22,10 @@ import java.util.Map;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
 import org.eclipse.linuxtools.tmf.core.component.TmfEventProvider;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
@@ -37,6 +41,9 @@ import org.eclipse.linuxtools.tmf.core.statistics.TmfStateStatistics;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint.TmfCheckpointIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * Abstract implementation of ITmfTrace.
@@ -247,16 +254,21 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
      * The default implementation of TmfTrace uses a TmfStatistics back-end.
      * Override this if you want to specify another type (or none at all).
      *
-     * @throws TmfTraceException
-     *             If there was a problem setting up the statistics
-     * @since 2.0
+     * @return An IStatus indicating if the statistics could be built
+     *         successfully or not.
+     * @since 3.0
      */
-    protected void buildStatistics() throws TmfTraceException {
+    protected IStatus buildStatistics() {
         /*
          * Initialize the statistics provider, but only if a Resource has been
          * set (so we don't build it for experiments, for unit tests, etc.)
          */
-        fStatistics = (fResource == null ? null : new TmfStateStatistics(this) );
+        try {
+            fStatistics = (fResource == null ? null : new TmfStateStatistics(this) );
+        } catch (TmfTraceException e) {
+            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+        }
+        return Status.OK_STATUS;
     }
 
     /**
@@ -265,17 +277,16 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
      * Suppressing the warning, because the 'throws' will usually happen in
      * sub-classes.
      *
-     * @throws TmfTraceException
-     *             If there is a problem during the build
-     * @since 2.0
+     * @return An IStatus indicating if the state system could be build
+     *         successfully or not.
+     * @since 3.0
      */
-    @SuppressWarnings("unused")
-    protected void buildStateSystem() throws TmfTraceException {
+    protected IStatus buildStateSystem() {
         /*
          * Nothing is done in the base implementation, please specify
          * how/if to register a new state system in derived classes.
          */
-        return;
+        return Status.OK_STATUS;
     }
 
     /**
@@ -332,6 +343,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
 
     /**
      * @return the trace indexer
+     * @since 3.0
      */
     protected ITmfTraceIndexer getIndexer() {
         return fIndexer;
@@ -410,6 +422,14 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
         return new TmfTimestamp(DEFAULT_INITIAL_OFFSET_VALUE, ITmfTimestamp.NANOSECOND_SCALE);
     }
 
+    /**
+     * @since 3.0
+     */
+    @Override
+    public String getHostId() {
+        return this.getName();
+    }
+
     // ------------------------------------------------------------------------
     // Convenience setters
     // ------------------------------------------------------------------------
@@ -477,6 +497,7 @@ 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;
@@ -660,11 +681,11 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace {
          * The signal is either for this trace, or for an experiment containing
          * this trace.
          */
-        try {
-            buildStatistics();
-            buildStateSystem();
-        } catch (TmfTraceException e) {
-            e.printStackTrace();
+        MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, null, null);
+        status.add(buildStatistics());
+        status.add(buildStateSystem());
+        if (!status.isOK()) {
+            Activator.log(status);
         }
 
         /* Refresh the project, so it can pick up new files that got created. */
index a2a5d15d0c4c31ddc8951385a3c59b975f0cad77..a006071b6867aba4257f52d9571ab8e5b123dd95 100644 (file)
@@ -96,7 +96,7 @@ public final class TmfTraceManager {
 
     /**
      * @return The begin timestamp of selection
-     * @since 2.1
+     * @since 3.0
      */
     public ITmfTimestamp getSelectionBeginTime() {
         return getCurrentTraceContext().getSelectionBegin();
@@ -104,7 +104,7 @@ public final class TmfTraceManager {
 
     /**
      * @return The end timestamp of selection
-     * @since 2.1
+     * @since 3.0
      */
     public ITmfTimestamp getSelectionEndTime() {
         return getCurrentTraceContext().getSelectionEnd();
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfTraceIndexer.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfTraceIndexer.java
new file mode 100644 (file)
index 0000000..3f27948
--- /dev/null
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.indexer;
+
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+
+/**
+ * The generic trace indexer in TMF with support for incremental indexing.
+ *
+ * @see ITmfTrace
+ * @see ITmfEvent
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public interface ITmfTraceIndexer {
+
+    /**
+     * Start an asynchronous index building job and waits for the job completion
+     * if required. Typically, the indexing job sends notifications at regular
+     * intervals to indicate its progress.
+     * <p>
+     * <b>Example 1</b>: Index a whole trace asynchronously
+     *
+     * <pre>
+     * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, false);
+     * </pre>
+     *
+     * <b>Example 2</b>: Index a whole trace synchronously
+     *
+     * <pre>
+     * trace.getIndexer().buildIndex(0, TmfTimeRange.ETERNITY, true);
+     * </pre>
+     *
+     * <b>Example 3</b>: Index a trace asynchronously, starting at rank 100
+     *
+     * <pre>
+     * trace.getIndexer().buildIndex(100, TmfTimeRange.ETERNITY, false);
+     * </pre>
+     *
+     * <b>Example 4</b>: Index a trace asynchronously, starting at rank 100 for
+     * events between T1 and T2 (inclusive). This is used for incremental
+     * indexing.
+     *
+     * <pre>
+     * TmfTimeRange range = new TmfTimeRange(T1, T2);
+     * trace.getIndexer().buildIndex(100, range, false);
+     * </pre>
+     *
+     * @param offset
+     *            The offset of the first event to consider
+     * @param range
+     *            The time range to consider
+     * @param waitForCompletion
+     *            Should we block the calling thread until the build is
+     *            complete?
+     * @since 2.0
+     */
+    void buildIndex(long offset, TmfTimeRange range, boolean waitForCompletion);
+
+    /**
+     * Indicates that the indexer is busy indexing the trace.
+     * Will always return false if the indexing is done synchronously.
+     *
+     * @return the state of the indexer (indexing or not)
+     */
+    boolean isIndexing();
+
+    /**
+     * Adds an entry to the trace index.
+     *
+     * @param context The trace context to save
+     * @param timestamp The timestamp matching this context
+     * @since 2.0
+     */
+    void updateIndex(ITmfContext context, ITmfTimestamp timestamp);
+
+    /**
+     * Returns the context of the checkpoint immediately preceding the requested
+     * timestamp (or at the timestamp if it coincides with a checkpoint).
+     *
+     * @param timestamp the requested timestamp
+     * @return the checkpoint context
+     * @since 2.0
+     */
+    ITmfContext seekIndex(ITmfTimestamp timestamp);
+
+    /**
+     * Returns the context of the checkpoint immediately preceding the requested
+     * rank (or at rank if it coincides with a checkpoint).
+     *
+     * @param rank the requested event rank
+     * @return the checkpoint context
+     */
+    ITmfContext seekIndex(long rank);
+
+    /**
+     * Perform cleanup when the indexer is no longer required.
+     */
+    void dispose();
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java
new file mode 100644 (file)
index 0000000..9dcb499
--- /dev/null
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Patrick Tasse - Updated for location in checkpoint
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint;
+
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+
+/**
+ * The basic trace checkpoint structure in TMF. The purpose of the checkpoint is
+ * to associate a trace location to an event timestamp.
+ * *
+ * @see ITmfTimestamp
+ * @see ITmfLocation
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public interface ITmfCheckpoint extends Comparable<ITmfCheckpoint> {
+
+    // ------------------------------------------------------------------------
+    // Getters
+    // ------------------------------------------------------------------------
+
+    /**
+     * @return the timestamp of the event referred to by the context
+     * @since 2.0
+     */
+    ITmfTimestamp getTimestamp();
+
+    /**
+     * @return the location of the event referred to by the checkpoint
+     */
+    ITmfLocation getLocation();
+
+    // ------------------------------------------------------------------------
+    // Comparable
+    // ------------------------------------------------------------------------
+
+    @Override
+    int compareTo(ITmfCheckpoint checkpoint);
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java
new file mode 100644 (file)
index 0000000..e2d5624
--- /dev/null
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Updated as per TMF Trace Model 1.0
+ *   Patrick Tasse - Updated for location in checkpoint
+ ******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint;
+
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+
+/**
+ * A basic implementation of ITmfCheckpoint. It simply maps an event timestamp
+ * to a generic location.
+ *
+ * @see ITmfLocation
+ * @see ITmfTimestamp
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public class TmfCheckpoint implements ITmfCheckpoint {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+    // The checkpoint location
+    private final ITmfLocation fLocation;
+
+    // The checkpoint timestamp
+    private final ITmfTimestamp fTimestamp;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Full constructor
+     *
+     * @param timestamp the checkpoint timestamp
+     * @param location the corresponding trace location
+     * @since 3.0
+     */
+    public TmfCheckpoint(final ITmfTimestamp timestamp, final ITmfLocation location) {
+        fTimestamp = timestamp;
+        fLocation = location;
+    }
+
+    /**
+     * Copy constructor
+     *
+     * @param other the other checkpoint
+     */
+    public TmfCheckpoint(final TmfCheckpoint other) {
+        if (other == null) {
+            throw new IllegalArgumentException();
+        }
+        fTimestamp = other.fTimestamp;
+        fLocation = other.fLocation;
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfCheckpoint
+    // ------------------------------------------------------------------------
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public ITmfTimestamp getTimestamp() {
+        return fTimestamp;
+    }
+
+    @Override
+    public ITmfLocation getLocation() {
+        return fLocation;
+    }
+
+    // ------------------------------------------------------------------------
+    // Comparable
+    // ------------------------------------------------------------------------
+
+    @Override
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public int compareTo(final ITmfCheckpoint other) {
+        int comp = 0;
+        if ((fTimestamp != null) && (other.getTimestamp() != null)) {
+            comp = fTimestamp.compareTo(other.getTimestamp(), false);
+            if (comp != 0) {
+                return comp;
+            }
+            // compare locations if timestamps are the same
+        }
+
+        if ((fLocation == null) && (other.getLocation() == null)) {
+            return 0;
+        }
+
+        // treat location of other as null location which is before any location
+        if ((fLocation != null) && (other.getLocation() == null)) {
+            return 1;
+        }
+
+        // treat this as null location which is before any other locations
+        if ((fLocation == null) && (other.getLocation() != null)) {
+            return -1;
+        }
+
+        // compare location
+        final Comparable location1 = getLocation().getLocationInfo();
+        final Comparable location2 = other.getLocation().getLocationInfo();
+        return location1.compareTo(location2);
+    }
+
+    // ------------------------------------------------------------------------
+    // Object
+    // ------------------------------------------------------------------------
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((fLocation == null) ? 0 : fLocation.hashCode());
+        result = prime * result + ((fTimestamp == null) ? 0 : fTimestamp.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (!(obj instanceof TmfCheckpoint)) {
+            return false;
+        }
+        final TmfCheckpoint other = (TmfCheckpoint) obj;
+        if (fLocation == null) {
+            if (other.fLocation != null) {
+                return false;
+            }
+        } else if (!fLocation.equals(other.fLocation)) {
+            return false;
+        }
+        if (fTimestamp == null) {
+            if (other.fTimestamp != null) {
+                return false;
+            }
+        } else if (!fTimestamp.equals(other.fTimestamp)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    @SuppressWarnings("nls")
+    public String toString() {
+        return getClass().getSimpleName() + " [fLocation=" + fLocation + ", fTimestamp=" + fTimestamp + "]";
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java
new file mode 100644 (file)
index 0000000..18ddef9
--- /dev/null
@@ -0,0 +1,324 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.indexer.checkpoint;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.linuxtools.internal.tmf.core.Messages;
+import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+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.signal.TmfTraceUpdatedSignal;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+
+/**
+ * A simple indexer that manages the trace index as an array of trace
+ * checkpoints. Checkpoints are stored at fixed intervals (event rank) in
+ * ascending timestamp order.
+ * <p>
+ * The goal being to access a random trace event reasonably fast from the user's
+ * standpoint, picking the right interval value becomes a trade-off between speed
+ * and memory usage (a shorter inter-event interval is faster but requires more
+ * checkpoints).
+ * <p>
+ * Locating a specific checkpoint is trivial for both rank (rank % interval) and
+ * timestamp (bsearch in the array).
+ * *
+ * @see ITmfTrace
+ * @see ITmfEvent
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public class TmfCheckpointIndexer implements ITmfTraceIndexer {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+    /** The event trace to index */
+    protected final ITmfTrace fTrace;
+
+    /** The interval between checkpoints */
+    private final int fCheckpointInterval;
+
+    /** The event trace to index */
+    private boolean fIsIndexing;
+
+    /**
+     * The trace index. It is composed of checkpoints taken at intervals of
+     * fCheckpointInterval events.
+     */
+    protected final List<ITmfCheckpoint> fTraceIndex;
+
+    /**
+     * The indexing request
+     */
+    private ITmfEventRequest fIndexingRequest = null;
+
+    // ------------------------------------------------------------------------
+    // Construction
+    // ------------------------------------------------------------------------
+
+    /**
+     * Basic constructor that uses the default trace block size as checkpoints
+     * intervals
+     *
+     * @param trace the trace to index
+     */
+    public TmfCheckpointIndexer(final ITmfTrace trace) {
+        this(trace, TmfDataProvider.DEFAULT_BLOCK_SIZE);
+    }
+
+    /**
+     * Full trace indexer
+     *
+     * @param trace the trace to index
+     * @param interval the checkpoints interval
+     */
+    public TmfCheckpointIndexer(final ITmfTrace trace, final int interval) {
+        fTrace = trace;
+        fCheckpointInterval = interval;
+        fTraceIndex = new ArrayList<ITmfCheckpoint>();
+        fIsIndexing = false;
+    }
+
+    @Override
+    public void dispose() {
+        if ((fIndexingRequest != null) && !fIndexingRequest.isCompleted()) {
+            fIndexingRequest.cancel();
+            fTraceIndex.clear();
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfTraceIndexer - isIndexing
+    // ------------------------------------------------------------------------
+
+    @Override
+    public boolean isIndexing() {
+        return fIsIndexing;
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfTraceIndexer - buildIndex
+    // ------------------------------------------------------------------------
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public void buildIndex(final long offset, final TmfTimeRange range, final boolean waitForCompletion) {
+
+        // Don't do anything if we are already indexing
+        synchronized (fTraceIndex) {
+            if (fIsIndexing) {
+                return;
+            }
+            fIsIndexing = true;
+        }
+
+        // The monitoring job
+        final Job job = new Job("Indexing " + fTrace.getName() + "...") { //$NON-NLS-1$ //$NON-NLS-2$
+            @Override
+            protected IStatus run(final IProgressMonitor monitor) {
+                monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+                while (!monitor.isCanceled()) {
+                    try {
+                        long prevNbEvents = fTrace.getNbEvents();
+                        Thread.sleep(250);
+                        long nbEvents = fTrace.getNbEvents();
+                        setName(Messages.TmfCheckpointIndexer_Indexing + ' ' + fTrace.getName() + " (" + nbEvents + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+                        // setName doesn't refresh the UI, setTaskName does
+                        long rate = (nbEvents - prevNbEvents) * 4;
+                        monitor.setTaskName(rate + " " + Messages.TmfCheckpointIndexer_EventsPerSecond); //$NON-NLS-1$
+                    } catch (final InterruptedException e) {
+                        return Status.OK_STATUS;
+                    }
+                }
+                monitor.done();
+                return Status.OK_STATUS;
+            }
+        };
+        job.schedule();
+
+        // Build a background request for all the trace data. The index is
+        // updated as we go by readNextEvent().
+        fIndexingRequest = new TmfEventRequest(ITmfEvent.class,
+                range, offset, TmfDataRequest.ALL_DATA,
+                ITmfDataRequest.ExecutionType.BACKGROUND) {
+            @Override
+            public void handleData(final ITmfEvent event) {
+                super.handleData(event);
+                if (event != null) {
+                    // Update the trace status at regular intervals
+                    if ((getNbRead() % fCheckpointInterval) == 0) {
+                        updateTraceStatus();
+                    }
+                }
+            }
+
+            @Override
+            public void handleSuccess() {
+                updateTraceStatus();
+            }
+
+            @Override
+            public void handleCompleted() {
+                job.cancel();
+                super.handleCompleted();
+                fIsIndexing = false;
+            }
+
+            private void updateTraceStatus() {
+                if (fTrace.getNbEvents() > 0) {
+                    signalNewTimeRange(fTrace.getStartTime(), fTrace.getEndTime());
+                }
+            }
+        };
+
+        // Submit the request and wait for completion if required
+        fTrace.sendRequest(fIndexingRequest);
+        if (waitForCompletion) {
+            try {
+                fIndexingRequest.waitForCompletion();
+            } catch (final InterruptedException e) {
+            }
+        }
+    }
+
+    /**
+     * Notify the interested parties that the trace time range has changed
+     *
+     * @param startTime the new start time
+     * @param endTime the new end time
+     */
+    private void signalNewTimeRange(final ITmfTimestamp startTime, final ITmfTimestamp endTime) {
+        fTrace.broadcast(new TmfTraceUpdatedSignal(fTrace, fTrace, new TmfTimeRange(startTime, endTime)));
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfTraceIndexer - updateIndex
+    // ------------------------------------------------------------------------
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public synchronized void updateIndex(final ITmfContext context, final ITmfTimestamp timestamp) {
+        if ((context.getRank() % fCheckpointInterval) == 0) {
+            // Determine the table position
+            final long position = context.getRank() / fCheckpointInterval;
+            // Add new entry at proper location (if empty)
+            if (fTraceIndex.size() == position) {
+                fTraceIndex.add(new TmfCheckpoint(timestamp, context.getLocation()));
+            }
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // ITmfTraceIndexer - seekIndex
+    // ------------------------------------------------------------------------
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public synchronized ITmfContext seekIndex(final ITmfTimestamp timestamp) {
+
+        // A null timestamp indicates to seek the first event
+        if (timestamp == null) {
+            return fTrace.seekEvent(0);
+        }
+
+        // Find the checkpoint at or before the requested timestamp.
+        // In the very likely event that the timestamp is not at a checkpoint
+        // boundary, bsearch will return index = (- (insertion point + 1)).
+        // It is then trivial to compute the index of the previous checkpoint.
+        int index = Collections.binarySearch(fTraceIndex, new TmfCheckpoint(timestamp, null));
+        if (index < 0) {
+            index = Math.max(0, -(index + 2));
+        } else {
+            // If timestamp was in the list, use previous index to be able to find the
+            // first event with the same timestamp before the checkpoint
+            index = Math.max(0, index - 1);
+        }
+
+        // Position the trace at the checkpoint
+        return restoreCheckpoint(index);
+    }
+
+    @Override
+    public ITmfContext seekIndex(final long rank) {
+
+        // A rank < 0 indicates to seek the first event
+        if (rank < 0) {
+            return fTrace.seekEvent(0);
+        }
+
+        // Find the checkpoint at or before the requested rank.
+        final int index = (int) rank / fCheckpointInterval;
+
+        // Position the trace at the checkpoint
+        return restoreCheckpoint(index);
+    }
+
+    /**
+     * Position the trace at the given checkpoint
+     *
+     * @param checkpoint the checkpoint index
+     * @return the corresponding context
+     */
+    private ITmfContext restoreCheckpoint(final int checkpoint) {
+        ITmfLocation location = null;
+        int index = 0;
+        synchronized (fTraceIndex) {
+            if (!fTraceIndex.isEmpty()) {
+                index = checkpoint;
+                if (index >= fTraceIndex.size()) {
+                    index = fTraceIndex.size() - 1;
+                }
+                location = fTraceIndex.get(index).getLocation();
+            }
+        }
+        final ITmfContext context = fTrace.seekEvent(location);
+        context.setRank((long) index * fCheckpointInterval);
+        return context;
+    }
+
+    // ------------------------------------------------------------------------
+    // Getters
+    // ------------------------------------------------------------------------
+
+    /**
+     * @return the trace index
+     */
+    protected List<ITmfCheckpoint> getTraceIndex() {
+        return fTraceIndex;
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/ITmfLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/ITmfLocation.java
new file mode 100644 (file)
index 0000000..1280723
--- /dev/null
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Updated as per TMF Trace Model 1.0
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.location;
+
+/**
+ * The generic trace location in TMF.
+ * <p>
+ * An ITmfLocation is the equivalent of a random-access file position, holding
+ * enough information to allow the positioning of the trace 'pointer' to read an
+ * arbitrary event.
+ * <p>
+ * This location is trace-specific, must be comparable and immutable.
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public interface ITmfLocation {
+
+    // ------------------------------------------------------------------------
+    // Getters
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the concrete trace location information
+     *
+     * @return the location information
+     * @since 2.0
+     */
+    Comparable<?> getLocationInfo();
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLocation.java
new file mode 100644 (file)
index 0000000..133f002
--- /dev/null
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Updated as per TMF Trace Model 1.0
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.location;
+
+
+/**
+ * A abstract implementation of ITmfLocation. The concrete classes must provide
+ * comparable location information.
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public abstract class TmfLocation implements ITmfLocation {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+    private final Comparable<?> fLocationInfo;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Standard constructor.
+     *
+     * @param locationInfo
+     *            The concrete trace location
+     */
+    public TmfLocation(final Comparable<?> locationInfo) {
+        fLocationInfo = locationInfo;
+    }
+
+    /**
+     * Copy constructor
+     *
+     * @param location
+     *            The original trace location
+     */
+    public TmfLocation(final TmfLocation location) {
+        fLocationInfo = location.fLocationInfo;
+    }
+
+    // ------------------------------------------------------------------------
+    // Getters
+    // ------------------------------------------------------------------------
+
+    /**
+     * @since 2.0
+     */
+    @Override
+    public Comparable<?> getLocationInfo() {
+        return fLocationInfo;
+    }
+
+    // ------------------------------------------------------------------------
+    // Object
+    // ------------------------------------------------------------------------
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((fLocationInfo != null) ? fLocationInfo.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final TmfLocation other = (TmfLocation) obj;
+        if (fLocationInfo == null) {
+            if (other.fLocationInfo != null) {
+                return false;
+            }
+        } else if (!fLocationInfo.equals(other.fLocationInfo)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    @SuppressWarnings("nls")
+    public String toString() {
+        return getClass().getSimpleName() + " [fLocationInfo=" + fLocationInfo + "]";
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java
new file mode 100644 (file)
index 0000000..38877ca
--- /dev/null
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.location;
+
+
+/**
+ * A concrete implementation of TmfLocation based on Long:s
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public final class TmfLongLocation extends TmfLocation {
+
+    /**
+     * The normal constructor
+     *
+     * @param locationInfo the concrete location
+     */
+    public TmfLongLocation(final Long locationInfo) {
+        super(locationInfo);
+    }
+
+    /**
+     * The copy constructor
+     *
+     * @param other the other location
+     */
+    public TmfLongLocation(final TmfLongLocation other) {
+        super(other.getLocationInfo());
+    }
+
+    @Override
+    public Long getLocationInfo() {
+        return (Long) super.getLocationInfo();
+    }
+
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfTimestampLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfTimestampLocation.java
new file mode 100644 (file)
index 0000000..22c48f4
--- /dev/null
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.tmf.core.trace.location;
+
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+
+/**
+ * A concrete implementation of TmfLocation based on ITmfTimestamp:s
+ *
+ * @author Francois Chouinard
+ * @since 3.0
+ */
+public final class TmfTimestampLocation extends TmfLocation {
+
+    /**
+     * The normal constructor
+     *
+     * @param locationInfo the concrete location
+     */
+    public TmfTimestampLocation(final ITmfTimestamp locationInfo) {
+        super(locationInfo);
+    }
+
+    /**
+     * The copy constructor
+     *
+     * @param other the other location
+     */
+    public TmfTimestampLocation(final TmfTimestampLocation other) {
+        super(other.getLocationInfo());
+    }
+
+    @Override
+    public ITmfTimestamp getLocationInfo() {
+        return (ITmfTimestamp) super.getLocationInfo();
+    }
+
+}
index 92bdbd792ed5b4cd592bd85acaab1c98ce6b6f5f..b678cf5e2bf09936593d45724e3bf637b89a9754 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.help; singleton:=true
 Require-Bundle: org.eclipse.help
index 852aeb334b0acad4f2bc59c45c29f9ab0aecc12b..7813c7c55a9a4e56fda65d9ece5d47e6fc39fcb3 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.help</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools TMF Help Plug-in</name>
index 13ac74e379f8a15560895968abd66662303739c7..14860f03565a8ab41cbff9152bd678d77400198b 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.ui.tests;singleton:=true
 Bundle-ActivationPolicy: lazy
@@ -11,7 +11,7 @@ Require-Bundle: org.junit;bundle-version="4.0.0",
  org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.core.tests;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.ui;bundle-version="3.0.0",
+ org.eclipse.linuxtools.tmf.core.tests;bundle-version="3.0.0"
 Export-Package: org.eclipse.linuxtools.tmf.ui.tests
index a42fc26caf7451ec176e255b3249b51bb9433619..a982087399a771951931b27850cdf3298068cd0c 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.ui.tests</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 
   <name>Linux Tools TMF UI Tests Plug-in</name>
index 5f460642d2a5ca1cd7575e0735d54569bb0b038d..c342ae95e69a7b82000f707be1aca6345a6b9f0e 100644 (file)
@@ -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, parser, null);
+            return new TmfTraceStub(test.getPath(), 500, true, null, parser);
         } catch (final TmfTraceException e) {
             e.printStackTrace();
             throw new RuntimeException(e);
index 8a2b06a839194e75ce798203815261458aa9b87f..a4519d32074e9a36fc725a64f169da74587f8ba1 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
 Bundle-Localization: plugin
 Bundle-SymbolicName: org.eclipse.linuxtools.tmf.ui;singleton:=true
 Bundle-Activator: org.eclipse.linuxtools.internal.tmf.ui.Activator
@@ -11,7 +11,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.core.expressions,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
- org.eclipse.linuxtools.tmf.core;bundle-version="2.1.0",
+ org.eclipse.linuxtools.tmf.core;bundle-version="3.0.0",
  org.eclipse.ui,
  org.eclipse.ui.ide,
  org.eclipse.ui.navigator,
@@ -39,7 +39,6 @@ Export-Package: org.eclipse.linuxtools.internal.tmf.ui;x-friends:="org.eclipse.l
  org.eclipse.linuxtools.tmf.ui.views.callstack,
  org.eclipse.linuxtools.tmf.ui.views.colors,
  org.eclipse.linuxtools.tmf.ui.views.distribution.model,
- org.eclipse.linuxtools.tmf.ui.views.environment,
  org.eclipse.linuxtools.tmf.ui.views.filter,
  org.eclipse.linuxtools.tmf.ui.views.histogram,
  org.eclipse.linuxtools.tmf.ui.views.statesystem,
index 9f43e208f754de6874fb39ea32ccc41c7b0aaf0d..4d662a4c53be314cd8875a1850bd1d5e78be853c 100644 (file)
@@ -25,7 +25,6 @@ statistics.view.name = Statistics
 events.editor.name = Events Editor
 uml2sd.view.name = Sequence Diagram
 histogram.view.name = Histogram
-environment.view.name = Environment Variables
 ssvisualizer.view.name = State System Explorer
 callstack.view.name = Call Stack
 
index 9a7e5bc246f2da67410ad9874701e93707d1104a..6cfe04131b4f44fa234cf2f575b403245ad0f5c2 100644 (file)
             id="org.eclipse.linuxtools.tmf.ui.views.timechart"
             name="%timechart.view.name"
             restorable="true">
-      </view> 
-      <view
-            allowMultiple="false"
-            category="org.eclipse.linuxtools.tmf.ui.views.category"
-            class="org.eclipse.linuxtools.tmf.ui.views.environment.TmfEnvironmentView"
-            icon="icons/eview16/events_view.gif"
-            id="org.eclipse.linuxtools.tmf.ui.views.environment"
-            name="%environment.view.name"
-            restorable="true">
       </view>
       <view
             allowMultiple="false"
index c94fb5fb6e220ac17b2bfc2583b8ceb04cf15d26..f281f6a106a207c3a6367470aeb0d8975d7162bd 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf.ui</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 
   <name>Linux Tools TMF UI Plug-in</name>
index 0a80b2bf6df2843845e745712e401536c457b631..513fa43ad6a0bd4cca037fda0f0e471e329ed79b 100644 (file)
@@ -32,11 +32,11 @@ import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceIndexer;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
 
 /**
  * Base class for custom plain text traces.
index ab528a37818588da208156b3c344f4741d66b29e..3b593f8603bd0a6a71a7811e35b309f3b145054b 100644 (file)
@@ -15,8 +15,8 @@ package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 import java.util.regex.Matcher;
 
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputLine;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * Trace context for custom text traces.
index 58b7acae3f86f25e3f37951fc81937b7cb60343d..d120da27fef352e5b02125aaa653ea84a383966f 100644 (file)
@@ -19,10 +19,10 @@ import java.io.RandomAccessFile;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputAttribute;
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputElement;
@@ -32,11 +32,11 @@ import org.eclipse.linuxtools.tmf.core.io.BufferedRandomAccessFile;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceIndexer;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.indexer.ITmfTraceIndexer;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.location.TmfLongLocation;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
index 310e35503040272bacd1c2cd581d7e780aee4974..55a92f11e9b034b33f74da690be02cba68a6d7af 100644 (file)
@@ -12,8 +12,8 @@
 
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 
 /**
  * Trace context for custom XML traces.
index f510694d5d1ca3d62ac8d192083beda7b77844f8..747a289a38b54f750ed73f5c9ef67f97df92df13 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.osgi.util.NLS;
  * Message strings for TMF model handling.
  *
  * @author Jean-Christian Kouamé
- * @since 2.1
+ * @since 3.0
  */
 public class Messages extends NLS {
 
index 19ae246b0c10bea90b87605d49f9c4ea9540b1fd..5f463bb39b9c4b4b474cb05e3274886e6b5060fc 100644 (file)
@@ -14,7 +14,7 @@ package org.eclipse.linuxtools.tmf.ui.properties;
 import org.eclipse.osgi.util.NLS;
 
 /**
- * @since 2.1
+ * @since 3.0
  */
 @SuppressWarnings("javadoc")
 public class Messages extends NLS {
index 7bf16889b984122a699fef12646acc892c07f952..9135b4669fd7ce94ba8fe9a27395d633fda635a2 100644 (file)
@@ -241,7 +241,8 @@ public class TmfEventsCache {
             int requestIndex;
 
             DataRequest(Class<? extends ITmfEvent> dataType, ITmfFilter reqFilter, int start, int nbRequested) {
-                super(dataType, start, nbRequested);
+                super(dataType, start, nbRequested,
+                        TmfDataRequest.ExecutionType.FOREGROUND);
                 requestFilter = reqFilter;
                 requestRank = start;
                 requestIndex = index;
@@ -331,7 +332,10 @@ public class TmfEventsCache {
                     }
                 }
 
-                TmfDataRequest request = new TmfDataRequest(ITmfEvent.class, startIndex, nbRequested) {
+                TmfDataRequest request = new TmfDataRequest(ITmfEvent.class,
+                        startIndex,
+                        nbRequested,
+                        TmfDataRequest.ExecutionType.FOREGROUND) {
                     private int count = 0;
                     private long rank = startIndex;
                     @Override
index 93f59158dc33b72e6be0216850df8e4a3a4f9807..bafe11740aa9b7526434622e3053fdc9d282a27a 100644 (file)
@@ -90,8 +90,8 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsCache.CachedEvent;
 import org.eclipse.linuxtools.tmf.ui.views.colors.ColorSetting;
 import org.eclipse.linuxtools.tmf.ui.views.colors.ColorSettingsManager;
@@ -1423,7 +1423,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 return;
             }
             request = new TmfDataRequest(ITmfEvent.class, (int) fFilterCheckCount,
-                    nbRequested, fTrace.getCacheSize(), ExecutionType.BACKGROUND) {
+                    nbRequested, ExecutionType.BACKGROUND) {
                 @Override
                 public void handleData(final ITmfEvent event) {
                     super.handleData(event);
@@ -1661,7 +1661,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 if (direction == Direction.BACKWARD) {
                     rank = Math.max(0, rank - fTrace.getCacheSize() + 1);
                 }
-                request = new TmfDataRequest(ITmfEvent.class, (int) rank, nbRequested, fTrace.getCacheSize(), ExecutionType.BACKGROUND) {
+                request = new TmfDataRequest(ITmfEvent.class, (int) rank, nbRequested, ExecutionType.BACKGROUND) {
                     long currentRank = rank;
 
                     @Override
@@ -1876,7 +1876,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      *
      * @param statusLineManager
      *            The status line manager, or null to disable status line messages
-     * @since 2.1
+     * @since 3.0
      */
     public void setStatusLineManager(IStatusLineManager statusLineManager) {
         if (fStatusLineManager != null && statusLineManager == null) {
@@ -2203,7 +2203,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             // Create a request for one event that will be queued after other ongoing requests. When this request is completed
             // do the work to select the actual event with the timestamp specified in the signal. This procedure prevents
             // the method fTrace.getRank() from interfering and delaying ongoing requests.
-            final TmfDataRequest subRequest = new TmfDataRequest(ITmfEvent.class, 0, 1, ExecutionType.FOREGROUND) {
+            final TmfDataRequest subRequest = new TmfDataRequest(ITmfEvent.class,
+                    0, 1, ExecutionType.FOREGROUND) {
 
                 TmfTimestamp ts = new TmfTimestamp(signal.getBeginTime());
 
index d46bc5c75f67c82ae4fe99f16384b9d10412b44f..3a7b975bfe5116aaa9dcd8e2bfce5413914aae1d 100644 (file)
@@ -274,7 +274,7 @@ public class TmfStatisticsViewer extends TmfViewer {
      *
      * @param signal
      *            Contains the information about the new selected time range.
-     * @since 2.1
+     * @since 3.0
      */
     @TmfSignalHandler
     public void timeSynchUpdated(TmfTimeSynchSignal signal) {
diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/environment/TmfEnvironmentView.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/environment/TmfEnvironmentView.java
deleted file mode 100644 (file)
index 0a190bc..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *   Bernd Hufmann - Updated to use Tree with columns to be able to group traces
- *   Alexandre Montplaisir - Display info for any ITmfTraceProperties trace
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.ui.views.environment;
-
-import java.util.Map;
-
-import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
-import org.eclipse.linuxtools.tmf.core.signal.TmfTraceClosedSignal;
-import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal;
-import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTraceProperties;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfTraceManager;
-import org.eclipse.linuxtools.tmf.ui.views.TmfView;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-
-/**
- * Displays the trace's properties.
- *
- * @version 1.1
- * @author Matthew Khouzam
- */
-public class TmfEnvironmentView extends TmfView {
-
-    /** The Environment View's ID */
-    public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.environment"; //$NON-NLS-1$
-
-    private ITmfTrace fTrace;
-    private Tree fTree;
-
-    /**
-     * Default constructor
-     */
-    public TmfEnvironmentView() {
-        super("EnvironmentVariables"); //$NON-NLS-1$
-//        fTitlePrefix = getTitle();
-    }
-
-    // ------------------------------------------------------------------------
-    // ViewPart
-    // ------------------------------------------------------------------------
-
-    @Override
-    public void createPartControl(Composite parent) {
-        fTree = new Tree(parent, SWT.NONE);
-        TreeColumn nameCol = new TreeColumn(fTree, SWT.NONE, 0);
-        TreeColumn valueCol = new TreeColumn(fTree, SWT.NONE, 1);
-        nameCol.setText("Environment Variable"); //$NON-NLS-1$
-        valueCol.setText("Value"); //$NON-NLS-1$
-
-        fTree.setItemCount(0);
-
-        fTree.setHeaderVisible(true);
-        nameCol.pack();
-        valueCol.pack();
-
-        ITmfTrace trace = getActiveTrace();
-        if (trace != null) {
-            traceSelected(new TmfTraceSelectedSignal(this, trace));
-        }
-    }
-
-    private void updateTable() {
-        fTree.setItemCount(0);
-        if (fTrace == null) {
-            return;
-        }
-
-        for (ITmfTrace trace : TmfTraceManager.getTraceSet(fTrace)) {
-            if (trace instanceof ITmfTraceProperties) {
-                TreeItem item = new TreeItem(fTree, SWT.NONE);
-                item.setText(0, trace.getName());
-
-                ITmfTraceProperties propTrace = (ITmfTraceProperties) trace;
-                Map <String, String> properties = propTrace.getTraceProperties();
-                for (Map.Entry<String, String> entry : properties.entrySet()) {
-                    TreeItem subItem = new TreeItem(item, SWT.NONE);
-                    subItem.setText(0, entry.getKey()); // Variable name
-                    subItem.setText(1, entry.getValue()); // Variable value
-                }
-            }
-        }
-
-        // Expand the tree items
-        for (int i = 0; i < fTree.getItemCount(); i++) {
-            fTree.getItem(i).setExpanded(true);
-        }
-
-        for (TreeColumn column : fTree.getColumns()) {
-            column.pack();
-        }
-    }
-
-    @Override
-    public void setFocus() {
-        fTree.setFocus();
-    }
-
-    /**
-     * Handler for the trace opened signal.
-     * @param signal
-     *            The incoming signal
-     * @since 2.0
-     */
-    @TmfSignalHandler
-    public void traceOpened(TmfTraceOpenedSignal signal) {
-        fTrace = signal.getTrace();
-        updateTable();
-    }
-
-
-    /**
-     * Handler for the trace selected signal.
-     *
-     * @param signal
-     *            The incoming signal
-     * @since 2.0
-     */
-    @TmfSignalHandler
-    public void traceSelected(TmfTraceSelectedSignal signal) {
-        // Update the trace reference
-        ITmfTrace trace = signal.getTrace();
-        if (!trace.equals(fTrace)) {
-            fTrace = trace;
-            updateTable();
-        }
-    }
-
-    /**
-     * Handler for the trace closed signal.
-     *
-     * @param signal the incoming signal
-     * @since 2.0
-     */
-    @TmfSignalHandler
-    public void traceClosed(TmfTraceClosedSignal signal) {
-        if (signal.getTrace() == fTrace) {
-            fTrace = null;
-            fTree.setItemCount(0);
-        }
-    }
-
-}
-
index 890158d84305b33a301c55c8cf15307add2ecf0c..2a7f7c57037501d3d1728c34a1da96d6875aa50f 100644 (file)
@@ -385,7 +385,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      *            The begin time of the current selection
      * @param endTime
      *            The end time of the current selection
-     * @since 2.1
+     * @since 3.0
      */
     public void setSelection(final long beginTime, final long endTime) {
         fSelectionBegin = (beginTime > 0) ? beginTime : 0;
index a59b178fa5531ac418e809673017b4fe6d23d7ba..c0a91065084f74c4e663e072bd282c7a7f4710c8 100644 (file)
@@ -246,7 +246,7 @@ public class HistogramDataModel implements IHistogramDataModel {
     /**
      * Returns the begin time of the current selection in the model.
      * @return the begin time of the current selection.
-     * @since 2.1
+     * @since 3.0
      */
     public long getSelectionBegin() {
         return fSelectionBegin;
@@ -255,7 +255,7 @@ public class HistogramDataModel implements IHistogramDataModel {
     /**
      * Returns the end time of the current selection in the model.
      * @return the end time of the current selection.
-     * @since 2.1
+     * @since 3.0
      */
     public long getSelectionEnd() {
         return fSelectionEnd;
@@ -362,7 +362,7 @@ public class HistogramDataModel implements IHistogramDataModel {
      *
      * @param beginTime The selection begin time.
      * @param endTime The selection end time.
-     * @since 2.1
+     * @since 3.0
      */
     public void setSelection(long beginTime, long endTime) {
         fSelectionBegin = beginTime;
@@ -374,7 +374,7 @@ public class HistogramDataModel implements IHistogramDataModel {
      *
      * @param beginTime The selection begin time.
      * @param endTime The selection end time.
-     * @since 2.1
+     * @since 3.0
      */
     public void setSelectionNotifyListeners(long beginTime, long endTime) {
         fSelectionBegin = beginTime;
index 7df67cb160b1b9c5e77a758b00e67392e65f03aa..f9af599affea34dc9c1d3119f0b48735dac9d29a 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
 import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 
 /**
  * Class to request events for given time range from a trace to fill a HistogramDataModel and HistogramView.
@@ -65,9 +64,7 @@ public class HistogramRequest extends TmfEventRequest {
     public HistogramRequest(HistogramDataModel histogram, TmfTimeRange range,
             int rank, int nbEvents, int blockSize,
             ITmfDataRequest.ExecutionType execType) {
-        super(ITmfEvent.class, range, rank, nbEvents,
-                (blockSize > 0) ? blockSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE,
-                execType);
+        super(ITmfEvent.class, range, rank, nbEvents, execType);
         fHistogram = histogram;
     }
 
index 52487a7b6aee6956a89f1835f365c948e2dc470b..be49c38ec148c49988c53bafc0273bceee3f25de 100644 (file)
@@ -68,12 +68,12 @@ public class HistogramScaledData {
     public int fCurrentBucket;
     /**
      * The index of the selection begin bucket.
-     * @since 2.1
+     * @since 3.0
      */
     public int fSelectionBeginBucket;
     /**
      * The index of the selection end bucket.
-     * @since 2.1
+     * @since 3.0
      */
     public int fSelectionEndBucket;
     /**
index add80d906e39b9f76f2ff6bc307c2501c3679506..346e7a122292c72bf4cf479559c8ad174be9b5e3 100644 (file)
@@ -46,7 +46,7 @@ public class Messages extends NLS {
     public static String ValueColumnLabel;
 
     /** Label for the "type" column
-     * @since 2.1*/
+     * @since 3.0*/
     public static String TypeColumnLabel;
 
     /** Label for the "start time" column */
@@ -65,18 +65,18 @@ public class Messages extends NLS {
     public static String OutOfRangeMsg;
 
     /** Label for the Filter button
-     * @since 2.1*/
+     * @since 3.0*/
     public static String FilterButton;
 
     /** Label for the type Interger
-     * @since 2.1*/
+     * @since 3.0*/
     public static String TypeInteger;
 
     /** Label for the type Long
-     * @since 2.1*/
+     * @since 3.0*/
     public static String TypeLong;
 
     /** Label for the type String
-     * @since 2.1*/
+     * @since 3.0*/
     public static String TypeString;
 }
index 35819243820e68d588256ee1a3cb557b7d8f8421..1b797dc8f6090548e09e10cda1d2265bff9974ba 100644 (file)
@@ -503,12 +503,12 @@ public class TmfStateSystemExplorer extends TmfView {
         };
         thread.start();
     }
-    
+
     /**
      * Update the display to use the updated timestamp format
      *
      * @param signal the incoming signal
-     * @since 2.1
+     * @since 3.0
      */
     @TmfSignalHandler
     public void timestampFormatUpdated(TmfTimestampFormatUpdateSignal signal) {
index 795b2529b2d5b2c6b72a6115c5453a3c15bf040e..82a52ac65cdc930a911bc89a0417991094adcddd 100644 (file)
@@ -73,7 +73,7 @@ import org.eclipse.ui.IActionBars;
  * left, showing entries and a canvas on the right to draw something for these
  * entries.
  *
- * @since 2.1
+ * @since 3.0
  */
 public abstract class AbstractTimeGraphView extends TmfView {
 
index 1d0ff0c871c92b5595ff35e677a0143474b9eab0..7de70515aa47716484704158aa9ed852cc14b498 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.osgi.util.NLS;
 /**
  * Generic messages for the bar charts
  *
- * @since 2.1
+ * @since 3.0
  */
 @SuppressWarnings("javadoc")
 public class Messages extends NLS {
index 4b3c4872540902a74de88c808d5c8a107ca146ba..633287c32c18b69590f0aa28914e1a9a430dcfa3 100644 (file)
@@ -106,14 +106,12 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
+
     /**
      * Default title name.
      */
     protected static final String TITLE = Messages.TmfUml2SDSyncLoader_ViewName;
-    /**
-     * Default block size for background request.
-     */
-    protected static final int DEFAULT_BLOCK_SIZE = 50000;
+
     /**
      * Maximum number of messages per page.
      */
@@ -314,7 +312,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
 
             TmfTimeRange window = TmfTimeRange.ETERNITY;
 
-            fIndexRequest = new TmfEventRequest(ITmfEvent.class, window, TmfDataRequest.ALL_DATA, DEFAULT_BLOCK_SIZE, ITmfDataRequest.ExecutionType.BACKGROUND) {
+            fIndexRequest = new TmfEventRequest(ITmfEvent.class, window, 0, TmfDataRequest.ALL_DATA, ITmfDataRequest.ExecutionType.BACKGROUND) {
 
                 private ITmfTimestamp fFirstTime = null;
                 private ITmfTimestamp fLastTime = null;
@@ -1077,7 +1075,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
             window = TmfTimeRange.ETERNITY;
         }
 
-        fPageRequest = new TmfEventRequest(ITmfEvent.class, window, TmfDataRequest.ALL_DATA, 1, ITmfDataRequest.ExecutionType.FOREGROUND) {
+        fPageRequest = new TmfEventRequest(ITmfEvent.class, window, 0, TmfDataRequest.ALL_DATA, ITmfDataRequest.ExecutionType.FOREGROUND) {
             private final List<ITmfSyncSequenceDiagramEvent> fSdEvent = new ArrayList<ITmfSyncSequenceDiagramEvent>();
 
             @Override
@@ -1248,7 +1246,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
          */
         public SearchJob(Criteria findCriteria, TmfTimeRange window) {
             super(Messages.TmfUml2SDSyncLoader_SearchJobDescrition);
-            fSearchRequest = new SearchEventRequest(window, TmfDataRequest.ALL_DATA, 1, ITmfDataRequest.ExecutionType.FOREGROUND, findCriteria);
+            fSearchRequest = new SearchEventRequest(window, TmfDataRequest.ALL_DATA, ITmfDataRequest.ExecutionType.FOREGROUND, findCriteria);
         }
 
         @Override
@@ -1341,25 +1339,23 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
          * Constructor
          * @param range @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#TmfEventRequest(...)
          * @param nbRequested @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#handleData(...)
-         * @param blockSize @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#handleData(...)
          * @param execType @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#handleData(...)
          * @param criteria The search criteria
          */
-        public SearchEventRequest(TmfTimeRange range, int nbRequested, int blockSize, ExecutionType execType, Criteria criteria) {
-            this(range, nbRequested, blockSize, execType, criteria, null);
+        public SearchEventRequest(TmfTimeRange range, int nbRequested, ExecutionType execType, Criteria criteria) {
+            this(range, nbRequested, execType, criteria, null);
         }
 
         /**
          * Constructor
          * @param range @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#TmfEventRequest(...)
          * @param nbRequested @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#TmfEventRequest(...)
-         * @param blockSize @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#TmfEventRequest(...)
          * @param execType @see org.eclipse.linuxtools.tmf.request.TmfEventRequest#TmfEventRequest(...)
          * @param criteria The search criteria
          * @param monitor progress monitor
          */
-        public SearchEventRequest(TmfTimeRange range, int nbRequested, int blockSize, ExecutionType execType, Criteria criteria, IProgressMonitor monitor) {
-            super(ITmfEvent.class, range, nbRequested, blockSize, execType);
+        public SearchEventRequest(TmfTimeRange range, int nbRequested, ExecutionType execType, Criteria criteria, IProgressMonitor monitor) {
+            super(ITmfEvent.class, range, 0, nbRequested, execType);
             fCriteria = new Criteria(criteria);
             fMonitor = monitor;
         }
index 2570033c2ae9da660971044a97448d8a54ccff0c..84960c55c5d5dc469f1e7a7f63dbf6b595f134f6 100644 (file)
@@ -17,8 +17,8 @@ import java.util.List;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.location.ITmfLocation;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CaretEvent;
 import org.eclipse.swt.custom.CaretListener;
index 8d5ea2c5427eeb2dcec668ea16dd89efde221404..83d8c0654d48a768ed823bd856875596d45b37e5 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDraw
  * Extension of the ITimeGraphPresentationProvider interface to avoid API breakage
  *
  * @author Geneviève Bastien
- * @since 2.1
+ * @since 3.0
  * TODO: Add me to ITimeGraphPresentationProvider before the 3.0 release
  */
 public interface ITimeGraphPresentationProvider2 extends ITimeGraphPresentationProvider {
index 1497de7f91794cdc6606b1f683223067fb03f41c..4fec3338d0fc3d00a6b83e516f35e510d3d22e8a 100644 (file)
@@ -348,7 +348,7 @@ public class TimeGraphCombo extends Composite {
      *            the style of widget to construct
      * @param weights
      *            The relative weights of each side of the sash form
-     * @since 2.1
+     * @since 3.0
      */
     public TimeGraphCombo(Composite parent, int style, int[] weights) {
         super(parent, style);
index 807b174b0da5201053e0be9fb2cd4ca0e20b9109..e79772041a275518fa211a575f615dc7b901c88e 100644 (file)
@@ -48,7 +48,7 @@ public class TimeGraphPresentationProvider implements ITimeGraphPresentationProv
     /**
      * Constructor
      * @param stateTypeName  The state type name
-     * @since 2.1
+     * @since 3.0
      */
     public TimeGraphPresentationProvider(String stateTypeName) {
         fStateTypeName = stateTypeName;
@@ -87,7 +87,7 @@ public class TimeGraphPresentationProvider implements ITimeGraphPresentationProv
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public ITmfTimeGraphDrawingHelper getDrawingHelper() {
@@ -95,7 +95,7 @@ public class TimeGraphPresentationProvider implements ITimeGraphPresentationProv
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public void setDrawingHelper(ITmfTimeGraphDrawingHelper helper) {
index bee7bb2feb4abbafd516982b583bf37fc6672ccb..869bc21ab70b885f530d5e3a169d19246c7ae30e 100644 (file)
@@ -63,7 +63,7 @@ public class TimeGraphTimeEvent extends EventObject {
      *            The selection begin time
      * @param endTime
      *            The selection end time
-     * @since 2.1
+     * @since 3.0
      */
     public TimeGraphTimeEvent(Object source, long beginTime, long endTime) {
         super(source);
@@ -82,7 +82,7 @@ public class TimeGraphTimeEvent extends EventObject {
 
     /**
      * @return the selection begin time
-     * @since 2.1
+     * @since 3.0
      */
     public long getBeginTime() {
         return fBeginTime;
@@ -90,7 +90,7 @@ public class TimeGraphTimeEvent extends EventObject {
 
     /**
      * @return the selection end time
-     * @since 2.1
+     * @since 3.0
      */
     public long getEndTime() {
         return fEndTime;
index cbbb5b2190f2ff4400d32c3f9eebae820b9bdfb7..e085008458518078b7b3fb69862fa03758bd7350 100644 (file)
@@ -570,7 +570,7 @@ public class TimeGraphViewer implements ITimeDataProvider2, SelectionListener {
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public long getSelectionBegin() {
@@ -578,7 +578,7 @@ public class TimeGraphViewer implements ITimeDataProvider2, SelectionListener {
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public long getSelectionEnd() {
@@ -654,7 +654,7 @@ public class TimeGraphViewer implements ITimeDataProvider2, SelectionListener {
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public void setSelectionRangeNotify(long beginTime, long endTime) {
@@ -669,7 +669,7 @@ public class TimeGraphViewer implements ITimeDataProvider2, SelectionListener {
     }
 
     /**
-     * @since 2.1
+     * @since 3.0
      */
     @Override
     public void setSelectionRange(long beginTime, long endTime) {
index 8aeade9f37b74e8975f4413b3a074b1dc9dc2896..c21e5eccddcb7049fd35e2b49df7d15d9ab3ca32 100644 (file)
@@ -63,7 +63,7 @@ public class TimeEvent implements ITimeEvent {
      *            The duration of this event
      * @param value
      *            The status assigned to the event
-     * @since 2.1
+     * @since 3.0
      */
     public TimeEvent(ITimeGraphEntry entry, long time, long duration,
             int value) {
@@ -77,7 +77,7 @@ public class TimeEvent implements ITimeEvent {
      * Get this event's status
      *
      * @return The integer matching this status
-     * @since 2.1
+     * @since 3.0
      */
     public int getValue() {
         return fValue;
@@ -87,7 +87,7 @@ public class TimeEvent implements ITimeEvent {
      * Return whether an event has a value
      *
      * @return true if the event has a value
-     * @since 2.1
+     * @since 3.0
      */
     public boolean hasValue() {
         return (fValue != NOVALUE);
index dafb900f7a4573b5c0433e7acb3bd43b04cd721f..d8c495806b07c0aa1fa3beb78c274103eb7367bc 100644 (file)
@@ -22,7 +22,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 /**
  * An entry for use in the time graph views
  *
- * @since 2.1
+ * @since 3.0
  */
 public class TimeGraphEntry implements ITimeGraphEntry {
 
index 946f77ff9510e37e77acc5205381db2d8cf58ff1..2605ec10991058c620cb58a2275769135a060391 100644 (file)
@@ -18,7 +18,7 @@ package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
  *
  * @version 1.0
  * @TODO: Move these to the ITimeDateProvider interface when API 3.0 is reached
- * @since 2.1
+ * @since 3.0
  */
 public interface ITimeDataProvider2 extends ITimeDataProvider {
 
index 26dbd21089b2cfa370eaab6c15256e08ebd36a40..2ad47bc3063e0b890b71d55894d7ec4553c89404 100644 (file)
@@ -20,7 +20,7 @@ package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
  * vice-versa functions without having to expose their full functionnalities.
  *
  * @author gbastien
- * @since 2.1
+ * @since 3.0
  */
 public interface ITmfTimeGraphDrawingHelper {
 
index 1e8e82d4e3aabb73659034c1a4e0838a8832418c..d8fc5a38bfe05265b51becd7611baeb1d14a6775 100644 (file)
@@ -263,7 +263,7 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
      *
      * @param statusLineManager
      *            The status line manager, or null to disable status line messages
-     * @since 2.1
+     * @since 3.0
      */
     public void setStatusLineManager(IStatusLineManager statusLineManager) {
         if (fStatusLineManager != null && statusLineManager == null) {
@@ -277,7 +277,7 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
      *
      * @param timeGraphScale
      *            The time graph scale
-     * @since 2.1
+     * @since 3.0
      */
     public void setTimeGraphScale(TimeGraphScale timeGraphScale) {
         fTimeGraphScale = timeGraphScale;
index 0cd8d65d29494ebae22826fc15aa02102c33eafc..62c8f5fb50ae4905d7cbab752fb72c01bae6f8c6 100644 (file)
@@ -147,7 +147,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
      *            The begin x-coordinate
      * @param end
      *            The end x-coordinate
-     * @since 2.1
+     * @since 3.0
      */
     public void setDragRange(int begin, int end) {
         if (NO_BUTTON == fDragState || DRAG_EXTERNAL == fDragState) {
@@ -555,7 +555,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
      * Update the display to use the updated timestamp format
      *
      * @param signal the incoming signal
-     * @since 2.1
+     * @since 3.0
      */
     @TmfSignalHandler
     public void timestampFormatUpdated(TmfTimestampFormatUpdateSignal signal) {
index 78f8ba7a6170038373180de5fa79fd50a73efd54..0be7831064c8532f87b5c80086d8a0af4bd729e6 100644 (file)
@@ -86,7 +86,7 @@ public class Utils {
     /**
      * Update the time and date formats to use the current time zone
      *
-     * @since 2.1
+     * @since 3.0
      */
     public static void updateTimeZone() {
         TimeZone timeZone = TmfTimePreferences.getInstance().getTimeZone();
index ebb0e5c438917a9be2cc62c7234361b84899d236..e60301af15c537c8107ed3b00dc002b3b5357d9b 100644 (file)
@@ -1022,7 +1022,7 @@ public class TmfVirtualTable extends Composite {
      * recently selected. The array is empty if no items are selected.
      * <p>
      * @return the array of indices of the selected items
-     * @since 2.1
+     * @since 3.0
      */
     public int[] getSelectionIndices() {
         if (fSelectedEventRank < 0 || fSelectedBeginRank < 0) {
index a2a1906c927521e59be038e837c6c579ca693878..65558d484de32021dc10ecf308dd7f27d46333ef 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.linuxtools.tmf"
       label="%featureName"
-      version="2.1.0.qualifier"
+      version="3.0.0.qualifier"
       provider-name="%featureProvider"
       license-feature="org.eclipse.linuxtools.license.feature"
       license-feature-version="1.0.0.qualifier">
          name="Common Trace Format (CTF)"/>
 
    <requires>
-      <import plugin="org.eclipse.linuxtools.ctf.core" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.ctf.core" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.core.resources"/>
       <import plugin="org.eclipse.ui.views"/>
       <import plugin="org.eclipse.core.expressions"/>
-      <import plugin="org.eclipse.linuxtools.tmf.core" version="2.1.0" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.linuxtools.tmf.core" version="3.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui"/>
       <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.ui.navigator"/>
index ee62b58825a3a89795a4ca946101b1482777dc55..11837536608696c26cc6efaec23ba0f9106b46a8 100644 (file)
   <parent>
     <artifactId>linuxtools-lttng-parent</artifactId>
     <groupId>org.eclipse.linuxtools.lttng</groupId>
-    <version>2.1.0-SNAPSHOT</version>
+    <version>3.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.linuxtools.tmf</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>eclipse-feature</packaging>
 
   <name>Linux Tools TMF (Tracing and Monitoring Framework) Feature</name>
diff --git a/pom.xml b/pom.xml
index 707f1f51580993928245160d614e161cef30c68c..610c3bdfb3852213065a03890ef82a370cf40aa1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
   <groupId>org.eclipse.linuxtools.lttng</groupId>
   <artifactId>linuxtools-lttng-parent</artifactId>
-  <version>2.1.0-SNAPSHOT</version>
+  <version>3.0.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Eclipse Linux Tools LTTng Parent</name>
This page took 0.213683 seconds and 5 git commands to generate.