com.atlassian.confluence.cluster.hazelcast
Class HazelcastUtils

java.lang.Object
  extended by com.atlassian.confluence.cluster.hazelcast.HazelcastUtils

@Internal
public class HazelcastUtils
extends Object

Contains HZ Member <-> NodeIdentifier conversion utils

Since:
5.7

Constructor Summary
HazelcastUtils()
           
 
Method Summary
static com.google.common.base.Function<com.hazelcast.core.Member,com.atlassian.cluster.monitoring.spi.model.NodeIdentifier> extractNodeId()
           
static com.google.common.base.Function<com.hazelcast.core.Member,com.atlassian.cluster.monitoring.spi.model.NodeInformation> extractNodeInfo()
           
static com.atlassian.fugue.Maybe<String> getConfiguredMemberName(com.hazelcast.core.Member member)
           
static String getMemberId(com.hazelcast.core.Member member)
          While we could just use the Member UUID here, this would change on every restart.
static com.atlassian.cluster.monitoring.spi.model.NodeIdentifier getMemberNodeIdentifier(com.hazelcast.core.Member member)
           
static com.hazelcast.core.MemberSelector getMemberSelector(com.atlassian.cluster.monitoring.spi.model.NodeIdentifier nodeIdentifier)
           
static void setConfiguredMemberName(com.hazelcast.core.Member member, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HazelcastUtils

public HazelcastUtils()
Method Detail

getMemberId

public static String getMemberId(com.hazelcast.core.Member member)
While we could just use the Member UUID here, this would change on every restart. By using the socketAddress as the basis for the node identifier, it will mostly remain the same across restarts, making diagnosis of node affinity problems easier. Also, InetSocketAddress has a bad hashCode implementation, so we bypass it.


getMemberNodeIdentifier

public static com.atlassian.cluster.monitoring.spi.model.NodeIdentifier getMemberNodeIdentifier(com.hazelcast.core.Member member)

getMemberSelector

public static com.hazelcast.core.MemberSelector getMemberSelector(com.atlassian.cluster.monitoring.spi.model.NodeIdentifier nodeIdentifier)

extractNodeId

public static com.google.common.base.Function<com.hazelcast.core.Member,com.atlassian.cluster.monitoring.spi.model.NodeIdentifier> extractNodeId()

setConfiguredMemberName

public static void setConfiguredMemberName(com.hazelcast.core.Member member,
                                           String name)

getConfiguredMemberName

public static com.atlassian.fugue.Maybe<String> getConfiguredMemberName(com.hazelcast.core.Member member)

extractNodeInfo

public static com.google.common.base.Function<com.hazelcast.core.Member,com.atlassian.cluster.monitoring.spi.model.NodeInformation> extractNodeInfo()


Copyright © 2003–2015 Atlassian. All rights reserved.