import java.io.IOException;
import java.io.RandomAccessFile;
-import org.eclipse.linuxtools.lttng.event.LttngEvent;
-import org.eclipse.linuxtools.tmf.event.TmfEvent;
-import org.eclipse.linuxtools.tmf.parser.ITmfEventParser;
-import org.eclipse.linuxtools.tmf.trace.ITmfLocation;
-import org.eclipse.linuxtools.tmf.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.trace.TmfLocation;
-import org.eclipse.linuxtools.tmf.trace.TmfTrace;
+import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
+import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
+import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
+import org.eclipse.linuxtools.tmf.core.trace.TmfLocation;
+import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
/**
* <b><u>LTTngTraceStub</u></b>
* <p>
* Dummy test trace. Use in conjunction with LTTngEventParserStub.
*/
+@SuppressWarnings("nls")
public class LTTngTraceStub extends TmfTrace<LttngEvent> {
// ========================================================================
* @throws FileNotFoundException
*/
public LTTngTraceStub(String filename) throws FileNotFoundException {
- this(filename, DEFAULT_CACHE_SIZE);
+ this(filename, DEFAULT_INDEX_PAGE_SIZE);
}
/**
* @throws FileNotFoundException
*/
public LTTngTraceStub(String filename, int cacheSize) throws FileNotFoundException {
- super(LttngEvent.class, filename, cacheSize);
+ super(filename, LttngEvent.class, filename, cacheSize);
fTrace = new RandomAccessFile(filename, "r");
fParser = new LTTngEventParserStub();
- indexTrace(true);
+// indexTrace(true);
}
-
+
+ @Override
+ public ITmfTrace<LttngEvent> copy() {
+ ITmfTrace<LttngEvent> returnedValue = null;
+ try {
+ returnedValue = new LTTngTraceStub(this.getName());
+ }
+ catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ return returnedValue;
+ }
+
// ========================================================================
// Accessors
// ========================================================================
/* (non-Javadoc)
* @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#seekLocation(java.lang.Object)
*/
+ @Override
@SuppressWarnings("unchecked")
- public TmfContext seekLocation(ITmfLocation location) {
+ public TmfContext seekLocation(ITmfLocation<?> location) {
TmfContext context = null;
try {
synchronized(fTrace) {
- fTrace.seek((location != null) ? ((TmfLocation<Long>) location).getValue() : 0);
+ fTrace.seek((location != null) ? ((TmfLocation<Long>) location).getLocation() : 0);
context = new TmfContext(getCurrentLocation(), 0);
// TmfTraceContext context2 = new TmfTraceContext(getCurrentLocation(), 0);
// TmfEvent event = parseEvent(context2);
return context;
}
+ @Override
+ public TmfContext seekLocation(double ratio) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public double getLocationRatio(ITmfLocation<?> location) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.linuxtools.tmf.eventlog.ITmfStreamLocator#getCurrentLocation()
*/
@Override
- public ITmfLocation getCurrentLocation() {
+ public ITmfLocation<?> getCurrentLocation() {
try {
return new TmfLocation<Long>(fTrace.getFilePointer());
} catch (IOException e) {