com.hazelcast.cluster.impl
Class AbstractJoiner

java.lang.Object
  extended by com.hazelcast.cluster.impl.AbstractJoiner
All Implemented Interfaces:
Joiner
Direct Known Subclasses:
MulticastJoiner, TcpIpJoiner

public abstract class AbstractJoiner
extends Object
implements Joiner


Field Summary
protected  ConcurrentMap<Address,Boolean> blacklistedAddresses
           
protected  Config config
           
protected  ILogger logger
           
protected  Node node
           
 
Constructor Summary
AbstractJoiner(Node node)
           
 
Method Summary
 void blacklist(Address address, boolean permanent)
          Adds an address to the blacklist.
abstract  void doJoin()
           
protected  long getMaxJoinMillis()
           
protected  long getMaxJoinTimeToMasterNode()
           
 long getStartTime()
           
 Address getTargetAddress()
           
 boolean isBlacklisted(Address address)
          Checks if an address is blacklisted.
 void join()
           
 void reset()
           
 void setTargetAddress(Address targetAddress)
           
protected  void startClusterMerge(Address targetAddress)
           
 boolean unblacklist(Address address)
          Removes an address from the blacklist if it's temporarily blacklisted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hazelcast.cluster.Joiner
getType, searchForOtherClusters
 

Field Detail

blacklistedAddresses

protected final ConcurrentMap<Address,Boolean> blacklistedAddresses

config

protected final Config config

node

protected final Node node

logger

protected final ILogger logger
Constructor Detail

AbstractJoiner

public AbstractJoiner(Node node)
Method Detail

blacklist

public void blacklist(Address address,
                      boolean permanent)
Description copied from interface: Joiner
Adds an address to the blacklist. Blacklist is useful if a node should ignore another node, e.g. when the groupname of 2 machines is not the same and they should form different clusters.

If blacklist is permanent, then this operation is write-once. It cannot be unblacklisted again. If blacklist is temporary, blacklist can be removed via Joiner.unblacklist(com.hazelcast.nio.Address).

Method is thread-safe.

If the address already is blacklisted, the call is ignored

Specified by:
blacklist in interface Joiner
Parameters:
address - the address to blacklist.
permanent - if blacklist is permanent or not
See Also:
Joiner.isBlacklisted(com.hazelcast.nio.Address)

unblacklist

public boolean unblacklist(Address address)
Description copied from interface: Joiner
Removes an address from the blacklist if it's temporarily blacklisted. This method has no effect if given address is not blacklisted. Permanent blacklists cannot be undone.

Method is thread-safe.

If the address is not blacklisted, the call is ignored.

Specified by:
unblacklist in interface Joiner
Parameters:
address - the address to unblacklist.
Returns:
true if address is unblacklisted, false otherwise.

isBlacklisted

public boolean isBlacklisted(Address address)
Description copied from interface: Joiner
Checks if an address is blacklisted. Method is thread-safe.

Specified by:
isBlacklisted in interface Joiner
Parameters:
address - the address to check.
Returns:
true if blacklisted, false otherwise.
See Also:
Joiner.blacklist(com.hazelcast.nio.Address, boolean)

doJoin

public abstract void doJoin()

join

public final void join()
Specified by:
join in interface Joiner

getMaxJoinMillis

protected final long getMaxJoinMillis()

getMaxJoinTimeToMasterNode

protected final long getMaxJoinTimeToMasterNode()

reset

public void reset()
Specified by:
reset in interface Joiner

startClusterMerge

protected void startClusterMerge(Address targetAddress)

getStartTime

public final long getStartTime()
Specified by:
getStartTime in interface Joiner

setTargetAddress

public void setTargetAddress(Address targetAddress)
Specified by:
setTargetAddress in interface Joiner

getTargetAddress

public Address getTargetAddress()


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.