use of com.hazelcast.spi.impl.operationservice.PartitionAwareOperation in project hazelcast by hazelcast.
the class NodeEngineImpl method getPostJoinOperations.
/**
* Collects all post-join operations from {@link PostJoinAwareService}s.
* <p>
* Post join operations should return response, at least a {@code null} response.
* <p>
* <b>Note</b>: Post join operations must be lock free, meaning no locks at all:
* no partition locks, no key-based locks, no service level locks, no database interaction!
* The {@link Operation#getPartitionId()} method should return a negative value.
* This means that the operations should not implement {@link PartitionAwareOperation}.
*
* @return the operations to be executed at the end of a finalized join
*/
public Collection<Operation> getPostJoinOperations() {
Collection<Operation> postJoinOps = new LinkedList<>();
Collection<PostJoinAwareService> services = getServices(PostJoinAwareService.class);
for (PostJoinAwareService service : services) {
Operation postJoinOperation = service.getPostJoinOperation();
if (postJoinOperation != null) {
if (postJoinOperation.getPartitionId() >= 0) {
logger.severe("Post-join operations should not have partition ID set! Service: " + service + ", Operation: " + postJoinOperation);
continue;
}
postJoinOps.add(postJoinOperation);
}
}
return postJoinOps;
}
Aggregations