use of com.hazelcast.spi.impl.operationservice.Operation in project hazelcast by hazelcast.
the class ScheduledFutureProxy method isCancelled.
@Override
public boolean isCancelled() {
checkAccessibleHandler();
checkAccessibleOwner();
Operation op = new IsCanceledOperation(handler);
return this.<Boolean>invoke(op).joinInternal();
}
use of com.hazelcast.spi.impl.operationservice.Operation in project hazelcast by hazelcast.
the class ScheduledFutureProxy method get0.
private InvocationFuture<V> get0() {
checkAccessibleHandler();
checkAccessibleOwner();
Operation op = new GetResultOperation<V>(handler);
return this.invoke(op);
}
use of com.hazelcast.spi.impl.operationservice.Operation in project hazelcast by hazelcast.
the class WaitSet method unpark.
// Runs in partition-thread, and therefor we can assume we have exclusive access to the WaitNotifyKey
// (since each WaitNotifyKey is mapped to a single partition). So a park will not be concurrently
// executed with an unpark for the same key.
public void unpark(Notifier notifier, WaitNotifyKey key) {
WaitSetEntry entry = queue.peek();
while (entry != null) {
Operation op = entry.getOperation();
if (notifier == op) {
throw new IllegalStateException("Found cyclic wait-notify! -> " + notifier);
}
if (entry.isValid()) {
if (entry.isExpired()) {
// expired
entry.onExpire();
} else if (entry.isCancelled()) {
entry.onCancel();
} else {
if (entry.shouldWait()) {
return;
}
OperationService operationService = nodeEngine.getOperationService();
operationService.run(op);
}
entry.setValid(false);
}
// consume
queue.poll();
entry = queue.peek();
// We can safely remove this queue from registration map here.
if (entry == null) {
waitSetMap.remove(key);
}
}
}
use of com.hazelcast.spi.impl.operationservice.Operation in project hazelcast by hazelcast.
the class TotalOrderedTopicProxy method publishAllAsync.
@Override
public InternalCompletableFuture<Void> publishAllAsync(@Nonnull Collection<? extends E> messages) {
checkNotNull(messages, NULL_MESSAGE_IS_NOT_ALLOWED);
checkNoNullInside(messages, NULL_MESSAGE_IS_NOT_ALLOWED);
Operation op = new PublishAllOperation(getName(), toDataArray(messages));
return publishInternalAsync(op);
}
use of com.hazelcast.spi.impl.operationservice.Operation in project hazelcast by hazelcast.
the class TotalOrderedTopicProxy method publishAsync.
@Override
public InternalCompletableFuture<Void> publishAsync(@Nonnull E message) {
checkNotNull(message, NULL_MESSAGE_IS_NOT_ALLOWED);
Operation op = new PublishOperation(getName(), toData(message));
return publishInternalAsync(op);
}
Aggregations