src/main/java/net/batchik/crdt/gossip/ParticipantStates.java
/**
     * Called when a new peer is added to the cluster.
     * WARNING: the address given could be already in the cluster so the implementer needs
     * to check for this
     * @param address the address of the new location
     */
Called when a new peer is added to the cluster.
WARNING: the address given could be already in the cluster so the implementer needs
to check for this
@param address the address of the new location
Called when a new peer is added to the cluster . WARNING : the address given could be already in the cluster so the implementer needs to check for this @param address the address of the new location
@Suspendable
    public void newPeer(String address) {
        lock.writeLock().lock();
        try {
            if (!peerMap.containsKey(address)) {
                log.info("Adding peer at address: " + address);
                peerMap.put(address, new Peer(Main.convertAddress(address)));
            } else {
                log.debug("Address " + address + " is already in the cluster");
            }
        } finally {
            lock.writeLock().unlock();
        }
    }
@ Suspendable public void newPeer ( String address ) { lock . writeLock ( ) . lock ( ) ; try { if ( ! peerMap . containsKey ( address ) ) { log . info ( "Adding peer at address: " + address ) ; peerMap . put ( address , new Peer ( Main . convertAddress ( address ) ) ) ; } else { log . debug ( "Address " + address + " is already in the cluster" ) ; } } finally { lock . writeLock ( ) . unlock ( ) ; } }
Called when a new peer is added to the cluster.
Called when a new peer is added to the cluster .