Search in sources :

Example 71 with ILogger

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

the class ShutdownResponseOperation method run.

@Override
public void run() {
    InternalPartitionServiceImpl partitionService = getService();
    final ILogger logger = getLogger();
    final Address caller = getCallerAddress();
    final NodeEngine nodeEngine = getNodeEngine();
    final ClusterService clusterService = nodeEngine.getClusterService();
    final Address masterAddress = clusterService.getMasterAddress();
    if (nodeEngine.isRunning()) {
        logger.severe("Received a shutdown response from " + caller + ", but this node is not shutting down!");
        return;
    }
    boolean fromMaster = masterAddress.equals(caller);
    if (fromMaster) {
        if (logger.isFinestEnabled()) {
            logger.finest("Received shutdown response from " + caller);
        }
        partitionService.onShutdownResponse();
    } else {
        logger.warning("Received shutdown response from " + caller + " but known master is: " + masterAddress);
    }
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) ClusterService(com.hazelcast.internal.cluster.ClusterService) Address(com.hazelcast.nio.Address) InternalPartitionServiceImpl(com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl) ILogger(com.hazelcast.logging.ILogger)

Example 72 with ILogger

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

the class UserCodeDeploymentService method init.

@Override
public void init(NodeEngine nodeEngine, Properties properties) {
    UserCodeDeploymentConfig config = nodeEngine.getConfig().getUserCodeDeploymentConfig();
    if (!config.isEnabled()) {
        return;
    }
    ClassLoader parent = nodeEngine.getConfigClassLoader().getParent();
    Filter<String> classNameFilter = parseClassNameFilters(config);
    Filter<Member> memberFilter = parseMemberFilter(config.getProviderFilter());
    ConcurrentMap<String, ClassSource> classMap = new ConcurrentHashMap<String, ClassSource>();
    UserCodeDeploymentConfig.ProviderMode providerMode = config.getProviderMode();
    ILogger providerLogger = nodeEngine.getLogger(ClassDataProvider.class);
    provider = new ClassDataProvider(providerMode, parent, classMap, providerLogger);
    UserCodeDeploymentConfig.ClassCacheMode classCacheMode = config.getClassCacheMode();
    locator = new ClassLocator(classMap, parent, classNameFilter, memberFilter, classCacheMode, nodeEngine);
    enabled = config.isEnabled();
}
Also used : ClassLocator(com.hazelcast.internal.usercodedeployment.impl.ClassLocator) ClassDataProvider(com.hazelcast.internal.usercodedeployment.impl.ClassDataProvider) ILogger(com.hazelcast.logging.ILogger) UserCodeDeploymentConfig(com.hazelcast.config.UserCodeDeploymentConfig) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Member(com.hazelcast.core.Member) ClassSource(com.hazelcast.internal.usercodedeployment.impl.ClassSource)

Example 73 with ILogger

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

the class MockConnectionManager method stop.

@Override
public void stop() {
    logger.fine("Stopping connection manager");
    live = false;
    final Member localMember = node.getLocalMember();
    final Address thisAddress = localMember.getAddress();
    for (Address address : registry.getAddresses()) {
        if (address.equals(thisAddress)) {
            continue;
        }
        Node otherNode = registry.getNode(address);
        if (otherNode != null && otherNode.getState() != NodeState.SHUT_DOWN) {
            logger.fine(otherNode.getThisAddress() + " is instructed to remove us.");
            ILogger otherLogger = otherNode.getLogger(MockConnectionManager.class);
            otherLogger.fine(localMember + " will be removed from the cluster if present, " + "because it has requested to leave.");
            try {
                ClusterServiceImpl clusterService = otherNode.getClusterService();
                clusterService.removeAddress(localMember.getAddress(), localMember.getUuid(), "Connection manager is stopped on " + localMember);
            } catch (Throwable e) {
                otherLogger.warning("While removing " + thisAddress, e);
            }
        }
    }
    for (Connection connection : mapConnections.values()) {
        connection.close(null, null);
    }
}
Also used : Address(com.hazelcast.nio.Address) Node(com.hazelcast.instance.Node) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) Connection(com.hazelcast.nio.Connection) ILogger(com.hazelcast.logging.ILogger) Member(com.hazelcast.core.Member)

Example 74 with ILogger

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

the class LoadTrackerTest method setUp.

@Before
public void setUp() {
    selector1 = mock(NonBlockingIOThread.class);
    selector2 = mock(NonBlockingIOThread.class);
    selectors = new NonBlockingIOThread[] { selector1, selector2 };
    ILogger logger = mock(ILogger.class);
    when(logger.isFinestEnabled()).thenReturn(true);
    loadTracker = new LoadTracker(selectors, logger);
}
Also used : NonBlockingIOThread(com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread) ILogger(com.hazelcast.logging.ILogger) Before(org.junit.Before)

Example 75 with ILogger

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

the class PacketDispatcherImplTest method setup.

@Before
public void setup() {
    ILogger logger = Logger.getLogger(getClass());
    operationExecutor = mock(PacketHandler.class);
    responseHandler = mock(PacketHandler.class);
    eventService = mock(PacketHandler.class);
    connectionManager = mock(PacketHandler.class);
    invocationMonitor = mock(PacketHandler.class);
    jetService = mock(PacketHandler.class);
    dispatcher = new PacketDispatcherImpl(logger, operationExecutor, responseHandler, invocationMonitor, eventService, connectionManager, jetService);
}
Also used : PacketHandler(com.hazelcast.spi.impl.PacketHandler) ILogger(com.hazelcast.logging.ILogger) Before(org.junit.Before)

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