Search in sources :

Example 6 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 7 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)

Example 8 with ILogger

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

the class SemaphoreDetachMemberOperation method run.

@Override
public void run() throws Exception {
    SemaphoreService service = getService();
    if (service.containsSemaphore(name)) {
        SemaphoreContainer semaphoreContainer = service.getSemaphoreContainer(name);
        response = semaphoreContainer.detachAll(detachedMemberUuid);
    }
    ILogger logger = getLogger();
    if (logger.isFineEnabled()) {
        logger.fine("Removing permits attached to " + detachedMemberUuid + ". Result: " + response);
    }
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer) SemaphoreService(com.hazelcast.concurrent.semaphore.SemaphoreService) ILogger(com.hazelcast.logging.ILogger)

Example 9 with ILogger

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

the class HazelcastClientInstanceImpl method createAddressProviders.

private Collection<AddressProvider> createAddressProviders(AddressProvider externalAddressProvider) {
    ClientNetworkConfig networkConfig = getClientConfig().getNetworkConfig();
    final ClientAwsConfig awsConfig = networkConfig.getAwsConfig();
    Collection<AddressProvider> addressProviders = new LinkedList<AddressProvider>();
    addressProviders.add(new DefaultAddressProvider(networkConfig));
    if (externalAddressProvider != null) {
        addressProviders.add(externalAddressProvider);
    }
    if (discoveryService != null) {
        addressProviders.add(new DiscoveryAddressProvider(discoveryService, loggingService));
    }
    if (awsConfig != null && awsConfig.isEnabled()) {
        try {
            addressProviders.add(new AwsAddressProvider(awsConfig, loggingService));
        } catch (NoClassDefFoundError e) {
            ILogger logger = loggingService.getLogger(HazelcastClient.class);
            logger.warning("hazelcast-aws.jar might be missing!");
            throw e;
        }
    }
    return addressProviders;
}
Also used : AwsAddressProvider(com.hazelcast.client.spi.impl.AwsAddressProvider) DefaultAddressProvider(com.hazelcast.client.spi.impl.DefaultAddressProvider) AddressProvider(com.hazelcast.client.connection.AddressProvider) DiscoveryAddressProvider(com.hazelcast.client.spi.impl.discovery.DiscoveryAddressProvider) AwsAddressProvider(com.hazelcast.client.spi.impl.AwsAddressProvider) DiscoveryAddressProvider(com.hazelcast.client.spi.impl.discovery.DiscoveryAddressProvider) DefaultAddressProvider(com.hazelcast.client.spi.impl.DefaultAddressProvider) HazelcastClient(com.hazelcast.client.HazelcastClient) ILogger(com.hazelcast.logging.ILogger) ClientAwsConfig(com.hazelcast.client.config.ClientAwsConfig) LinkedList(java.util.LinkedList) ClientNetworkConfig(com.hazelcast.client.config.ClientNetworkConfig)

Example 10 with ILogger

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

the class HazelcastClientInstanceImpl method initDiagnostics.

private Diagnostics initDiagnostics(ClientConfig config) {
    String name = "diagnostics-client-" + id + "-" + currentTimeMillis();
    ILogger logger = loggingService.getLogger(Diagnostics.class);
    HazelcastThreadGroup hzThreadGroup = new HazelcastThreadGroup(getName(), logger, config.getClassLoader());
    return new Diagnostics(name, logger, hzThreadGroup, properties);
}
Also used : Diagnostics(com.hazelcast.internal.diagnostics.Diagnostics) ILogger(com.hazelcast.logging.ILogger) HazelcastThreadGroup(com.hazelcast.instance.HazelcastThreadGroup)

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