Search in sources :

Example 21 with ILogger

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

the class ClassDataProviderTest method createClassDataProvider.

private ClassDataProvider createClassDataProvider(UserCodeDeploymentConfig.ProviderMode providerMode, String className, ClassSource classSource, ClassLoader parent) {
    ILogger logger = mock(ILogger.class);
    ConcurrentMap<String, ClassSource> classSourceMap = new ConcurrentHashMap<String, ClassSource>();
    classSourceMap.put(className, classSource);
    return new ClassDataProvider(providerMode, parent, classSourceMap, logger);
}
Also used : ILogger(com.hazelcast.logging.ILogger) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Example 22 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 23 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)

Example 24 with ILogger

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

the class HazelcastClientInstanceImpl method initMetricsRegistry.

private MetricsRegistryImpl initMetricsRegistry() {
    ProbeLevel probeLevel = properties.getEnum(Diagnostics.METRICS_LEVEL, ProbeLevel.class);
    ILogger logger = loggingService.getLogger(MetricsRegistryImpl.class);
    MetricsRegistryImpl metricsRegistry = new MetricsRegistryImpl(logger, probeLevel);
    RuntimeMetricSet.register(metricsRegistry);
    GarbageCollectionMetricSet.register(metricsRegistry);
    OperatingSystemMetricSet.register(metricsRegistry);
    ThreadMetricSet.register(metricsRegistry);
    ClassLoadingMetricSet.register(metricsRegistry);
    FileMetricSet.register(metricsRegistry);
    return metricsRegistry;
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) ILogger(com.hazelcast.logging.ILogger) ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Example 25 with ILogger

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

the class JobSupervisor method asyncCancelRemoteOperations.

private void asyncCancelRemoteOperations(final Set<Address> addresses) {
    final NodeEngine nodeEngine = mapReduceService.getNodeEngine();
    TaskScheduler taskScheduler = nodeEngine.getExecutionService().getGlobalTaskScheduler();
    taskScheduler.execute(new Runnable() {

        @Override
        public void run() {
            String name = getConfiguration().getName();
            String jobId = getConfiguration().getJobId();
            for (Address address : addresses) {
                try {
                    CancelJobSupervisorOperation operation = new CancelJobSupervisorOperation(name, jobId);
                    mapReduceService.processRequest(address, operation);
                } catch (Exception ignore) {
                    // We can ignore this exception since we just want to cancel the job
                    // and the member may be crashed or unreachable in some way
                    ILogger logger = nodeEngine.getLogger(JobSupervisor.class);
                    logger.finest("Remote node may already be down", ignore);
                }
            }
        }
    });
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Address(com.hazelcast.nio.Address) ILogger(com.hazelcast.logging.ILogger) TaskScheduler(com.hazelcast.spi.TaskScheduler) CancelJobSupervisorOperation(com.hazelcast.mapreduce.impl.operation.CancelJobSupervisorOperation)

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