Package org.apache.hadoop_voltpatches.util

Examples of org.apache.hadoop_voltpatches.util.PureJavaCrc32C.update()


        pset = ParameterSet.fromArrayNoCopy(psetObjs);
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
        pset.flattenToBuffer(buf);
        crc.update(buf.array());
        long crc1 = crc.getValue();

        ArrayUtils.reverse(psetObjs);

        pset = ParameterSet.fromArrayNoCopy(psetObjs);
View Full Code Here


        pset = ParameterSet.fromArrayNoCopy(psetObjs);
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
        pset.flattenToBuffer(buf);
        crc.update(buf.array());
        long crc2 = crc.getValue();

        pset = ParameterSet.fromArrayNoCopy(new Object[0]);
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
View Full Code Here

        pset = ParameterSet.fromArrayNoCopy(new Object[0]);
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
        pset.flattenToBuffer(buf);
        crc.update(buf.array());
        long crc3 = crc.getValue();

        pset = ParameterSet.fromArrayNoCopy(new Object[] { 1 });
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
View Full Code Here

        pset = ParameterSet.fromArrayNoCopy(new Object[] { 1 });
        crc = new PureJavaCrc32C();
        buf = ByteBuffer.allocate(pset.getSerializedSize());
        pset.flattenToBuffer(buf);
        crc.update(buf.array());
        long crc4 = crc.getValue();

        assertNotSame(crc1, crc2);
        assertNotSame(crc1, crc3);
        assertNotSame(crc1, crc4);
View Full Code Here

        this.sqlText = sqlText;
        this.joinOrder = joinOrder;

        // create a hash for determinism purposes
        PureJavaCrc32C crc = new PureJavaCrc32C();
        crc.update(sqlText);
        // ugly hack to get bytes from an int
        this.sqlCRC = ByteBuffer.allocate(4).putInt((int) crc.getValue()).array();

        inCatalog = true;
    }
View Full Code Here

        for (int ii = 0; ii < 10000; ii++) {
            int nextLength = r.nextInt(4096);
            byte bytes[] = new byte[nextLength];
            r.nextBytes(bytes);
            PureJavaCrc32C checksum = new PureJavaCrc32C();
            checksum.update(bytes);
            int javaSum = (int)checksum.getValue();
            BBContainer cont = DBBPool.allocateDirect(nextLength);
            cont.b().put(bytes);
            int cSum = DBBPool.getCRC32C(cont.address(), 0, nextLength);
            cont.discard();
View Full Code Here

     * @param config configuration byte array
     * @return signature from the given configuration bytes
     */
    static public long computeConfigurationSignature(byte [] config) {
        PureJavaCrc32C crc = new PureJavaCrc32C();
        crc.update(config);
        return crc.getValue();
    }

    /**
     * Given an byte[] bytes, pick a partition to store the data.
View Full Code Here

                            /*
                             * Checksum the header and put it in the payload buffer
                             */
                            PureJavaCrc32C crc = new PureJavaCrc32C();
                            crc.update(lengthPrefix.array(), 0, 8);
                            lengthPrefix.putInt((int)crc.getValue());
                            lengthPrefix.flip();
                            payloadBuffer.put(lengthPrefix);
                            payloadBuffer.position(0);

View Full Code Here

                    assert(m_checksumType == ChecksumType.CRC32C);
                    final Checksum partitionIdCRC = new PureJavaCrc32C();
                    final int nextChunkPartitionId = chunkLengthB.getInt(4);
                    final int nextChunkPartitionIdCRC = chunkLengthB.getInt(8);

                    partitionIdCRC.update(chunkLengthB.array(), 0, 8);
                    int generatedValue = (int)partitionIdCRC.getValue();
                    if (generatedValue != nextChunkPartitionIdCRC) {
                        chunkLengthB.position(0);
                        for (int partitionId : m_partitionIds) {
                            m_corruptedPartitions.add(partitionId);
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.