Package org.apache.cassandra.net

Examples of org.apache.cassandra.net.EndPoint


    }

    public Set<EndPoint> getLiveMembers()
    {
        Set<EndPoint> liveMbrs = new HashSet<EndPoint>(liveEndpoints_);
        liveMbrs.add( new EndPoint( localEndPoint_.getHost(), localEndPoint_.getPort() ) );
        return liveMbrs;
    }
View Full Code Here


        if ( rrIndex_ >= size )
        {
            rrIndex_ = -1;
        }

        EndPoint to = eps.get(++rrIndex_);
        logger_.trace("Sending a GossipDigestSynMessage to " + to + " ...");
        MessagingService.getMessagingInstance().sendUdpOneWay(message, to);
        return seeds_.contains(to);
    }
View Full Code Here

    {
        int size = epSet.size();
        /* Generate a random number from 0 -> size */
        List<EndPoint> liveEndPoints = new ArrayList<EndPoint>(epSet);
        int index = (size == 1) ? 0 : random_.nextInt(size);
        EndPoint to = liveEndPoints.get(index);
        logger_.trace("Sending a GossipDigestSynMessage to " + to + " ...");
        MessagingService.getMessagingInstance().sendUdpOneWay(message, to);
        return seeds_.contains(to);
    }
View Full Code Here

        localEndPoint_ = localEndPoint;
        /* Get the seeds from the config and initialize them. */
        Set<String> seedHosts = DatabaseDescriptor.getSeeds();
        for( String seedHost : seedHosts )
        {
            EndPoint seed = new EndPoint(InetAddress.getByName(seedHost).getHostAddress(),
                                         DatabaseDescriptor.getControlPort());
            if ( seed.equals(localEndPoint) )
                continue;
            seeds_.add(seed);
        }

        /* initialize the heartbeat state for this localEndPoint */
 
View Full Code Here

{
    private static Logger logger_ = Logger.getLogger( JoinVerbHandler.class);

    public void doVerb(Message message)
    {
        EndPoint from = message.getFrom();
        logger_.debug("Received a JoinMessage from " + from);

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );
View Full Code Here

{
    private static Logger logger_ = Logger.getLogger( GossipDigestSynVerbHandler.class);

    public void doVerb(Message message)
    {
        EndPoint from = message.getFrom();
        logger_.trace("Received a GossipDigestSynMessage from " + from);

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );
View Full Code Here

         * of the local EndPointState and the version found in the GossipDigest.
        */
        List<GossipDigest> diffDigests = new ArrayList<GossipDigest>();
        for ( GossipDigest gDigest : gDigestList )
        {
            EndPoint ep = gDigest.getEndPoint();
            EndPointState epState = Gossiper.instance().getEndPointStateForEndPoint(ep);
            int version = (epState != null) ? Gossiper.instance().getMaxEndPointStateVersion( epState ) : 0;
            int diffVersion = Math.abs(version - gDigest.getMaxVersion() );
            diffDigests.add( new GossipDigest(ep, gDigest.getGeneration(), diffVersion) );
        }
View Full Code Here

{
    private static Logger logger_ = Logger.getLogger(GossipDigestAckVerbHandler.class);

    public void doVerb(Message message)
    {
        EndPoint from = message.getFrom();
        logger_.trace("Received a GossipDigestAckMessage from " + from);

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );

        try
        {
            GossipDigestAckMessage gDigestAckMessage = GossipDigestAckMessage.serializer().deserialize(dis);
            List<GossipDigest> gDigestList = gDigestAckMessage.getGossipDigestList();
            Map<EndPoint, EndPointState> epStateMap = gDigestAckMessage.getEndPointStateMap();

            if ( epStateMap.size() > 0 )
            {
                /* Notify the Failure Detector */
                Gossiper.instance().notifyFailureDetector(epStateMap);
                Gossiper.instance().applyStateLocally(epStateMap);
            }

            /* Get the state required to send to this gossipee - construct GossipDigestAck2Message */
            Map<EndPoint, EndPointState> deltaEpStateMap = new HashMap<EndPoint, EndPointState>();
            for( GossipDigest gDigest : gDigestList )
            {
                EndPoint addr = gDigest.getEndPoint();
                EndPointState localEpStatePtr = Gossiper.instance().getStateForVersionBiggerThan(addr, gDigest.getMaxVersion());
                if ( localEpStatePtr != null )
                    deltaEpStateMap.put(addr, localEpStatePtr);
            }

View Full Code Here

{
    private static Logger logger_ = Logger.getLogger(GossipDigestAck2VerbHandler.class);

    public void doVerb(Message message)
    {
        EndPoint from = message.getFrom();
        logger_.trace("Received a GossipDigestAck2Message from " + from);

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );
        GossipDigestAck2Message gDigestAck2Message = null;
View Full Code Here

                logger_.debug("Merging the counting bloom filter in the sampler ...");               
                String[] peices = FBUtilities.strip(fileName, "-");
                Table.open(peices[0]).getColumnFamilyStore(peices[1]).addToList(streamContext.getTargetFile());               
            }
           
            EndPoint to = new EndPoint(host, DatabaseDescriptor.getStoragePort());
            logger_.debug("Sending a bootstrap terminate message with " + streamStatus + " to " + to);
            /* Send a StreamStatusMessage object which may require the source node to re-stream certain files. */
            StreamContextManager.StreamStatusMessage streamStatusMessage = new StreamContextManager.StreamStatusMessage(streamStatus);
            Message message = StreamContextManager.StreamStatusMessage.makeStreamStatusMessage(streamStatusMessage);
            MessagingService.getMessagingInstance().sendOneWay(message, to);          
View Full Code Here

TOP

Related Classes of org.apache.cassandra.net.EndPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.