use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ForceStartNodeRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
String resultString;
HazelcastInstanceImpl instance = mcs.getHazelcastInstance();
try {
resultString = instance.node.getNodeExtension().getInternalHotRestartService().triggerForceStart() ? SUCCESS_RESULT : FAILED_RESULT;
} catch (Exception e) {
ILogger logger = instance.node.getLogger(getClass());
logger.warning("Problem on force start: ", e);
resultString = e.getMessage();
}
JsonObject result = new JsonObject().add("result", resultString);
out.add("result", result);
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ChangeClusterStateRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
String resultString = "SUCCESS";
try {
Cluster cluster = mcs.getHazelcastInstance().getCluster();
cluster.changeClusterState(getClusterState(state));
} catch (Exception e) {
ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass());
logger.warning("Cluster state can not be changed: ", e);
resultString = FAILURE + e.getMessage();
}
JsonObject result = new JsonObject().add("result", resultString);
out.add("result", result);
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ReplicaSyncResponse method nodeNotOwnsBackup.
/** Fail all replication operations with the exception that this node is no longer the replica with the sent index */
private void nodeNotOwnsBackup(InternalPartitionImpl partition) {
int partitionId = getPartitionId();
int replicaIndex = getReplicaIndex();
Address thisAddress = getNodeEngine().getThisAddress();
int currentReplicaIndex = partition.getReplicaIndex(thisAddress);
ILogger logger = getLogger();
if (logger.isFinestEnabled()) {
logger.finest("This node is not backup replica of partitionId=" + partitionId + ", replicaIndex=" + replicaIndex + " anymore. current replicaIndex=" + currentReplicaIndex);
}
if (tasks != null) {
Throwable throwable = new WrongTargetException(thisAddress, partition.getReplicaAddress(replicaIndex), partitionId, replicaIndex, getClass().getName());
for (Operation op : tasks) {
prepareOperation(op);
onOperationFailure(op, throwable);
}
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class ReplicaSyncRetryResponse method run.
@Override
public void run() throws Exception {
final InternalPartitionServiceImpl partitionService = getService();
final int partitionId = getPartitionId();
final int replicaIndex = getReplicaIndex();
partitionService.getReplicaManager().clearReplicaSyncRequest(partitionId, replicaIndex);
PartitionStateManager partitionStateManager = partitionService.getPartitionStateManager();
InternalPartitionImpl partition = partitionStateManager.getPartitionImpl(partitionId);
Address thisAddress = getNodeEngine().getThisAddress();
ILogger logger = getLogger();
int currentReplicaIndex = partition.getReplicaIndex(thisAddress);
if (currentReplicaIndex > 0) {
if (logger.isFinestEnabled()) {
logger.finest("Retrying replica sync request for partitionId=" + partitionId + ", initial-replicaIndex=" + replicaIndex + ", current-replicaIndex=" + currentReplicaIndex);
}
partitionService.getReplicaManager().triggerPartitionReplicaSync(partitionId, currentReplicaIndex, InternalPartitionService.REPLICA_SYNC_RETRY_DELAY);
} else if (logger.isFinestEnabled()) {
logger.finest("No need to retry replica sync request for partitionId=" + partitionId + ", initial-replicaIndex=" + replicaIndex + ", current-replicaIndex=" + currentReplicaIndex);
}
}
use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.
the class PromotionCommitOperation method beforePromotion.
private void beforePromotion() {
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
InternalOperationService operationService = nodeEngine.getOperationService();
InternalPartitionServiceImpl partitionService = getService();
ILogger logger = getLogger();
if (logger.isFineEnabled()) {
logger.fine("Submitting BeforePromotionOperations for " + promotions.size() + " promotions.");
}
Runnable beforePromotionsCallback = new BeforePromotionOperationCallback(this, new AtomicInteger(promotions.size()));
for (MigrationInfo promotion : promotions) {
if (logger.isFinestEnabled()) {
logger.finest("Submitting BeforePromotionOperation for promotion: " + promotion);
}
int currentReplicaIndex = promotion.getDestinationCurrentReplicaIndex();
BeforePromotionOperation op = new BeforePromotionOperation(currentReplicaIndex, beforePromotionsCallback);
op.setPartitionId(promotion.getPartitionId()).setNodeEngine(nodeEngine).setService(partitionService);
operationService.execute(op);
}
}
Aggregations