src/java/org/apache/cassandra/gms/Gossiper.java
/**
     * Do not call this method unless you know what you are doing.
     * It will try extremely hard to obliterate any endpoint from the ring,
     * even if it does not know about it.
     * This should only ever be called by human via JMX.
     * @param  address
     * @throws UnknownHostException
     */
Do not call this method unless you know what you are doing.
It will try extremely hard to obliterate any endpoint from the ring,
even if it does not know about it.
This should only ever be called by human via JMX.
@param  address
@throws UnknownHostException
Do not call this method unless you know what you are doing . It will try extremely hard to obliterate any endpoint from the ring even if it does not know about it . This should only ever be called by human via JMX . @param address @throws UnknownHostException
public void unsafeAssassinateEndpoint(String address) throws UnknownHostException
    {
        InetAddress endpoint = InetAddress.getByName(address);
        EndpointState epState = endpointStateMap.get(endpoint);
        Token token = null;
        logger.warn("Assassinating {} via gossip", endpoint);
        if (epState == null)
        {
            epState = new EndpointState(new HeartBeatState((int)((System.currentTimeMillis() + 60000) / 1000), 9999));
        }
        else
        {
            try
            {
                token = StorageService.instance.getTokenMetadata().getToken(endpoint);
            }
            catch (AssertionError e)
            {
            }
            int generation = epState.getHeartBeatState().getGeneration();
            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");
            epState.updateTimestamp(); 
            epState.getHeartBeatState().forceNewerGenerationUnsafe();
        }
        if (token == null)
            token = StorageService.instance.getBootstrapToken();
        epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.left(token, computeExpireTime()));
        handleMajorStateChange(endpoint, epState);
        try
        {
            Thread.sleep(intervalInMillis * 4);
        }
        catch (InterruptedException e)
        {
            throw new AssertionError(e);
        }
        logger.warn("Finished killing {}", endpoint);
    }
public void unsafeAssassinateEndpoint ( String address ) throws UnknownHostException { InetAddress endpoint = InetAddress . getByName ( address ) ; EndpointState epState = endpointStateMap . get ( endpoint ) ; Token token = null ; logger . warn ( "Assassinating {} via gossip" , endpoint ) ; if ( epState == null ) { epState = new EndpointState ( new HeartBeatState ( ( int ) ( ( System . currentTimeMillis ( ) + 60000 ) / 1000 ) , 9999 ) ) ; } else { try { token = StorageService . instance . getTokenMetadata ( ) . getToken ( endpoint ) ; } catch ( AssertionError e ) { } int generation = epState . getHeartBeatState ( ) . getGeneration ( ) ; 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" ) ; epState . updateTimestamp ( ) ; epState . getHeartBeatState ( ) . forceNewerGenerationUnsafe ( ) ; } if ( token == null ) token = StorageService . instance . getBootstrapToken ( ) ; epState . addApplicationState ( ApplicationState . STATUS , StorageService . instance . valueFactory . left ( token , computeExpireTime ( ) ) ) ; handleMajorStateChange ( endpoint , epState ) ; try { Thread . sleep ( intervalInMillis * 4 ) ; } catch ( InterruptedException e ) { throw new AssertionError ( e ) ; } logger . warn ( "Finished killing {}" , endpoint ) ; }
Do not call this method unless you know what you are doing.
Do not call this method unless you know what you are doing .
// make sure it did not change // make sure we don't evict it too soon // do not pass go, do not collect 200 dollars, just gtfo