Package org.apache.cassandra.io

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


            try
            {
                Map<String, Row> rows = new HashMap<String, Row>();
                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


                    bufOut.reset();
                    long bytesRead = reader.next(bufOut);
                    if ( bytesRead == -1 )
                        break;

                    bufIn.reset(bufOut.getData(), bufOut.getLength());
                    /* Skip over the commit log key portion */
                    bufIn.readUTF();
                    /* Skip over data size */
                    bufIn.readInt();
                   
View Full Code Here

        for ( File file : files )
        {
            CommitLog clog = new CommitLog( file );
            clog.readCommitLogHeader(file.getAbsolutePath(), bytes);
            DataInputBuffer bufIn = new DataInputBuffer();
            bufIn.reset(bytes, 0, bytes.length);
            CommitLogHeader clHeader = CommitLogHeader.serializer().deserialize(bufIn);
            /*
            StringBuilder sb = new StringBuilder("");
            for ( byte b : bytes )
            {
View Full Code Here

       
        FileInputStream fis = new FileInputStream("C:\\Engagements\\bf.dat");
        byte[] bytes = new byte[fis.available()];
        fis.read(bytes);
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(bytes, bytes.length );
        BloomFilter bf2 = BloomFilter.serializer().deserialize(bufIn);
       
        int count = 0;
        for ( int i = 0; i < 1024*1024; ++i )
        {
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

        */
        DataInputBuffer bufIn = new DataInputBuffer();
    for (Message response : responses)
    {                     
            byte[] body = response.getMessageBody();
            bufIn.reset(body, body.length);
            ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
            if (result.isDigestQuery())
            {
                digest = result.digest();
                isDigestQuery = true;
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())
                {
View Full Code Here

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

class SliceCommandSerializer implements ICompactSerializer<RangeSliceCommand>
View Full Code Here

            catch (TimeoutException e)
            {
                throw new TimedOutException();
            }
            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

            for (Message response : responses_)
            {
                try
                {
                    byte[] body = response.getMessageBody();
                    bufIn.reset(body, body.length);
                    ReadResponse result = ReadResponse.serializer().deserialize(bufIn);
                    byte[] digest = result.digest();
                    if (!Arrays.equals(row_.digest(), digest))
                    {
                        doReadRepair();
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.