Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.DataInputBuffer$Buffer


        return serializer;
    }
       
    public static BitSet and(byte[] bytes1, byte[] bytes2) throws IOException
    {
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(bytes1, 0, bytes1.length);
        CommitLogHeader header1 = serializer.deserialize(bufIn);
        bufIn.reset(bytes2, 0, bytes2.length);
        CommitLogHeader header2 = serializer.deserialize(bufIn);
        header1.and(header2);
        return header1.dirty;
    }
View Full Code Here


    public void doVerb(Message message)
    {
        if (logger_.isDebugEnabled())
          logger_.debug("Received a BootstrapMetadataMessage from " + message.getFrom());
        byte[] body = message.getMessageBody();
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(body, body.length);
        try
        {
            BootstrapMetadataMessage bsMetadataMessage = BootstrapMetadataMessage.serializer().deserialize(bufIn);
            BootstrapMetadata[] bsMetadata = bsMetadataMessage.bsMetadata_;
           
View Full Code Here

        IAsyncResult iar = dispatchMessages(endPoints, messages);       
        List<byte[]> results = iar.multiget(2*DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS);
       
        for ( byte[] body : results )
        {
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
            ReadResponse response = ReadResponse.serializer().deserialize(bufIn);
            Row row = response.row();
            rows.put(row.key(), row);
        }       
        return rows;
View Full Code Here

        catch (TimeoutException e)
        {
            throw new RuntimeException("error reading key " + command.key, e);
            // TODO retry to a different endpoint?
        }
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(body, body.length);
        ReadResponse response = ReadResponse.serializer().deserialize(bufIn);
        return response.row();
    }
View Full Code Here

    {
        byte[] body = message.getMessageBody();
       
        try
        {
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
            /* Deserialize to get the token for this endpoint. */
            MembershipCleaner.MembershipCleanerMessage mcMessage = MembershipCleaner.MembershipCleanerMessage.serializer().deserialize(bufIn);
           
            String target = mcMessage.getTarget();
            logger_.info("Removing the node [" + target + "] from membership");
View Full Code Here

    {
      byte[] body = message.getMessageBody();
       
        try
        {
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
            /* Deserialize to get the token for this endpoint. */
            Token token = Token.serializer().deserialize(bufIn);

            logger_.info("Updating the token to [" + token + "]");
            StorageService.instance().updateToken(token);
View Full Code Here

            catch (TimeoutException e)
            {
                throw new RuntimeException("error reading key " + commands.get(commandIndex).key, e);
                // TODO retry to a different endpoint?
            }
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
            ReadResponse response = ReadResponse.serializer().deserialize(bufIn);
            if (response.row() != null)
                rows.add(response.row());
            commandIndex++;
        }
View Full Code Here

     * Populate the list of rows from each of the messages
     * Check to see if there is a digest query. If a digest
         * query exists then we need to compare the digest with
         * the digest of the data that is received.
        */
        DataInputBuffer bufIn = new DataInputBuffer();
    for (Message response : responses)
    {                     
            byte[] body = response.getMessageBody();
            bufIn.reset(body, body.length);
            try
            {
                long start = System.currentTimeMillis();
                ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
                logger_.debug( "Response deserialization time : " + (System.currentTimeMillis() - start) + " ms.");
View Full Code Here

  {
    boolean isDataPresent = false;
    for (Message response : responses)
    {
            byte[] body = response.getMessageBody();
      DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
            try
            {
          ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
          if(!result.isDigestQuery())
          {
            isDataPresent = true;
          }
                bufIn.close();
            }
            catch(IOException ex)
            {
                logger_.info(LogUtil.throwableToString(ex));
            }                       
View Full Code Here

    private static Logger logger_ = Logger.getLogger(CalloutDeployVerbHandler.class);
   
    public void doVerb(Message message)
    {
        byte[] bytes = message.getMessageBody();
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(bytes, bytes.length);
        try
        {
            CalloutDeployMessage cdMessage = CalloutDeployMessage.serializer().deserialize(bufIn);
            /* save the callout to callout cache and to disk. */
            CalloutManager.instance().addCallout( cdMessage.getCallout(), cdMessage.getScript() );
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.DataInputBuffer$Buffer

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.