src/java/org/apache/cassandra/gms/Gossiper.java
/**
     * The gossip digest is built based on randomization
     * rather than just looping through the collection of live endpoints.
     *
     * @param gDigests list of Gossip Digests.
    */
The gossip digest is built based on randomization
rather than just looping through the collection of live endpoints.

@param gDigests list of Gossip Digests.
The gossip digest is built based on randomization rather than just looping through the collection of live endpoints . @param gDigests list of Gossip Digests .
private void makeRandomGossipDigest(List<GossipDigest> gDigests)
    {
        EndpointState epState;
        int generation = 0;
        int maxVersion = 0;
        List<InetAddress> endpoints = new ArrayList<InetAddress>(endpointStateMap.keySet());
        Collections.shuffle(endpoints, random);
        for (InetAddress endpoint : endpoints)
        {
            epState = endpointStateMap.get(endpoint);
            if (epState != null)
            {
                generation = epState.getHeartBeatState().getGeneration();
                maxVersion = getMaxEndpointStateVersion(epState);
            }
            gDigests.add(new GossipDigest(endpoint, generation, maxVersion));
        }
        if (logger.isTraceEnabled())
        {
            StringBuilder sb = new StringBuilder();
            for ( GossipDigest gDigest : gDigests )
            {
                sb.append(gDigest);
                sb.append(" ");
            }
                logger.trace("Gossip Digests are : " + sb.toString());
        }
    }
private void makeRandomGossipDigest ( List < GossipDigest > gDigests ) { EndpointState epState ; int generation = 0 ; int maxVersion = 0 ; List < InetAddress > endpoints = new ArrayList < InetAddress > ( endpointStateMap . keySet ( ) ) ; Collections . shuffle ( endpoints , random ) ; for ( InetAddress endpoint : endpoints ) { epState = endpointStateMap . get ( endpoint ) ; if ( epState != null ) { generation = epState . getHeartBeatState ( ) . getGeneration ( ) ; maxVersion = getMaxEndpointStateVersion ( epState ) ; } gDigests . add ( new GossipDigest ( endpoint , generation , maxVersion ) ) ; } if ( logger . isTraceEnabled ( ) ) { StringBuilder sb = new StringBuilder ( ) ; for ( GossipDigest gDigest : gDigests ) { sb . append ( gDigest ) ; sb . append ( " " ) ; } logger . trace ( "Gossip Digests are : " + sb . toString ( ) ) ; } }
The gossip digest is built based on randomization
 rather than just looping through the collection of live endpoints.
The gossip digest is built based on randomization rather than just looping through the collection of live endpoints .
// local epstate will be part of endpointStateMap