7a9c9cb3ac4f996352b6beac4ffed677d840f0ce
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Geneviève Bastien - Initial implementation and API
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.core
.synchronization
;
15 import java
.io
.Serializable
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.event
.matching
.TmfEventDependency
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.matching
.TmfEventMatches
;
20 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
23 * Abstract class for synchronization algorithm
25 * @author Geneviève Bastien
27 public abstract class SynchronizationAlgorithm
extends TmfEventMatches
implements Serializable
{
29 private static final long serialVersionUID
= -3083906749528872196L;
32 * Quality of the result obtained by the synchronization algorithm
34 public enum SyncQuality
{
36 * Algorithm returned a result satisfying all hypothesis for the
41 * Best effort of the algorithm
45 * There is communication only in one direction
49 * No communication between two traces
53 * Hypothesis of the algorithm are not satisfied for some reason
59 public void addMatch(TmfEventDependency match
) {
60 super.addMatch(match
);
65 * Function for synchronization algorithm to do something with the received
71 protected abstract void processMatch(TmfEventDependency match
);
74 * Returns a map of staticstics relating to this algorithm. Those stats
75 * could be used to be displayed in a view for example.
77 * @return A map of statistics for this algorithm
79 public abstract Map
<String
, Map
<String
, Object
>> getStats();
82 * Returns a timestamp transformation algorithm
85 * The trace to get the transform for
86 * @return The timestamp transformation formula
88 public abstract ITmfTimestampTransform
getTimestampTransform(ITmfTrace trace
);
91 * Returns a timestamp transformation algorithm
94 * The host ID of the trace to get the transform for
95 * @return The timestamp transformation formula
97 public abstract ITmfTimestampTransform
getTimestampTransform(String hostId
);
100 * Gets the quality of the synchronization between two given traces
106 * @return The synchronization quality
108 public abstract SyncQuality
getSynchronizationQuality(ITmfTrace trace1
, ITmfTrace trace2
);
111 * Returns whether a given trace has a synchronization formula that is not
112 * identity. This function returns true if the synchronization algorithm has
113 * failed for some reason
116 * The host ID of the trace
117 * @return true if trace has formula
119 public abstract boolean isTraceSynced(String hostId
);
This page took 0.035076 seconds and 4 git commands to generate.