Package org.apache.cassandra.utils

Examples of org.apache.cassandra.utils.PureJavaCrc32.updateInt()


            // write previous sync marker to point to next sync marker
            // we don't chain the crcs here to ensure this method is idempotent if it fails
            int offset = lastSyncedOffset;
            final PureJavaCrc32 crc = new PureJavaCrc32();
            crc.updateInt((int) (id & 0xFFFFFFFFL));
            crc.updateInt((int) (id >>> 32));
            crc.updateInt(offset);
            buffer.putInt(offset, nextMarker);
            buffer.putInt(offset + 4, crc.getCrc());
View Full Code Here


            // write previous sync marker to point to next sync marker
            // we don't chain the crcs here to ensure this method is idempotent if it fails
            int offset = lastSyncedOffset;
            final PureJavaCrc32 crc = new PureJavaCrc32();
            crc.updateInt((int) (id & 0xFFFFFFFFL));
            crc.updateInt((int) (id >>> 32));
            crc.updateInt(offset);
            buffer.putInt(offset, nextMarker);
            buffer.putInt(offset + 4, crc.getCrc());

            // zero out the next sync marker so replayer can cleanly exit
View Full Code Here

            // we don't chain the crcs here to ensure this method is idempotent if it fails
            int offset = lastSyncedOffset;
            final PureJavaCrc32 crc = new PureJavaCrc32();
            crc.updateInt((int) (id & 0xFFFFFFFFL));
            crc.updateInt((int) (id >>> 32));
            crc.updateInt(offset);
            buffer.putInt(offset, nextMarker);
            buffer.putInt(offset + 4, crc.getCrc());

            // zero out the next sync marker so replayer can cleanly exit
            if (nextMarker < buffer.capacity())
View Full Code Here

    static void writeHeader(ByteBuffer out, CommitLogDescriptor descriptor)
    {
        out.putInt(0, descriptor.version);
        out.putLong(4, descriptor.id);
        PureJavaCrc32 crc = new PureJavaCrc32();
        crc.updateInt(descriptor.version);
        crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL));
        crc.updateInt((int) (descriptor.id >>> 32));
        out.putInt(12, crc.getCrc());
    }
View Full Code Here

    {
        out.putInt(0, descriptor.version);
        out.putLong(4, descriptor.id);
        PureJavaCrc32 crc = new PureJavaCrc32();
        crc.updateInt(descriptor.version);
        crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL));
        crc.updateInt((int) (descriptor.id >>> 32));
        out.putInt(12, crc.getCrc());
    }

    public static CommitLogDescriptor fromHeader(File file)
View Full Code Here

        out.putInt(0, descriptor.version);
        out.putLong(4, descriptor.id);
        PureJavaCrc32 crc = new PureJavaCrc32();
        crc.updateInt(descriptor.version);
        crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL));
        crc.updateInt((int) (descriptor.id >>> 32));
        out.putInt(12, crc.getCrc());
    }

    public static CommitLogDescriptor fromHeader(File file)
    {
View Full Code Here

            assert raf.getFilePointer() == 0;
            int version = raf.readInt();
            long id = raf.readLong();
            int crc = raf.readInt();
            PureJavaCrc32 checkcrc = new PureJavaCrc32();
            checkcrc.updateInt(version);
            checkcrc.updateInt((int) (id & 0xFFFFFFFFL));
            checkcrc.updateInt((int) (id >>> 32));
            if (crc == checkcrc.getCrc())
                return new CommitLogDescriptor(version, id);
            return null;
View Full Code Here

            int version = raf.readInt();
            long id = raf.readLong();
            int crc = raf.readInt();
            PureJavaCrc32 checkcrc = new PureJavaCrc32();
            checkcrc.updateInt(version);
            checkcrc.updateInt((int) (id & 0xFFFFFFFFL));
            checkcrc.updateInt((int) (id >>> 32));
            if (crc == checkcrc.getCrc())
                return new CommitLogDescriptor(version, id);
            return null;
        }
View Full Code Here

            long id = raf.readLong();
            int crc = raf.readInt();
            PureJavaCrc32 checkcrc = new PureJavaCrc32();
            checkcrc.updateInt(version);
            checkcrc.updateInt((int) (id & 0xFFFFFFFFL));
            checkcrc.updateInt((int) (id >>> 32));
            if (crc == checkcrc.getCrc())
                return new CommitLogDescriptor(version, id);
            return null;
        }
        catch (EOFException e)
View Full Code Here

    static void writeHeader(ByteBuffer out, CommitLogDescriptor descriptor)
    {
        out.putInt(0, descriptor.version);
        out.putLong(4, descriptor.id);
        PureJavaCrc32 crc = new PureJavaCrc32();
        crc.updateInt(descriptor.version);
        crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL));
        crc.updateInt((int) (descriptor.id >>> 32));
        out.putInt(12, crc.getCrc());
    }
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.