Search in sources :

Example 56 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class ReplicaSyncResponse method prepareOperation.

private void prepareOperation(Operation op) {
    int partitionId = getPartitionId();
    int replicaIndex = getReplicaIndex();
    NodeEngine nodeEngine = getNodeEngine();
    ILogger opLogger = nodeEngine.getLogger(op.getClass());
    OperationResponseHandler responseHandler = createErrorLoggingResponseHandler(opLogger);
    op.setNodeEngine(nodeEngine).setPartitionId(partitionId).setReplicaIndex(replicaIndex).setOperationResponseHandler(responseHandler);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) ILogger(com.hazelcast.logging.ILogger) OperationResponseHandler(com.hazelcast.spi.OperationResponseHandler)

Example 57 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class MigrationOperation method logMigrationFailure.

private void logMigrationFailure(Throwable e) {
    Level level = Level.WARNING;
    if (e instanceof IllegalStateException) {
        level = Level.FINEST;
    }
    ILogger logger = getLogger();
    if (logger.isLoggable(level)) {
        logger.log(level, e.getMessage(), e);
    }
}
Also used : Level(java.util.logging.Level) ILogger(com.hazelcast.logging.ILogger)

Example 58 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class PartitionStateOperation method run.

@Override
public void run() {
    Address callerAddress = getCallerAddress();
    partitionState.setEndpoint(callerAddress);
    InternalPartitionServiceImpl partitionService = getService();
    success = partitionService.processPartitionRuntimeState(partitionState);
    ILogger logger = getLogger();
    if (logger.isFineEnabled()) {
        String message = (success ? "Applied" : "Rejected") + " new partition state. Version: " + partitionState.getVersion() + ", caller: " + callerAddress;
        logger.fine(message);
    }
}
Also used : Address(com.hazelcast.nio.Address) InternalPartitionServiceImpl(com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl) ILogger(com.hazelcast.logging.ILogger)

Example 59 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class HeartbeatOperation method run.

@Override
public void run() {
    ClusterServiceImpl service = getService();
    MemberImpl member = service.getMember(getCallerAddress());
    if (member == null) {
        ILogger logger = getLogger();
        if (logger.isFineEnabled()) {
            logger.fine("Heartbeat received from an unknown endpoint: " + getCallerAddress());
        }
        return;
    }
    service.getClusterHeartbeatManager().onHeartbeat(member, timestamp);
}
Also used : MemberImpl(com.hazelcast.instance.MemberImpl) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ILogger(com.hazelcast.logging.ILogger)

Example 60 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class MasterClaimOperation method run.

@Override
public void run() {
    final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
    Node node = nodeEngine.getNode();
    Joiner joiner = node.getJoiner();
    final ILogger logger = node.getLogger(getClass().getName());
    if (joiner instanceof TcpIpJoiner) {
        TcpIpJoiner tcpIpJoiner = (TcpIpJoiner) joiner;
        final Address endpoint = getCallerAddress();
        final Address masterAddress = node.getMasterAddress();
        approvedAsMaster = !tcpIpJoiner.isClaimingMaster() && !node.isMaster() && (masterAddress == null || masterAddress.equals(endpoint));
    } else {
        approvedAsMaster = false;
        logger.warning("This node requires MulticastJoin strategy!");
    }
    if (logger.isFineEnabled()) {
        logger.fine("Sending '" + approvedAsMaster + "' for master claim of node: " + getCallerAddress());
    }
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) TcpIpJoiner(com.hazelcast.cluster.impl.TcpIpJoiner) Joiner(com.hazelcast.cluster.Joiner) Address(com.hazelcast.nio.Address) Node(com.hazelcast.instance.Node) ILogger(com.hazelcast.logging.ILogger) TcpIpJoiner(com.hazelcast.cluster.impl.TcpIpJoiner)

Aggregations

ILogger (com.hazelcast.logging.ILogger)76 Address (com.hazelcast.nio.Address)19 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)11 Node (com.hazelcast.instance.Node)10 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)10 NodeEngine (com.hazelcast.spi.NodeEngine)10 ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)9 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)6 OperationService (com.hazelcast.spi.OperationService)6 IOException (java.io.IOException)4 Before (org.junit.Before)4 JsonObject (com.eclipsesource.json.JsonObject)3 ClientAwsConfig (com.hazelcast.client.config.ClientAwsConfig)3 Connection (com.hazelcast.nio.Connection)3 ReplicatedRecordStore (com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore)3 Operation (com.hazelcast.spi.Operation)3 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)3 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)3 ClientNetworkConfig (com.hazelcast.client.config.ClientNetworkConfig)2 ClusterState (com.hazelcast.cluster.ClusterState)2