Package org.apache.cassandra.io.util

Examples of org.apache.cassandra.io.util.ByteBufferOutputStream


        allocator.allocate(mutation, (int) totalSize, alloc);
        try
        {
            PureJavaCrc32 checksum = new PureJavaCrc32();
            final ByteBuffer buffer = alloc.getBuffer();
            DataOutputStream dos = new DataOutputStream(new ChecksummedOutputStream(new ByteBufferOutputStream(buffer), checksum));

            // checksummed length
            dos.writeInt((int) size);
            buffer.putLong(checksum.getValue());
View Full Code Here


    public ByteBuffer serialize()
    {
        try
        {
            ByteBuffer result = ByteBuffer.allocate(serializedSize());
            DataOutput out = new DataOutputStream(new ByteBufferOutputStream(result));
            ByteBufferUtil.writeWithShortLength(partitionKey, out);
            ByteBufferUtil.writeWithShortLength(cellName, out);
            out.writeInt(remaining);
            result.flip();
            return result;
View Full Code Here

            // Map the segment, extending or truncating it to the standard segment size
            logFileAccessor.setLength(DatabaseDescriptor.getCommitLogSegmentSize());

            buffer = logFileAccessor.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, DatabaseDescriptor.getCommitLogSegmentSize());
            checksum = new PureJavaCrc32();
            bufferStream = new DataOutputStream(new ChecksummedOutputStream(new ByteBufferOutputStream(buffer), checksum));
            buffer.putInt(CommitLog.END_OF_SEGMENT_MARKER);
            buffer.position(0);
            needsSync = true;
            sync();
        }
View Full Code Here

    public ByteBuffer serialize()
    {
        try
        {
            ByteBuffer result = ByteBuffer.allocate(serializedSize());
            DataOutput out = new DataOutputStream(new ByteBufferOutputStream(result));
            ByteBufferUtil.writeWithShortLength(partitionKey, out);
            ByteBufferUtil.writeWithShortLength(cellName, out);
            out.writeInt(remaining);
            result.flip();
            return result;
View Full Code Here

            // Map the segment, extending or truncating it to the standard segment size
            logFileAccessor.setLength(DatabaseDescriptor.getCommitLogSegmentSize());

            buffer = logFileAccessor.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, DatabaseDescriptor.getCommitLogSegmentSize());
            checksum = new PureJavaCrc32();
            bufferStream = new DataOutputStream(new ChecksummedOutputStream(new ByteBufferOutputStream(buffer), checksum));
            buffer.putInt(CommitLog.END_OF_SEGMENT_MARKER);
            buffer.position(0);

            needsSync = true;
        }
View Full Code Here

            // Map the segment, extending or truncating it to the standard segment size
            logFileAccessor.setLength(DatabaseDescriptor.getCommitLogSegmentSize());

            buffer = logFileAccessor.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, DatabaseDescriptor.getCommitLogSegmentSize());
            checksum = new PureJavaCrc32();
            bufferStream = new DataOutputStream(new ChecksummedOutputStream(new ByteBufferOutputStream(buffer), checksum));
            buffer.putInt(CommitLog.END_OF_SEGMENT_MARKER);
            buffer.position(0);
            needsSync = true;
            sync();
        }
View Full Code Here

    public ByteBuffer serialize()
    {
        try
        {
            ByteBuffer result = ByteBuffer.allocate(serializedSize());
            DataOutput out = new DataOutputStream(new ByteBufferOutputStream(result));
            ByteBufferUtil.writeWithShortLength(partitionKey, out);
            ByteBufferUtil.writeWithShortLength(cellName, out);
            out.writeInt(remaining);
            return result;
        }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.util.ByteBufferOutputStream

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.