Ejemplo n.º 1
0
  /**
   * Initialization of an experiment, taking the type, path, traces, indexPageSize and resource
   *
   * @param type the event type
   * @param path the experiment path
   * @param traces the experiment set of traces
   * @param indexPageSize the experiment index page size
   * @param resource the resource associated to the experiment
   * @since 3.0
   */
  public void initExperiment(
      final Class<? extends ITmfEvent> type,
      final String path,
      final ITmfTrace[] traces,
      final int indexPageSize,
      IResource resource) {
    setCacheSize(indexPageSize);
    setStreamingInterval(0);
    setParser(this);
    // traces have to be set before super.initialize()
    fTraces = traces;
    try {
      super.initialize(resource, path, type);
    } catch (TmfTraceException e) {
      Activator.logError("Error initializing experiment", e); // $NON-NLS-1$
    }

    if (resource != null) {
      try {
        this.synchronizeTraces();
      } catch (TmfTraceException e) {
        Activator.logError("Error synchronizing experiment", e); // $NON-NLS-1$
      }
    }
  }
Ejemplo n.º 2
0
 /**
  * Copy constructor
  *
  * @param trace the original trace
  * @throws TmfTraceException Should not happen usually
  */
 public TmfTrace(final TmfTrace trace) throws TmfTraceException {
   super();
   if (trace == null) {
     throw new IllegalArgumentException();
   }
   fCacheSize = trace.getCacheSize();
   fStreamingInterval = trace.getStreamingInterval();
   fParser = trace.fParser;
   initialize(trace.getResource(), trace.getPath(), trace.getEventType());
 }
Ejemplo n.º 3
0
 /**
  * Full constructor.
  *
  * @param resource The resource associated to the trace
  * @param type The type of events that will be read from this trace
  * @param path The path to the trace on the filesystem
  * @param cacheSize The trace cache size. Pass '-1' to use the default specified in {@link
  *     ITmfTrace#DEFAULT_TRACE_CACHE_SIZE}
  * @param interval The trace streaming interval. You can use '0' for post-mortem traces.
  * @param parser The trace event parser. Use 'null' if (and only if) the trace object itself is
  *     also the ITmfEventParser to be used.
  * @throws TmfTraceException If something failed during the opening
  */
 protected TmfTrace(
     final IResource resource,
     final Class<? extends ITmfEvent> type,
     final String path,
     final int cacheSize,
     final long interval,
     final ITmfEventParser parser)
     throws TmfTraceException {
   super();
   fCacheSize = (cacheSize > 0) ? cacheSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE;
   fStreamingInterval = interval;
   fParser = parser;
   initialize(resource, path, type);
 }
Ejemplo n.º 4
0
 @Override
 public void initTrace(
     final IResource resource, final String path, final Class<? extends ITmfEvent> type)
     throws TmfTraceException {
   initialize(resource, path, type);
 }