Package org.apache.cassandra.net

Examples of org.apache.cassandra.net.Message


        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream( bos );
        RowMutationMessage.serializer().serialize(rowMutationMessage, dos);
        EndPoint local = StorageService.getLocalStorageEndPoint();
        EndPoint from = ( local != null ) ? local : new EndPoint(FBUtilities.getHostName(), 7000);
        Message message = new Message(from, StorageService.mutationStage_, verbHandlerName, new Object[]{bos.toByteArray()});        
        return message;
    }
View Full Code Here


       
        public void run()
        {
          if( rmsg_ != null )
          {
        Message message = new Message(from_ , StorageService.mutationStage_,
            StorageService.loadVerbHandler_, new Object[] { rmsg_ });
        MessagingService.getMessagingInstance().sendOneWay(message, to_);
          }
         
         }
View Full Code Here

    }

    private void handleRequest(HttpRequest request)
    {
        HttpConnection.HttpRequestMessage httpRequestMessage = new HttpConnection.HttpRequestMessage(request, this);
        Message httpMessage = new Message(null, HttpConnection.httpStage_, HttpConnection.httpRequestVerbHandler_, new Object[]{httpRequestMessage});
        MessagingService.receive(httpMessage);
    }
View Full Code Here

    public static Message makeBootstrapInitiateMessage(BootstrapInitiateMessage biMessage) throws IOException
    {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream( bos );
        BootstrapInitiateMessage.serializer().serialize(biMessage, dos);
        return new Message( StorageService.getLocalStorageEndPoint(), "", StorageService.bootStrapInitiateVerbHandler_, new Object[]{bos.toByteArray()} );
    }
View Full Code Here

    public Message makeReadMessage() throws IOException
    {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        ReadCommand.serializer().serialize(this, dos);
        return new Message(StorageService.getLocalStorageEndPoint(), StorageService.readStage_, StorageService.readVerbHandler_, bos.toByteArray());
    }
View Full Code Here

        {
            /* Set up the stream manager with the files that need to streamed */
            StreamManager.instance(target).addFilesToStream(streamContexts);
            /* Send the bootstrap initiate message */
            BootstrapInitiateMessage biMessage = new BootstrapInitiateMessage(streamContexts);
            Message message = BootstrapInitiateMessage.makeBootstrapInitiateMessage(biMessage);
            logger_.debug("Sending a bootstrap initiate message to " + target + " ...");
            MessagingService.getMessagingInstance().sendOneWay(message, target);               
            logger_.debug("Waiting for transfer to " + target + " to complete");
            StreamManager.instance(target).waitForStreamCompletion();
            logger_.debug("Done with transfer to " + target)
View Full Code Here

                bsmdList.add(bsMetadata);
            }
           
            BootstrapMetadataMessage bsMetadataMessage = new BootstrapMetadataMessage(bsmdList.toArray( new BootstrapMetadata[0] ) );
            /* Send this message to the source to do his shit. */
            Message message = BootstrapMetadataMessage.makeBootstrapMetadataMessage(bsMetadataMessage);
            logger_.debug("Sending the BootstrapMetadataMessage to " + source);
            MessagingService.getMessagingInstance().sendOneWay(message, source);
        }
    }
View Full Code Here

    protected static Message makeBootstrapMetadataMessage(BootstrapMetadataMessage bsMetadataMessage) throws IOException
    {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream( bos );
        BootstrapMetadataMessage.serializer().serialize(bsMetadataMessage, dos);
        return new Message( StorageService.getLocalStorageEndPoint(), "", StorageService.bsMetadataVerbHandler_, new Object[]{bos.toByteArray()} );           
    }       
View Full Code Here

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        serializer().serialize(this, dos);
        EndPoint local = StorageService.getLocalStorageEndPoint();
        EndPoint from = (local != null) ? local : new EndPoint(FBUtilities.getHostName(), 7000);
        return new Message(from, StorageService.mutationStage_, verbHandlerName, bos.toByteArray());
    }
View Full Code Here

       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        MembershipCleanerMessage.serializer().serialize(mcMessage, dos);
        /* Construct the token update message to be sent */
        Message mbrshipCleanerMessage = new Message( new EndPoint(FBUtilities.getHostName(), port_), "", StorageService.mbrshipCleanerVerbHandler_, new Object[]{bos.toByteArray()} );
       
        BufferedReader bufReader = new BufferedReader( new InputStreamReader( new FileInputStream(file) ) );
        String line = null;
      
        while ( ( line = bufReader.readLine() ) != null )
        {           
            mbrshipCleanerMessage.addHeader(line, line.getBytes());
        }
       
        System.out.println("Sending a membership clean message to " + target);
        MessagingService.getMessagingInstance().sendOneWay(mbrshipCleanerMessage, target);
        Thread.sleep(MembershipCleaner.waitTime_);
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.