Package org.apache.cassandra.io

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


        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


        {
            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

        reader_.next(bufOut);

        if ( bufOut.getLength() > 0 )
        {
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(bufOut.getData(), bufOut.getLength());
            /*
             * This buffer contains key and value so we need to strip
             * certain parts
           */
            // read the key
View Full Code Here

    public static RangeCommand read(Message message) throws IOException
    {
        byte[] bytes = message.getMessageBody();
        DataInputBuffer dib = new DataInputBuffer();
        dib.reset(bytes, bytes.length);
        return serializer.deserialize(new DataInputStream(dib));
    }

    public String toString()
    {
View Full Code Here

    }

    public static RangeReply read(byte[] body) throws IOException
    {
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(body, body.length);

        List<String> keys = new ArrayList<String>();
        while (bufIn.getPosition() < body.length)
        {
            keys.add(bufIn.readUTF());
View Full Code Here

   
    public void doVerb(Message message)
    {         
        byte[] body = message.getMessageBody();
        DataInputBuffer buffer = new DataInputBuffer();
        buffer.reset(body, body.length);       
       
        try
        {
            RowMutationMessage rmMsg = RowMutationMessage.serializer().deserialize(buffer);
            RowMutation rm = rmMsg.getRowMutation();
View Full Code Here

               
                while ( !reader_.isEOF() )
                {
                    /* Read the metadata info. */
                    reader_.next(bufOut);
                    bufIn.reset(bufOut.getData(), bufOut.getLength());

                    /* The key is the table name */
                    bufIn.readUTF();
                    /* read the size of the data we ignore this value */
                    bufIn.readInt();
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

        public void doVerb(Message message)
        {
            byte[] body = message.getMessageBody();
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(body, body.length);

            try
            {
                StreamContextManager.StreamStatusMessage streamStatusMessage = StreamContextManager.StreamStatusMessage.serializer().deserialize(bufIn);
                StreamContextManager.StreamStatus streamStatus = streamStatusMessage.getStreamStatus();
View Full Code Here

            IFileReader reader = SequenceFile.reader(file.getAbsolutePath());
            try
            {
                reader.readDirect(header);
                /* deserialize the commit log header */
                bufIn.reset(header, 0, header.length);
                CommitLogHeader clHeader = CommitLogHeader.serializer().deserialize(bufIn);
                /* seek to the lowest position */
                int lowPos = CommitLogHeader.getLowestPosition(clHeader);
                /*
                 * If lowPos == 0 then we need to skip the processing of this
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.