- Tweaked the FW a little to accommodate LTTng indexing
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / trace / TmfTraceContext.java
index 09617973ee503fcc54208fe60b0bf86a61f9f3a2..1ce6078a98a9e01f1a01f296e43cde4fa1a1f01c 100644 (file)
@@ -31,10 +31,14 @@ public class TmfTraceContext {
        
        public TmfTraceContext(Object loc, TmfTimestamp ts, long ind) {
                location = loc;
-               timestamp = (ts != null) ? ts : TmfTimestamp.BigBang;
+               timestamp = ts;
                index = ind;
        }
 
+       public TmfTraceContext(Object loc) {
+               this(loc, null, 0);
+       }
+
        public TmfTraceContext(TmfTraceContext other) {
                this(other.location, other.timestamp, other.index);
        }
@@ -69,39 +73,39 @@ public class TmfTraceContext {
                index++;
        }
 
-// TODO: Generalize this code so an implementor can troubleshoot concurrency issues 
-       
 //     // ========================================================================
 //     // Toubleshooting code
 //     // ========================================================================
 //
 //     static private DataInputStream in;
-//     static private int size = 100001;
-//     static private long offsets[] = new long[size];
+//     static private int size = 100000;
+//     static private String locations[] = new String[size];
 //     static public void init() {
-//             System.out.println("TmfTraceContext: Loading valid offsets...");
+//             System.out.println("TmfTraceContext: Loading valid locations...");
 //             try {
-//                     in = new DataInputStream(new BufferedInputStream(new FileInputStream("Offsets.dat")));
-//                     for (int i = 0; i < size; i++)
-//                             offsets[i] = in.readLong();
+//                     in = new DataInputStream(new BufferedInputStream(new FileInputStream("LTTngOffsets.dat")));
+//                     int i = 0;
+//                     while (i < size) {
+//                             locations[i] = in.readUTF();
+//                             i++;
+//                     }
+//                     in.close();
 //             } catch (FileNotFoundException e) {
 //                     // TODO Auto-generated catch block
 //                     e.printStackTrace();
 //             } catch (IOException e) {
-//                     // TODO Auto-generated catch block
-//                     e.printStackTrace();
 //             }
 //             System.out.println("TmfTraceContext: Done.");
 //     }
-//
+
 //     private boolean bsearch(long key) {
 //             int first = 0;
 //             int last = size;
 //             while (first < last) {
 //                     int mid = (first + last) / 2;
-//                     if (key < offsets[mid]) {
+//                     if (key < locations[mid]) {
 //                             last = mid;
-//                     } else if (key > offsets[mid]) {
+//                     } else if (key > locations[mid]) {
 //                             first = mid + 1;
 //                     } else {
 //                             return true;
This page took 0.024351 seconds and 5 git commands to generate.