public class ServerUpdateCallback extends FutureReplyCallback
ismaster
or
replSetGetStatus
commands.LOG, SPIN_TIME_NS
Constructor and Description |
---|
ServerUpdateCallback(Server server)
Creates a new ServerUpdateCallback.
|
Modifier and Type | Method and Description |
---|---|
void |
callback(Reply result)
Called when the MongoDB operation has completed with the result of the
operation.
|
void |
exception(Throwable error)
Called when the operation fails due to an exception.
|
isLightWeight
addListener, cancel, execute, get, get, isCancelled, isDone
public ServerUpdateCallback(Server 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)
public void exception(Throwable error)
Sets the exception for the future and triggers any pending FutureCallback.get()
to throw a ExecutionException
.
Overridden to mark the server as Integer.MAX_VALUE
seconds behind
the primary.
exception
in interface Callback<Reply>
exception
in class FutureCallback<Reply>
error
- The thrown exception.Callback.exception(java.lang.Throwable)
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.