use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class FinalizeMigrationOperation method rollbackDestination.
private void rollbackDestination() {
int partitionId = getPartitionId();
InternalPartitionServiceImpl partitionService = getService();
PartitionReplicaManager replicaManager = partitionService.getReplicaManager();
ILogger logger = getLogger();
int destinationCurrentReplicaIndex = migrationInfo.getDestinationCurrentReplicaIndex();
if (destinationCurrentReplicaIndex == -1) {
replicaManager.clearPartitionReplicaVersions(partitionId);
if (logger.isFinestEnabled()) {
logger.finest("Replica versions are cleared in destination after failed migration. partitionId=" + partitionId);
}
} else {
int replicaOffset = migrationInfo.getDestinationCurrentReplicaIndex() <= 1 ? 1 : migrationInfo.getDestinationCurrentReplicaIndex();
long[] versions = updatePartitionReplicaVersions(replicaManager, partitionId, replicaOffset - 1);
if (logger.isFinestEnabled()) {
logger.finest("Replica versions are rolled back in destination after failed migration. partitionId=" + partitionId + " replica versions=" + Arrays.toString(versions));
}
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class FinalizeMigrationOperation method commitSource.
private void commitSource() {
int partitionId = getPartitionId();
InternalPartitionServiceImpl partitionService = getService();
PartitionReplicaManager replicaManager = partitionService.getReplicaManager();
ILogger logger = getLogger();
int sourceNewReplicaIndex = migrationInfo.getSourceNewReplicaIndex();
if (sourceNewReplicaIndex < 0) {
replicaManager.clearPartitionReplicaVersions(partitionId);
if (logger.isFinestEnabled()) {
logger.finest("Replica versions are cleared in source after migration. partitionId=" + partitionId);
}
} else if (migrationInfo.getSourceCurrentReplicaIndex() != sourceNewReplicaIndex && sourceNewReplicaIndex > 1) {
long[] versions = updatePartitionReplicaVersions(replicaManager, partitionId, sourceNewReplicaIndex - 1);
if (logger.isFinestEnabled()) {
logger.finest("Replica versions are set after SHIFT DOWN migration. partitionId=" + partitionId + " replica versions=" + Arrays.toString(versions));
}
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class PromotionCommitOperation method finalizePromotion.
private void finalizePromotion() {
NodeEngine nodeEngine = getNodeEngine();
InternalPartitionServiceImpl partitionService = getService();
OperationService operationService = nodeEngine.getOperationService();
partitionState.setEndpoint(getCallerAddress());
success = partitionService.processPartitionRuntimeState(partitionState);
ILogger logger = getLogger();
if (logger.isFineEnabled()) {
logger.fine("Submitting FinalizePromotionOperations for " + promotions.size() + " promotions. Result: " + success);
}
for (MigrationInfo promotion : promotions) {
if (logger.isFinestEnabled()) {
logger.finest("Submitting FinalizePromotionOperation for promotion: " + promotion + ". Result: " + success);
}
int currentReplicaIndex = promotion.getDestinationCurrentReplicaIndex();
FinalizePromotionOperation op = new FinalizePromotionOperation(currentReplicaIndex, success);
op.setPartitionId(promotion.getPartitionId()).setNodeEngine(nodeEngine).setService(partitionService);
operationService.execute(op);
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ReplicaSyncRequest method logNoReplicaDataFound.
private void logNoReplicaDataFound(int partitionId, int replicaIndex) {
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
ILogger logger = nodeEngine.getLogger(getClass());
if (logger.isFinestEnabled()) {
logger.finest("No replica data is found for partitionId=" + partitionId + ", replicaIndex=" + replicaIndex);
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ReplicaSyncRequest method sendResponse.
/** Send a synchronization response to the caller replica containing the replication operations to be executed */
private void sendResponse(List<Operation> data) throws IOException {
NodeEngine nodeEngine = getNodeEngine();
ReplicaSyncResponse syncResponse = createResponse(data);
Address target = getCallerAddress();
ILogger logger = getLogger();
if (logger.isFinestEnabled()) {
logger.finest("Sending sync response to -> " + target + " for partitionId=" + getPartitionId() + ", replicaIndex=" + getReplicaIndex());
}
OperationService operationService = nodeEngine.getOperationService();
operationService.send(syncResponse, target);
}
Aggregations