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);
}
}
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();
}
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);
}
}
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);
}
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);
}
Aggregations