public class CardinalityEstimatorProxy extends AbstractDistributedObject<CardinalityEstimatorService> implements CardinalityEstimator
PARTITIONING_STRATEGY| Modifier and Type | Method and Description |
|---|---|
void |
add(Object obj)
Add a new object in the estimation set.
|
InvocationFuture<Void> |
addAsync(Object obj)
Add a new object in the estimation set.
|
long |
estimate()
Estimates the cardinality of the aggregation so far.
|
InvocationFuture<Long> |
estimateAsync()
Estimates the cardinality of the aggregation so far.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
int |
getPartitionId() |
String |
getServiceName()
Returns the service name for this object.
|
String |
toString() |
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, postDestroy, preDestroy, throwNotActiveException, toDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getPartitionKeypublic int getPartitionId()
public String getName()
DistributedObjectDistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject.getName in interface DistributedObjectpublic String getServiceName()
DistributedObjectgetServiceName in interface DistributedObjectgetServiceName in class AbstractDistributedObject<CardinalityEstimatorService>public void add(Object obj)
CardinalityEstimatorObjects are considered identical if they are serialized into the same binary blob. In other words: It does not use Java equality.
add in interface CardinalityEstimatorobj - object to add in the estimation set.public long estimate()
CardinalityEstimatorestimate in interface CardinalityEstimatorpublic InvocationFuture<Void> addAsync(Object obj)
CardinalityEstimatorObjects are considered identical if they are serialized into the same binary blob. In other words: It does not use Java equality.
This method will dispatch a request and return immediately a CompletionStage.
The operations result can be obtained in a blocking way, or a
callback can be provided for execution upon completion, as demonstrated in the following examples:
CompletionStage<Void> stage = estimator.addAsync();
// do something else, then read the result
Boolean result = stage.toCompletableFuture().get(); // this method will block until the result is available
CompletionStage<Void> stage = estimator.addAsync();
stage.whenCompleteAsync((response, throwable) -> {
if (throwable == null) {
// do something
} else {
// handle failure
}
});
addAsync in interface CardinalityEstimatorobj - object to add in the estimation set.CompletionStage API consumers can use to chain further computation stagespublic InvocationFuture<Long> estimateAsync()
CardinalityEstimator
This method will dispatch a request and return immediately a CompletionStage.
The operations result can be obtained in a blocking way, or a
callback can be provided for execution upon completion, as demonstrated in the following examples:
CompletionStage<Long> stage = estimator.estimateAsync();
// do something else, then read the result
Long result = stage.toCompletableFuture().get(); // this method will block until the result is available
CompletionStage<Long> stage = estimator.estimateAsync();
stage.whenCompleteAsync((response, throwable) -> {
if (throwable == null) {
// do something with the result
} else {
// handle failure
}
});
estimateAsync in interface CardinalityEstimatorCompletionStage bearing the response, the estimate.public String toString()
toString in class AbstractDistributedObject<CardinalityEstimatorService>Copyright © 2019 Hazelcast, Inc.. All rights reserved.