|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.timestamp.TimestampDiscrepancy
public class TimestampDiscrepancy
Provides information on possible system timestamp discrepancies between a remote node and the local node.
Usage: The local node should record the current system time and then request the current system time from the remote node. The local node should then record the current system time when the response is received from the remote node. The three values are then passed to this class' constructor.
Field Summary | |
---|---|
static TimestampDiscrepancy |
NO_DISCREPANCY
Fake discrepancy that indicates no system clock difference |
Constructor Summary | |
---|---|
TimestampDiscrepancy(long remoteTimestamp,
long requestSent,
long responseReceived)
Create a new TimestampDiscrepancy using the value returned by a remote request plus the local timestamps for when the request started and completed. |
|
TimestampDiscrepancy(TimestampDiscrepancy base,
TimestampDiscrepancy intermediary)
Generates a synthetic TimestampDiscrepancy based on a value provided by another node adjusted for the discrepancy between this node and the private TimestampDiscrepancy(long now) { this(now, now, now); } node that provided the base value. |
Method Summary | |
---|---|
long |
getAbsoluteMaxDiscrepancy()
Gets the higher of the absolute value of getMinDiscrepancy()
or the absolute value of getMaxDiscrepancy() . |
long |
getDiscrepancyRange()
Gets the difference between getMinDiscrepancy() and
getMaxDiscrepancy() |
long |
getEstimatedDiscrepancy()
Gets a rough estimate of the timestamp discrepancy between the systems. |
long |
getMaxDiscrepancy()
Maximum offset that would be applied to a remote timestamp to obtain the timestamp on the local system of a simultaneously occurring event. |
long |
getMaxLocalTimestamp(long remoteTimestamp)
Gets the maximum value for a local timestamp that would correspond to the remote timestamp. |
long |
getMaxRemoteTimestamp(long localTimestamp)
Gets the maximum value for a remote timestamp that would correspond to the local timestamp. |
long |
getMinDiscrepancy()
Minimum offset that would be applied to a local timestamp to obtain the timestamp on the remote system of a simultaneously occurring event. |
long |
getMinLocalTimestamp(long remoteTimestamp)
Gets the minimum value for a local timestamp that would correspond to the remote timestamp. |
long |
getMinRemoteTimestamp(long localTimestamp)
Gets the minimum value for a remote timestamp that would correspond to the local timestamp. |
long |
getRemoteTimestamp()
Gets the timestamp that the remote node returned. |
long |
getRequestRoundtripTime()
Gets the number of ms it took for the remote request that returned the remote timestamp . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final TimestampDiscrepancy NO_DISCREPANCY
Constructor Detail |
---|
public TimestampDiscrepancy(long remoteTimestamp, long requestSent, long responseReceived)
remoteTimestamp
- the timestamp returned by the remote noderequestSent
- local timestamp immediately before the timestamp request was maderesponseReceived
- local timestamp immediately after receipt of response
to the timestamp requestpublic TimestampDiscrepancy(TimestampDiscrepancy base, TimestampDiscrepancy intermediary)
base
- intermediary
- Method Detail |
---|
public long getRemoteTimestamp()
public long getMinDiscrepancy()
public long getMaxDiscrepancy()
public long getAbsoluteMaxDiscrepancy()
getMinDiscrepancy()
or the absolute value of getMaxDiscrepancy()
.
public long getDiscrepancyRange()
getMinDiscrepancy()
and
getMaxDiscrepancy()
public long getEstimatedDiscrepancy()
getMinDiscrepancy()
and
getMaxDiscrepancy()
public long getRequestRoundtripTime()
the remote timestamp
. The longer the
request took to execute, the less accurate the timestamp discrepancy.
public long getMinLocalTimestamp(long remoteTimestamp)
remoteTimestamp
- the remote timestamp
public long getMaxLocalTimestamp(long remoteTimestamp)
remoteTimestamp
- the remote timestamp
public long getMinRemoteTimestamp(long localTimestamp)
localTimestamp
- the local timestamp
public long getMaxRemoteTimestamp(long localTimestamp)
localTimestamp
- the local timestamp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |