public class Completion extends RadosBase implements Closeable
| Constructor and Description |
|---|
Completion(boolean notifyOnComplete,
boolean notifyOnSafe)
Constructs a completion to use with asynchronous operations.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release a completion
|
boolean |
equals(Object that) |
int |
getId() |
com.sun.jna.Pointer |
getPointer() |
int |
hashCode() |
boolean |
isComplete() |
boolean |
isSafe() |
void |
onComplete()
Override this function to implement callback handling.
|
void |
onSafe()
Override this function to implement callback handling.
|
void |
waitForComplete()
Block until the operation completes.
|
void |
waitForSafe()
Block until the operation is safe.
|
handleReturnCode, throwExceptionpublic Completion(boolean notifyOnComplete,
boolean notifyOnSafe)
throws RadosException
The complete and safe callbacks correspond to operations being acked and committed, respectively. The callbacks are called in order of receipt, so the safe callback may be triggered before the complete callback, and vice versa. This is affected by journalling on the OSDs.
NOTE: Read operations only get a complete callback.
notifyOnComplete - If true, onComplete() is called when the operation is in
memory on all replicasnotifyOnSafe - If true, onSafe() is called when the operation is on stable
storage on all replicasRadosExceptionpublic void waitForComplete()
throws RadosException
RadosExceptionpublic void waitForSafe()
throws RadosException
RadosExceptionpublic void onComplete()
public void onSafe()
public void close()
throws IOException
Call this when you no longer need the completion. It may not be freed immediately if the operation is not acked and committed.
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic int getId()
public boolean isSafe()
public boolean isComplete()
public com.sun.jna.Pointer getPointer()
Copyright © 2020. All rights reserved.