@Override public String getUuid() { return hzInstance.getLocalEndpoint().getUuid(); }
@Override public Endpoint getLocalEndpoint() { return delegatedInstance.getLocalEndpoint(); }
@Override public Endpoint getLocalEndpoint() { return delegatedInstance.getLocalEndpoint(); }
@Override public Endpoint getLocalEndpoint() { return delegate.getLocalEndpoint(); }
@Override public Endpoint getLocalEndpoint() { return getHazelcastInstance().getLocalEndpoint(); }
private Set<SocketAddress> getLocalSocketAddresses(final Set<HazelcastInstance> hazelcastInstanceSet) { final Set<SocketAddress> localSocketAddressesSet = new HashSet<>(); for (HazelcastInstance hazelcastInstance : hazelcastInstanceSet) { localSocketAddressesSet.add(hazelcastInstance.getLocalEndpoint().getSocketAddress()); } return localSocketAddressesSet; }
private String nextMarkerId() { return hazelcastInstance.getLocalEndpoint().getUuid() + markerIdCounter.getAndIncrement(); }
private String nextMarkerId() { return hazelcastInstance.getLocalEndpoint().getUuid() + markerIdCounter.getAndIncrement(); }
private String nextMarkerId() { return hazelcastInstance.getLocalEndpoint().getUuid() + markerIdCounter.getAndIncrement(); }
private String nextMarkerId() { return hazelcastInstance.getLocalEndpoint().getUuid() + markerIdCounter.getAndIncrement(); }
private boolean isOldestMember() { Iterator<Member> memberIterator = hazelcastServerInstance.getCluster().getMembers().iterator(); boolean master = memberIterator.hasNext() && memberIterator.next().equals(hazelcastServerInstance.getLocalEndpoint()); return master; }
public static boolean isOldestMember(HazelcastInstance hazelcastInstance) { Iterator<Member> memberIterator = hazelcastInstance.getCluster().getMembers().iterator(); return memberIterator.hasNext() && memberIterator.next().equals(hazelcastInstance.getLocalEndpoint()); }
protected String getCurrentUser() { return JMXUtils.getCurrentUser(((Member) hzInstance.getLocalEndpoint()).getStringAttribute(pn_cluster_login)); }
private static boolean isLocalKey(HazelcastInstance instance, String key) { PartitionService partitionService = instance.getPartitionService(); Partition partition = partitionService.getPartition(key); Member owner = partition.getOwner(); return owner.equals(instance.getLocalEndpoint()); }
protected String getCurrentUser() { return JMXUtils.getCurrentUser(((Member) hzInstance.getLocalEndpoint()).getStringAttribute(pn_cluster_login)); }
public static HazelcastInstance findSchemaInstance(String schemaName) { // do we need synchronize this block? if (node_instance == null) { HazelcastInstance hzInstance = findSystemInstance(); node_instance = ((Member) hzInstance.getLocalEndpoint()).getStringAttribute(pn_node_instance); } return Hazelcast.getHazelcastInstanceByName(schemaName + "-" + node_instance); }
private Object addEdgeServer( HazelcastInstance hazelcastInstance ) { String uuid = hazelcastInstance.getLocalEndpoint().getUuid(); String addresses = connectorAddresses.toString(); log.debug( "Adding edge server into cluster (%s -> %s)", uuid, addresses ); return hazelcastInstance.getMap( EDGE_SERVER_BOLT_ADDRESS_MAP_NAME ) .put( uuid, addresses, edgeTimeToLiveTimeout, MILLISECONDS ); }
@Override public void run() { if (hzClient.getLifecycleService().isRunning()) { ReplicatedMap<String, Properties> clientProps = hzClient.getReplicatedMap(CN_XDM_CLIENT); clientProps.remove(clientId); if (shutdown) { logger.info("disconnect; shutting down HZ instance: {}", hzClient.getLocalEndpoint().getUuid()); long stamp = System.currentTimeMillis(); hzClient.getLifecycleService().shutdown(); logger.info("disconnect; instance shutdown, time taken: {}", System.currentTimeMillis() - stamp); } } else { logger.info("disconnect; attempted to shutdown not-running client!"); } } }.start();
private static InetSocketAddress getInetSocketAddress(HazelcastInstance hazelcastInstance) { try { return (InetSocketAddress) hazelcastInstance.getLocalEndpoint().getSocketAddress(); } catch (NoSuchMethodError ignored) { try { return hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress(); } catch (Exception e) { return null; } } }
private void disconnectFromCore() { try { String uuid = hzInstance.apply( hzInstance -> hzInstance.getLocalEndpoint().getUuid() ); hzInstance.apply( hz -> hz.getMap( READ_REPLICA_BOLT_ADDRESS_MAP ).remove( uuid ) ); hzInstance.shutdown(); } catch ( Throwable e ) { // Hazelcast is not able to stop correctly sometimes and throws a bunch of different exceptions // let's simply log the current problem but go on with our shutdown log.warn( "Unable to shutdown hazelcast cleanly", e ); } }