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.
|
InternalCompletableFuture<Void> |
addAsync(Object obj)
Add a new object in the estimation set.
|
long |
estimate()
Estimates the cardinality of the aggregation so far.
|
InternalCompletableFuture<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, toData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey
public int getPartitionId()
public String getName()
DistributedObject
DistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject
.getName
in interface DistributedObject
public String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<CardinalityEstimatorService>
public void add(Object obj)
CardinalityEstimator
Objects are considered identical if they are serialized into the same binary blob. In other words: It does not use Java equality.
add
in interface CardinalityEstimator
obj
- object to add in the estimation set.public long estimate()
CardinalityEstimator
estimate
in interface CardinalityEstimator
public InternalCompletableFuture<Void> addAsync(Object obj)
CardinalityEstimator
Objects 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 an ICompletableFuture
.
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:
ICompletableFuture<Void> future = estimator.addAsync(); // do something else, then read the result Boolean result = future.get(); // this method will block until the result is available
ICompletableFuture<Void> future = estimator.addAsync(); future.andThen(new ExecutionCallback<Void>() { void onResponse(Void response) { // do something } void onFailure(Throwable t) { // handle failure } });
addAsync
in interface CardinalityEstimator
obj
- object to add in the estimation set.ICompletableFuture
API consumers can use to track execution of this request.public InternalCompletableFuture<Long> estimateAsync()
CardinalityEstimator
This method will dispatch a request and return immediately an ICompletableFuture
.
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:
ICompletableFuture<Long> future = estimator.estimateAsync(); // do something else, then read the result Long result = future.get(); // this method will block until the result is available
ICompletableFuture<Long> future = estimator.estimateAsync(); future.andThen(new ExecutionCallback<Long>() { void onResponse(Long response) { // do something with the result } void onFailure(Throwable t) { // handle failure } });
estimateAsync
in interface CardinalityEstimator
ICompletableFuture
bearing the response, the estimate.public String toString()
toString
in class AbstractDistributedObject<CardinalityEstimatorService>
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.