public class SecondsBehindCallback extends FutureCallback<Reply>
To account for idle servers we use the optime for each server and assign a value of zero to the "latest" optime and then subtract the remaining servers from that optime.
Constructor and Description |
---|
SecondsBehindCallback(ServerState server)
Creates a new SecondsBehindCallback.
|
Modifier and Type | Method and Description |
---|---|
void |
callback(Reply result)
Called when the MongoDB operation has completed with the result of the
operation.
|
cancel, exception, get, get, isCancelled, isDone
public SecondsBehindCallback(ServerState server)
server
- The server we are tracking the latency for.public void callback(Reply result)
Sets the value for the future and triggers any pending FutureCallback.get()
to
return.
Overridden to update the server's latency based on the round trip reply time.
callback
in interface Callback<Reply>
callback
in class FutureCallback<Reply>
result
- The result of the operation.Callback.callback(V)
Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.