diff options
author | Francois Chouinard | 2012-05-04 13:49:40 +0000 |
---|---|---|
committer | Francois Chouinard | 2012-05-08 12:35:07 +0000 |
commit | 8e9f835a16c2b11637ad20102990c836fcd6dcca (patch) | |
tree | a8e5cfba6cebaa3cb7241fec8277fc3c49b9ce41 /lttng/org.eclipse.linuxtools.lttng.core | |
parent | cd5da179787c5c4934baef968d84061d5a7180d3 (diff) | |
download | org.eclipse.linuxtools-8e9f835a16c2b11637ad20102990c836fcd6dcca.tar.gz org.eclipse.linuxtools-8e9f835a16c2b11637ad20102990c836fcd6dcca.tar.xz org.eclipse.linuxtools-8e9f835a16c2b11637ad20102990c836fcd6dcca.zip |
Refactor TmfExperiment
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng.core')
3 files changed, 10 insertions, 37 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java index 4d693bfc42..08bfcafbb4 100644 --- a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java +++ b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/event/LttngLocation.java @@ -41,26 +41,8 @@ public class LttngLocation implements ITmfLocation<LttngTimestamp>, Comparable<L @Override public LttngLocation clone() { - - LttngLocation newLocation = null; - - try { - newLocation = (LttngLocation)super.clone(); - - // *** IMPORTANT *** - // Basic type in java are immutable! - // Thus, using assignation ("=") on basic type is VALID. - newLocation.isLastOperationParse = this.isLastOperationParse; - newLocation.isLastOperationReadNext = this.isLastOperationReadNext; - newLocation.isLastOperationSeek = this.isLastOperationSeek; - - // For other type, we need to create a new timestamp - newLocation.operationTime = new LttngTimestamp( this.operationTime ); - } - catch (final CloneNotSupportedException e) { - System.out.println("Cloning failed with : " + e.getMessage()); //$NON-NLS-1$ - } - + LttngLocation newLocation = new LttngLocation(this); + newLocation.operationTime = new LttngTimestamp( this.operationTime ); return newLocation; } diff --git a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTextTrace.java b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTextTrace.java index 0fc81a174c..d52540ea79 100644 --- a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTextTrace.java +++ b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTextTrace.java @@ -76,18 +76,10 @@ public class LTTngTextTrace extends TmfTrace<LttngEvent> implements ITmfEventPar if ( positionToFirstEvent() == false ) throw new IOException("Fail to position to the beginning of the trace"); //$NON-NLS-1$ else { -// fCacheSize = 1000; - - // Skip indexing if asked - // if ( skipIndexing == true ) { -// fCheckpoints.add(new TmfCheckpoint(new LttngTimestamp(0L), new TmfLocation<Long>(0L))); + setCacheSize(1000); ITmfContext context = new TmfContext(new TmfLocation<Long>(0L), 0); - fIndexer.updateIndex(context, new LttngTimestamp(0L)); - fParser = (ITmfEventParser<LttngEvent>) this; - // } - // else { - // indexTrace(true); - // } + getIndexer().updateIndex(context, new LttngTimestamp(0L)); + setParser((ITmfEventParser<LttngEvent>) this); final Long endTime = currentLttngEvent.getTimestamp().getValue(); positionToFirstEvent(); diff --git a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java index 842f7cc3f0..0f5fe8d1e1 100644 --- a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java +++ b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java @@ -121,7 +121,6 @@ public class LTTngTrace extends TmfTrace<LttngEvent> implements ITmfEventParser< initialize(resource, path, eventType); } - @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected synchronized void initialize(final IResource resource, final String path, final Class<LttngEvent> eventType) throws TmfTraceException { @@ -153,8 +152,8 @@ public class LTTngTrace extends TmfTrace<LttngEvent> implements ITmfEventParser< // Set the currentEvent to the eventContent eventContent.setEvent(currentLttngEvent); - fParser = (ITmfEventParser<LttngEvent>) this; - fCacheSize = CHECKPOINT_PAGE_SIZE; + setParser((ITmfEventParser<LttngEvent>) this); + setCacheSize(CHECKPOINT_PAGE_SIZE); // // Bypass indexing if asked // if ( bypassIndexing == false ) { @@ -188,7 +187,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> implements ITmfEventParser< final LttngEvent event = readNextEvent(context); setEndTime(TmfTimestamp.BIG_BANG); final long startTime = event != null ? event.getTimestamp().getValue() : TmfTimestamp.BIG_BANG.getValue(); - fStreamingInterval = LTTNG_STREAMING_INTERVAL; + setStreamingInterval(LTTNG_STREAMING_INTERVAL); final Thread thread = new Thread("Streaming Monitor for trace " + getName()) { //$NON-NLS-1$ @@ -543,14 +542,14 @@ public class LTTngTrace extends TmfTrace<LttngEvent> implements ITmfEventParser< // timestamp = getStartTime(); // Position the trace at the checkpoint - final ITmfContext checkpointContext = fIndexer.seekIndex(rank); + final ITmfContext checkpointContext = getIndexer().seekIndex(rank); LttngLocation location = (LttngLocation) checkpointContext.getLocation(); ITmfTimestamp timestamp = location.getLocation(); long index = rank / getCacheSize(); // Seek to the found time final TmfContext tmpContext = seekEvent(timestamp); - tmpContext.setRank((index + 1) * fCacheSize); + tmpContext.setRank((index + 1) * getCacheSize()); previousLocation = (LttngLocation) tmpContext.getLocation(); // Ajust the index of the event we found at this check point position |