src/java/org/apache/cassandra/gms/Gossiper.java
/**
     * This method will begin removing an existing endpoint from the cluster by spoofing its state
     * This should never be called unless this coordinator has had 'removetoken' invoked
     *
     * @param endpoint - the endpoint being removed
     * @param token - the token being removed
     * @param mytoken - my own token for replication coordination
     */
This method will begin removing an existing endpoint from the cluster by spoofing its state
This should never be called unless this coordinator has had 'removetoken' invoked

@param endpoint - the endpoint being removed
@param token - the token being removed
@param mytoken - my own token for replication coordination
This method will begin removing an existing endpoint from the cluster by spoofing its state This should never be called unless this coordinator has had ' removetoken ' invoked @param endpoint - the endpoint being removed @param token - the token being removed @param mytoken - my own token for replication coordination
public void advertiseRemoving(InetAddress endpoint, Token token, Token mytoken)
    {
        EndpointState epState = endpointStateMap.get(endpoint);
        int generation = epState.getHeartBeatState().getGeneration();
        logger.info("Removing token: " + token);
        logger.info("Sleeping for " + StorageService.RING_DELAY + "ms to ensure " + endpoint + " does not change");
        try
        {
            Thread.sleep(StorageService.RING_DELAY);
        }
        catch (InterruptedException e)
        {
            throw new AssertionError(e);
        }
        epState = endpointStateMap.get(endpoint);
        if (epState.getHeartBeatState().getGeneration() != generation)
            throw new RuntimeException("Endpoint " + endpoint + " generation changed while trying to remove it");
        logger.info("Advertising removal for " + endpoint);
        epState.updateTimestamp(); 
        epState.getHeartBeatState().forceNewerGenerationUnsafe();
        epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removingNonlocal(token));
        epState.addApplicationState(ApplicationState.REMOVAL_COORDINATOR, StorageService.instance.valueFactory.removalCoordinator(mytoken));
        endpointStateMap.put(endpoint, epState);
    }
public void advertiseRemoving ( InetAddress endpoint , Token token , Token mytoken ) { EndpointState epState = endpointStateMap . get ( endpoint ) ; int generation = epState . getHeartBeatState ( ) . getGeneration ( ) ; logger . info ( "Removing token: " + token ) ; logger . info ( "Sleeping for " + StorageService . RING_DELAY + "ms to ensure " + endpoint + " does not change" ) ; try { Thread . sleep ( StorageService . RING_DELAY ) ; } catch ( InterruptedException e ) { throw new AssertionError ( e ) ; } epState = endpointStateMap . get ( endpoint ) ; if ( epState . getHeartBeatState ( ) . getGeneration ( ) != generation ) throw new RuntimeException ( "Endpoint " + endpoint + " generation changed while trying to remove it" ) ; logger . info ( "Advertising removal for " + endpoint ) ; epState . updateTimestamp ( ) ; epState . getHeartBeatState ( ) . forceNewerGenerationUnsafe ( ) ; epState . addApplicationState ( ApplicationState . STATUS , StorageService . instance . valueFactory . removingNonlocal ( token ) ) ; epState . addApplicationState ( ApplicationState . REMOVAL_COORDINATOR , StorageService . instance . valueFactory . removalCoordinator ( mytoken ) ) ; endpointStateMap . put ( endpoint , epState ) ; }
This method will begin removing an existing endpoint from the cluster by spoofing its state
 This should never be called unless this coordinator has had 'removetoken' invoked
This method will begin removing an existing endpoint from the cluster by spoofing its state This should never be called unless this coordinator has had ' removetoken ' invoked
// remember this node's generation // make sure it did not change // update the other node's generation to mimic it as if it had changed it itself // make sure we don't evict it too soon