Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.DataInputBuffer.reset()


            {
                bufOut.reset();
                /* Record the position of the key. */
                long blockIndexOffset = dataReader.getCurrentPosition();
                dataReader.next(bufOut);
                bufIn.reset(bufOut.getData(), bufOut.getLength());
                /* Key just read */
                String key = bufIn.readUTF();
                if ( key.equals(SSTable.blockIndexKey_) )
                {
                    /* Ignore the size of the data associated with the block index */
 
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

        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

      {
            while ( !dataReader.isEOF() )
            {
                bufOut.reset();
                dataReader.next(bufOut);
                bufIn.reset(bufOut.getData(), bufOut.getLength());
                /* Key just read */
                String key = bufIn.readUTF();
                /* check if we want this key */
                if ( key.equals(keyToExtract) )
                {
View Full Code Here

    public void doVerb(Message message)
    {
        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

        BufferedRandomAccessFile fis = new BufferedRandomAccessFile("C:\\Engagements\\buff.dat", "r", 4*1024*1024);
        IndexHelper.skipBloomFilterAndIndex(fis);
        byte[] bytes = new byte[(int)(fis.length() - fis.getFilePointer())];
        fis.readFully(bytes);
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(bytes, bytes.length);
       
        ColumnFamily cf = ColumnFamily.serializer().deserialize(bufIn);       
        Collection<IColumn> columns = cf.getAllColumns();      
        System.out.println(columns.size());
        for ( IColumn column : columns )
View Full Code Here

    {
      DataInputBuffer bufIn = new DataInputBuffer();
      for( Message response : responses_ )
      {
        byte[] body = response.getMessageBody();           
              bufIn.reset(body, body.length);
              try
              {                
                  ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
                  byte[] digest = result.digest();
                  if( !Arrays.equals(row_.digest(), digest) )
View Full Code Here

                catch (EOFException e)
                {
                    // last CL entry didn't get completely written.  that's ok.
                    break;
                }
                bufIn.reset(bytes, bytes.length);

                /* read the commit log entry */
                Row row = Row.serializer().deserialize(bufIn);
                if (logger_.isDebugEnabled())
                    logger_.debug(String.format("replaying mutation for %s.%s: %s",
View Full Code Here

    {
      DataInputBuffer bufIn = new DataInputBuffer();
      for( Message response : responses_ )
      {
        byte[] body = response.getMessageBody();           
              bufIn.reset(body, body.length);
              try
              {                
                  ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
                  byte[] digest = result.digest();
                  if( !Arrays.equals(row_.digest(), digest) )
View Full Code Here

        */
        public void doVerb(Message message)
        {
            byte[] body = message.getMessageBody();
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);
           
            try
            {
                BootstrapInitiateMessage biMsg = BootstrapInitiateMessage.serializer().deserialize(bufIn);
                StreamContextManager.StreamContext[] streamContexts = biMsg.getStreamContext();               
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.