Search in sources :

Example 41 with ILogger

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

the class AbstractExecutorServiceCancelMessageTask method logException.

private void logException(Exception e) {
    ILogger logger = nodeEngine.getLogger(AbstractExecutorServiceCancelMessageTask.class);
    logger.warning(e);
}
Also used : ILogger(com.hazelcast.logging.ILogger)

Example 42 with ILogger

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

the class HazelcastClientInstanceImpl method initDiscoveryService.

private DiscoveryService initDiscoveryService(ClientConfig config) {
    // and strategies are resolved but the AddressProvider is never registered
    if (!properties.getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED)) {
        return null;
    }
    ILogger logger = loggingService.getLogger(DiscoveryService.class);
    ClientNetworkConfig networkConfig = config.getNetworkConfig();
    DiscoveryConfig discoveryConfig = networkConfig.getDiscoveryConfig().getAsReadOnly();
    DiscoveryServiceProvider factory = discoveryConfig.getDiscoveryServiceProvider();
    if (factory == null) {
        factory = new DefaultDiscoveryServiceProvider();
    }
    DiscoveryServiceSettings settings = new DiscoveryServiceSettings().setConfigClassLoader(config.getClassLoader()).setLogger(logger).setDiscoveryMode(DiscoveryMode.Client).setDiscoveryConfig(discoveryConfig);
    DiscoveryService discoveryService = factory.newDiscoveryService(settings);
    discoveryService.start();
    return discoveryService;
}
Also used : DefaultDiscoveryServiceProvider(com.hazelcast.spi.discovery.impl.DefaultDiscoveryServiceProvider) DiscoveryServiceProvider(com.hazelcast.spi.discovery.integration.DiscoveryServiceProvider) DefaultDiscoveryServiceProvider(com.hazelcast.spi.discovery.impl.DefaultDiscoveryServiceProvider) ILogger(com.hazelcast.logging.ILogger) DiscoveryConfig(com.hazelcast.config.DiscoveryConfig) DiscoveryService(com.hazelcast.spi.discovery.integration.DiscoveryService) DiscoveryServiceSettings(com.hazelcast.spi.discovery.integration.DiscoveryServiceSettings) ClientNetworkConfig(com.hazelcast.client.config.ClientNetworkConfig)

Example 43 with ILogger

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

the class DefaultClientConnectionManagerFactory method createConnectionManager.

@Override
public ClientConnectionManager createConnectionManager(ClientConfig config, HazelcastClientInstanceImpl client, DiscoveryService discoveryService) {
    LoggingService loggingService = client.getLoggingService();
    ILogger logger = loggingService.getLogger(HazelcastClient.class);
    ClientAwsConfig awsConfig = config.getNetworkConfig().getAwsConfig();
    AddressTranslator addressTranslator;
    if (awsConfig != null && awsConfig.isEnabled()) {
        try {
            addressTranslator = new AwsAddressTranslator(awsConfig, loggingService);
        } catch (NoClassDefFoundError e) {
            logger.warning("hazelcast-aws.jar might be missing!");
            throw e;
        }
    } else if (discoveryService != null) {
        addressTranslator = new DiscoveryAddressTranslator(discoveryService, client.getProperties().getBoolean(ClientProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED));
    } else {
        addressTranslator = new DefaultAddressTranslator();
    }
    return new ClientConnectionManagerImpl(client, addressTranslator);
}
Also used : AddressTranslator(com.hazelcast.client.connection.AddressTranslator) DefaultAddressTranslator(com.hazelcast.client.spi.impl.DefaultAddressTranslator) AwsAddressTranslator(com.hazelcast.client.spi.impl.AwsAddressTranslator) DiscoveryAddressTranslator(com.hazelcast.client.spi.impl.discovery.DiscoveryAddressTranslator) AwsAddressTranslator(com.hazelcast.client.spi.impl.AwsAddressTranslator) ClientConnectionManagerImpl(com.hazelcast.client.connection.nio.ClientConnectionManagerImpl) DefaultAddressTranslator(com.hazelcast.client.spi.impl.DefaultAddressTranslator) LoggingService(com.hazelcast.logging.LoggingService) ILogger(com.hazelcast.logging.ILogger) DiscoveryAddressTranslator(com.hazelcast.client.spi.impl.discovery.DiscoveryAddressTranslator) ClientAwsConfig(com.hazelcast.client.config.ClientAwsConfig)

Example 44 with ILogger

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

the class MapReduceUtil method notifyRemoteException.

public static void notifyRemoteException(JobSupervisor supervisor, Throwable throwable) {
    MapReduceService mapReduceService = supervisor.getMapReduceService();
    NodeEngine nodeEngine = mapReduceService.getNodeEngine();
    try {
        Address jobOwner = supervisor.getJobOwner();
        if (supervisor.isOwnerNode()) {
            supervisor.notifyRemoteException(jobOwner, throwable);
        } else {
            String name = supervisor.getConfiguration().getName();
            String jobId = supervisor.getConfiguration().getJobId();
            NotifyRemoteExceptionOperation operation = new NotifyRemoteExceptionOperation(name, jobId, throwable);
            OperationService os = nodeEngine.getOperationService();
            os.send(operation, jobOwner);
        }
    } catch (Exception e) {
        ILogger logger = nodeEngine.getLogger(MapReduceUtil.class);
        logger.warning("Could not notify remote map-reduce owner", e);
    }
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Address(com.hazelcast.nio.Address) ILogger(com.hazelcast.logging.ILogger) OperationService(com.hazelcast.spi.OperationService) NotifyRemoteExceptionOperation(com.hazelcast.mapreduce.impl.operation.NotifyRemoteExceptionOperation) RemoteMapReduceException(com.hazelcast.mapreduce.RemoteMapReduceException) TimeoutException(java.util.concurrent.TimeoutException)

Example 45 with ILogger

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

the class ClientContext method newRepairingTask.

private RepairingTask newRepairingTask(String serviceName) {
    MetaDataFetcher metaDataFetcher = newMetaDataFetcher(serviceName);
    ILogger logger = loggingService.getLogger(RepairingTask.class);
    return new RepairingTask(metaDataFetcher, executionService, minimalPartitionService, properties, localUuid, logger);
}
Also used : RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) ILogger(com.hazelcast.logging.ILogger) ClientCacheMetaDataFetcher(com.hazelcast.client.cache.impl.nearcache.invalidation.ClientCacheMetaDataFetcher) MetaDataFetcher(com.hazelcast.internal.nearcache.impl.invalidation.MetaDataFetcher) ClientMapMetaDataFetcher(com.hazelcast.client.map.impl.nearcache.invalidation.ClientMapMetaDataFetcher)

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