Package com.hazelcast.spi

Examples of com.hazelcast.spi.OperationService.executeOperation()


        //we are going to fill up the partition first with tons of normal operations with take a lot of time
        for (int k = 0; k < pendingOperations; k++) {
            opService.executeOperation(new NormalPartitionAwareOperation(partitionid));
        }

        opService.executeOperation(new UrgentPartitionAwareOperation(latch, partitionid));

        //if the system operation would be given urgency, we should only wait for 1 operation to be processed before
        //our system operation is processed.
        assertTrueEventually(new AssertTask() {
            @Override
View Full Code Here


        int pendingOperations = 10000;
        final CountDownLatch latch = new CountDownLatch(1);

        //we are going to fill up the partition first with tons of normal operations with take a lot of time
        for (int k = 0; k < pendingOperations; k++) {
            opService.executeOperation(new NormalPartitionUnawareOperation());
        }

        //then we place the system operation
        opService.executeOperation(new UrgentPartitionUnawareOperation(latch));
View Full Code Here

        for (int k = 0; k < pendingOperations; k++) {
            opService.executeOperation(new NormalPartitionUnawareOperation());
        }

        //then we place the system operation
        opService.executeOperation(new UrgentPartitionUnawareOperation(latch));

        //if the system operation would be given urgency, we should only wait for 1 operation to be processed before
        //our system operation is processed.
        assertTrueEventually(new AssertTask() {
            @Override
View Full Code Here

            if (partitionId >= 0) {
                op = new SlowPartitionAwareSystemOperation(latch, partitionId);
            } else {
                op = new SlowPartitionUnawareSystemOperation(latch);
            }
            opService.executeOperation(op);
        }

        assertTrueEventually(new AssertTask() {
            @Override
            public void run() {
View Full Code Here

        try {
            for (MemberImpl member : nodeEngine.getClusterService().getMemberList()) {
                if (!member.localMember()) {
                    os.send(operation, member.getAddress());
                } else {
                    os.executeOperation(operation);
                }
            }
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
View Full Code Here

            final List<PartitionContainer> partitionIds = partitionContainers.subList(start, end);
            for (PartitionContainer container : partitionIds) {
                // mark partition container as has on going expiration operation.
                container.setHasRunningCleanup(true);
                OperationService operationService = ExpirationManager.this.nodeEngine.getOperationService();
                operationService.executeOperation(createExpirationOperation(EXPIRATION_PERCENTAGE,
                        container.getPartitionId()));
            }
        }

        private boolean expirable(RecordStore recordStore) {
View Full Code Here

                        .setPartitionId(partitionId)
                        .setResponseHandler(createEmptyResponseHandler())
                        .setService(this)
                        .setNodeEngine(nodeEngine)
                        .setServiceName(SERVICE_NAME);
                operationService.executeOperation(op);
            }
        }
    }

    @Override
View Full Code Here

            int partitionId = partitionService.getPartitionId(StringPartitioningStrategy.getPartitionKey(name));
            Operation operation = new CollectionTransactionRollbackOperation(name, transactionId)
                    .setPartitionId(partitionId)
                    .setService(this)
                    .setNodeEngine(nodeEngine);
            operationService.executeOperation(operation);
        }
    }

    @Override
    public void beforeMigration(PartitionMigrationEvent event) {
View Full Code Here

        OperationAccessor.setCallerAddress(operation, nodeEngine.getThisAddress());
        operation.setCallerUuid(nodeEngine.getLocalMember().getUuid());
        operation.setResponseHandler(unlockResponseHandler);
        operation.setAsyncBackup(true);

        operationService.executeOperation(operation);
    }

    private class UnlockResponseHandler implements ResponseHandler {
        @Override
        public void sendResponse(Object obj) {
View Full Code Here

            int partitionId = partitionService.getPartitionId(StringPartitioningStrategy.getPartitionKey(name));
            Operation operation = new QueueTransactionRollbackOperation(name, transactionId)
                    .setPartitionId(partitionId)
                    .setService(this)
                    .setNodeEngine(nodeEngine);
            operationService.executeOperation(operation);
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.