1 /*******************************************************************************
2 * Copyright (c) 2013 É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
28 public abstract class SynchronizationAlgorithm
extends TmfEventMatches
implements Serializable
{
30 private static final long serialVersionUID
= -3083906749528872196L;
33 * Quality of the result obtained by the synchronization algorithm
35 public enum SyncQuality
{
37 * Algorithm returned a result satisfying all hypothesis for the
42 * Best effort of the algorithm
46 * There is communication only in one direction
50 * No communication between two traces
54 * Hypothesis of the algorithm are not satisfied for some reason
60 public void addMatch(TmfEventDependency match
) {
61 super.addMatch(match
);
66 * Function for synchronization algorithm to do something with the received
72 protected abstract void processMatch(TmfEventDependency match
);
75 * Returns a map of staticstics relating to this algorithm. Those stats
76 * could be used to be displayed in a view for example.
78 * @return A map of statistics for this algorithm
80 public abstract Map
<String
, Map
<String
, Object
>> getStats();
83 * Returns a timestamp transformation algorithm
86 * The trace to get the transform for
87 * @return The timestamp transformation formula
89 public abstract ITmfTimestampTransform
getTimestampTransform(ITmfTrace trace
);
92 * Returns a timestamp transformation algorithm
95 * The host ID of the trace to get the transform for
96 * @return The timestamp transformation formula
98 public abstract ITmfTimestampTransform
getTimestampTransform(String hostId
);
101 * Gets the quality of the synchronization between two given traces
107 * @return The synchronization quality
109 public abstract SyncQuality
getSynchronizationQuality(ITmfTrace trace1
, ITmfTrace trace2
);
112 * Returns whether a given trace has a synchronization formula that is not
113 * identity. This function returns true if the synchronization algorithm has
114 * failed for some reason
117 * The host ID of the trace
118 * @return true if trace has formula
120 public abstract boolean isTraceSynced(String hostId
);
This page took 0.032948 seconds and 5 git commands to generate.