Package org.apache.cassandra.net

Examples of org.apache.cassandra.net.Message


    class MoveMessageVerbHandler implements IVerbHandler
    {
        public void doVerb(Message message)
        {
            Message reply = message.getReply(StorageService.getLocalStorageEndPoint(), new Object[]{isMoveable_.get()});
            MessagingService.getMessagingInstance().sendOneWay(reply, message.getFrom());
            if ( isMoveable_.get() )
            {
                MoveMessage moveMessage = (MoveMessage)message.getMessageBody()[0];
                BigInteger targetToken = moveMessage.getTargetToken();
View Full Code Here


  {
    logger_.debug(" Run the consistency checks for " + columnFamily_);   
        ReadCommand readCommandDigestOnly = constructReadMessage(true);
    try
    {
      Message messageDigestOnly = readCommandDigestOnly.makeReadMessage();
      IAsyncCallback digestResponseHandler = new DigestResponseHandler();
      MessagingService.getMessagingInstance().sendRR(messageDigestOnly, replicas_.toArray(new EndPoint[0]), digestResponseHandler);
    }
    catch ( IOException ex )
    {
View Full Code Here

            replicas_.add(StorageService.getLocalStorageEndPoint());
      IAsyncCallback responseHandler = new DataRepairHandler(ConsistencyManager.this.replicas_.size(), readResponseResolver)
      String table = DatabaseDescriptor.getTables().get(0);
            ReadCommand readCommand = constructReadMessage(false);
      // ReadMessage readMessage = new ReadMessage(table, row_.key(), columnFamily_);
            Message message = readCommand.makeReadMessage();
      MessagingService.getMessagingInstance().sendRR(message, replicas_.toArray( new EndPoint[0] ), responseHandler);     
    }
View Full Code Here

        Set<EndPoint> allMbrs = Gossiper.instance().getAllMembers();               
        /* Send the script to all mbrs to deploy it locally. */
        CalloutDeployMessage cdMessage = new CalloutDeployMessage(callout, script);
        try
        {
            Message message = CalloutDeployMessage.getCalloutDeployMessage(cdMessage);
            for ( EndPoint mbr : allMbrs )
            {
                if ( mbr.equals( StorageService.getLocalControlEndPoint() ) )
                {
                    /* Deploy locally */
 
View Full Code Here

     * may be hints.
     */
    private static Map<EndPoint, Message> createWriteMessages(RowMutation rm, Map<EndPoint, EndPoint> endpointMap) throws IOException
    {
    Map<EndPoint, Message> messageMap = new HashMap<EndPoint, Message>();
    Message message = rm.makeRowMutationMessage();

    for (Map.Entry<EndPoint, EndPoint> entry : endpointMap.entrySet())
    {
            EndPoint target = entry.getKey();
            EndPoint hint = entry.getValue();
            if ( !target.equals(hint) )
      {
        Message hintedMessage = rm.makeRowMutationMessage();
        hintedMessage.addHeader(RowMutation.HINT, EndPoint.toBytes(hint) );
        logger_.debug("Sending the hint of " + target.getHost() + " to " + hint.getHost());
        messageMap.put(target, hintedMessage);
      }
      else
      {
View Full Code Here

    {
        assert rm.key() != null;

        try
        {
            Message message = rm.makeRowMutationMessage();

            IResponseResolver<Boolean> writeResponseResolver = new WriteResponseResolver();
            QuorumResponseHandler<Boolean> quorumResponseHandler = new QuorumResponseHandler<Boolean>(
                    DatabaseDescriptor.getReplicationFactor(),
                    writeResponseResolver);
View Full Code Here

    {
        Map<String, Message> messages = new HashMap<String, Message>();
        Set<String> keys = readMessages.keySet();       
        for ( String key : keys )
        {
            Message message = readMessages.get(key).makeReadMessage();
            messages.put(key, message);
        }       
        return messages;
    }
View Full Code Here

    private static Row weakReadRemote(ReadCommand command) throws IOException
    {
        EndPoint endPoint = StorageService.instance().findSuitableEndPoint(command.key);
        assert endPoint != null;
        logger_.debug("weakreadremote reading " + command + " from " + endPoint);
        Message message = command.makeReadMessage();
        message.addHeader(ReadCommand.DO_REPAIR, ReadCommand.DO_REPAIR.getBytes());
        IAsyncResult iar = MessagingService.getMessagingInstance().sendRR(message, endPoint);
        byte[] body;
        try
        {
            Object[] result = iar.get(DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS);
View Full Code Here

            touch_local(tablename, key, fData);
            return;
          }
            TouchMessage touchMessage = null;
            touchMessage = new TouchMessage(tablename, key, fData);
            Message message = TouchMessage.makeTouchMessage(touchMessage);
            MessagingService.getMessagingInstance().sendOneWay(message, endPoint);
      }
      return ;
    }
View Full Code Here

    {
        Map<EndPoint, EndPoint> endpointMap = StorageService.instance().getNStorageEndPointMap(key);
        Set<EndPoint> endpoints = endpointMap.keySet();
        TouchMessage touchMessage = null;
        touchMessage = new TouchMessage(tablename, key, fData);
        Message message = TouchMessage.makeTouchMessage(touchMessage);
        for(EndPoint endpoint : endpoints)
        {
            MessagingService.getMessagingInstance().sendOneWay(message, endpoint);
        }     
    }
View Full Code Here

TOP

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

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.