Search in sources :

Example 26 with ILogger

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

the class ReplicationOperation method run.

@Override
public void run() throws Exception {
    ILogger logger = getLogger();
    if (logger.isFineEnabled()) {
        logger.fine("Moving partitionId=" + getPartitionId() + " to the new owner: " + getNodeEngine().getThisAddress() + " from: " + getCallerAddress());
    }
    ReplicatedMapService service = getService();
    if (data == null) {
        return;
    }
    fillRecordStoreWithRecords(service);
}
Also used : ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ILogger(com.hazelcast.logging.ILogger)

Example 27 with ILogger

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

the class RequestMapDataOperation method run.

@Override
public void run() throws Exception {
    ILogger logger = getLogger();
    int partitionId = getPartitionId();
    Address callerAddress = getCallerAddress();
    if (logger.isFineEnabled()) {
        logger.fine("Caller { " + callerAddress + " } requested copy of map: " + name + " partitionId=" + partitionId);
    }
    ReplicatedMapService service = getService();
    PartitionContainer container = service.getPartitionContainer(partitionId);
    ReplicatedRecordStore store = container.getOrCreateRecordStore(name);
    store.setLoaded(true);
    if (getNodeEngine().getThisAddress().equals(callerAddress)) {
        return;
    }
    long version = store.getVersion();
    Set<RecordMigrationInfo> recordSet = getRecordSet(store);
    SyncReplicatedMapDataOperation op = new SyncReplicatedMapDataOperation(name, recordSet, version);
    op.setPartitionId(partitionId);
    op.setValidateTarget(false);
    OperationService operationService = getNodeEngine().getOperationService();
    operationService.createInvocationBuilder(SERVICE_NAME, op, callerAddress).setTryCount(INVOCATION_TRY_COUNT).invoke();
}
Also used : Address(com.hazelcast.nio.Address) PartitionContainer(com.hazelcast.replicatedmap.impl.PartitionContainer) ReplicatedRecordStore(com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ILogger(com.hazelcast.logging.ILogger) OperationService(com.hazelcast.spi.OperationService) RecordMigrationInfo(com.hazelcast.replicatedmap.impl.record.RecordMigrationInfo)

Example 28 with ILogger

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

the class AuthenticationBaseMessageTask method prepareUnauthenticatedClientMessage.

private ClientMessage prepareUnauthenticatedClientMessage() {
    Connection connection = endpoint.getConnection();
    ILogger logger = clientEngine.getLogger(getClass());
    logger.warning("Received auth from " + connection + " with principal " + principal + " , authentication failed");
    byte status = AuthenticationStatus.CREDENTIALS_FAILED.getId();
    return encodeAuth(status, null, null, null, serializationService.getVersion(), null);
}
Also used : Connection(com.hazelcast.nio.Connection) ILogger(com.hazelcast.logging.ILogger)

Example 29 with ILogger

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

the class LocalLockCleanupOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    LockResource lock = lockStore.getLock(key);
    if (uuid.equals(lock.getOwner())) {
        ILogger logger = getLogger();
        if (logger.isFinestEnabled()) {
            logger.finest("Unlocking lock owned by uuid: " + uuid + ", thread-id: " + lock.getThreadId() + ", count: " + lock.getLockCount());
        }
        response = lockStore.forceUnlock(key);
    }
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl) LockResource(com.hazelcast.concurrent.lock.LockResource) ILogger(com.hazelcast.logging.ILogger)

Example 30 with ILogger

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

the class UnlockIfLeaseExpiredOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    int lockVersion = lockStore.getVersion(key);
    ILogger logger = getLogger();
    if (version == lockVersion) {
        if (logger.isFinestEnabled()) {
            logger.finest("Releasing a lock owned by " + lockStore.getOwnerInfo(key) + " after lease timeout!");
        }
        forceUnlock();
    } else {
        if (logger.isFinestEnabled()) {
            logger.finest("Won't unlock since lock version is not matching expiration version: " + lockVersion + " vs " + version);
        }
    }
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl) ILogger(com.hazelcast.logging.ILogger)

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