JetInstanceImpl(HazelcastInstanceImpl hazelcastInstance, JetConfig config) { super(hazelcastInstance); this.nodeEngine = hazelcastInstance.node.getNodeEngine(); this.config = config; }
@Override public void shouldConnectTo(Address address) { if (node.getThisAddress().equals(address)) { throw new RuntimeException("Connecting to self! " + address); } }
@Override public Config getConfig() { return node.getConfig(); }
private void changeNodeState(ClusterState newState) { if (newState == ClusterState.PASSIVE) { node.changeNodeStateToPassive(); } else { node.changeNodeStateToActive(); } }
public NodeMulticastListener(Node node) { this.node = node; this.logger = node.getLogger(NodeMulticastListener.class.getName()); this.ourConfig = node.createConfigCheck(); }
public NodeIOService(Node node, NodeEngineImpl nodeEngine) { this.node = node; this.nodeEngine = nodeEngine; restApiConfig = initRestApiConfig(node.getProperties(), node.getConfig()); memcacheProtocolConfig = initMemcacheProtocolConfig(node.getProperties(), node.getConfig()); }
private MulticastService(Node node, MulticastSocket multicastSocket) throws Exception { this.logger = node.getLogger(MulticastService.class.getName()); this.node = node; this.multicastSocket = multicastSocket; NodeIOService nodeIOService = new NodeIOService(node, node.nodeEngine); this.inputProcessor = node.getNodeExtension().createMulticastInputProcessor(nodeIOService); this.outputProcessor = node.getNodeExtension().createMulticastOutputProcessor(nodeIOService); this.sendOutput = node.getSerializationService().createObjectDataOutput(SEND_OUTPUT_SIZE); Config config = node.getConfig(); MulticastConfig multicastConfig = config.getNetworkConfig().getJoin().getMulticastConfig(); this.datagramPacketSend = new DatagramPacket(new byte[0], 0, InetAddress.getByName(multicastConfig.getMulticastGroup()), multicastConfig.getMulticastPort()); this.datagramPacketReceive = new DatagramPacket(new byte[DATAGRAM_BUFFER_SIZE], DATAGRAM_BUFFER_SIZE); Set<String> trustedInterfaces = multicastConfig.getTrustedInterfaces(); ILogger logger = node.getLogger(JoinMessageTrustChecker.class); joinMessageTrustChecker = new JoinMessageTrustChecker(trustedInterfaces, logger); }
MembershipManager(Node node, ClusterServiceImpl clusterService, Lock clusterServiceLock) { this.node = node; this.clusterService = clusterService; this.clusterServiceLock = clusterServiceLock; this.nodeEngine = node.getNodeEngine(); this.logger = node.getLogger(getClass()); mastershipClaimTimeoutSeconds = node.getProperties().getInteger(MASTERSHIP_CLAIM_TIMEOUT_SECONDS); registerThisMember(); }
public PartitionStateManager(Node node, InternalPartitionServiceImpl partitionService, PartitionListener listener) { this.node = node; this.logger = node.getLogger(getClass()); this.partitionService = partitionService; this.partitionCount = partitionService.getPartitionCount(); this.partitions = new InternalPartitionImpl[partitionCount]; PartitionReplica localReplica = PartitionReplica.from(node.getLocalMember()); for (int i = 0; i < partitionCount; i++) { this.partitions[i] = new InternalPartitionImpl(i, listener, localReplica); } memberGroupFactory = MemberGroupFactoryFactory.newMemberGroupFactory(node.getConfig().getPartitionGroupConfig(), node.getDiscoveryService()); partitionStateGenerator = new PartitionStateGeneratorImpl(); }
PartitionReplicaStateChecker(Node node, InternalPartitionServiceImpl partitionService) { this.node = node; this.nodeEngine = node.getNodeEngine(); this.partitionService = partitionService; this.logger = node.getLogger(getClass()); this.partitionStateManager = partitionService.getPartitionStateManager(); this.migrationManager = partitionService.getMigrationManager(); }
public ClientEngineImpl(Node node) { this.logger = node.getLogger(ClientEngine.class); this.node = node; this.serializationService = node.getSerializationService(); this.nodeEngine = node.nodeEngine; this.endpointManager = new ClientEndpointManagerImpl(nodeEngine); this.executor = newClientExecutor(); this.queryExecutor = newClientQueryExecutor(); this.clientManagementExecutor = newClientsManagementExecutor(); this.messageTaskFactory = new CompositeMessageTaskFactory(nodeEngine); this.clientExceptions = initClientExceptionFactory(); this.endpointRemoveDelaySeconds = node.getProperties().getInteger(GroupProperty.CLIENT_ENDPOINT_REMOVE_DELAY_SECONDS); this.partitionListenerService = new ClientPartitionListenerService(nodeEngine); }
private boolean shouldResetHotRestartData() { final NodeExtension nodeExtension = node.getNodeExtension(); return !nodeExtension.isStartCompleted() && nodeExtension.getInternalHotRestartService().isMemberExcluded(node.getThisAddress(), node.getThisUuid()); }
if (!setShuttingDown()) { waitIfAlreadyShuttingDown(); return; boolean success = callGracefulShutdownAwareServices(maxWaitSeconds); if (!success) { logger.warning("Graceful shutdown could not be completed in " + maxWaitSeconds + " seconds!"); shutdownServices(terminate); state = NodeState.SHUT_DOWN; logger.info("Hazelcast Shutdown is completed in " + (Clock.currentTimeMillis() - start) + " ms.");
/** Sends a {@link ShutdownResponseOperation} to the {@code address} or takes a shortcut if shutdown is local. */ private void sendShutdownOperation(Address address) { if (node.getThisAddress().equals(address)) { assert !node.isRunning() : "Node state: " + node.getState(); partitionService.onShutdownResponse(); } else { nodeEngine.getOperationService().send(new ShutdownResponseOperation(), address); } }
@Override public Member getLocalEndpoint() { return node.getLocalMember(); }
public SplitBrainJoinMessage createSplitBrainJoinMessage() { MemberImpl localMember = getLocalMember(); boolean liteMember = localMember.isLiteMember(); Collection<Address> memberAddresses = clusterService.getMemberAddresses(); int dataMemberCount = clusterService.getSize(DATA_MEMBER_SELECTOR); Version clusterVersion = clusterService.getClusterVersion(); int memberListVersion = clusterService.getMembershipManager().getMemberListVersion(); return new SplitBrainJoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(), liteMember, createConfigCheck(), memberAddresses, dataMemberCount, clusterVersion, memberListVersion); }
@Override public InternalSerializationService getSerializationService() { return node.getSerializationService(); }
protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) { this.clientMessage = clientMessage; this.logger = node.getLogger(getClass()); this.node = node; this.nodeEngine = node.nodeEngine; this.serializationService = node.getSerializationService(); this.connection = connection; this.clientEngine = node.clientEngine; this.endpointManager = clientEngine.getEndpointManager(); this.endpoint = initEndpoint(); }
private Diagnostics newDiagnostics() { Address address = node.getThisAddress(); String addressString = address.getHost().replace(":", "_") + "_" + address.getPort(); String name = "diagnostics-" + addressString + "-" + currentTimeMillis(); return new Diagnostics( name, loggingService.getLogger(Diagnostics.class), getHazelcastInstance().getName(), node.getProperties()); }