Package org.voltcore.utils.DBBPool

Examples of org.voltcore.utils.DBBPool.BBContainer.b()


            buffers = new IOBuffers(buffers.input, output);
            m_buffers.set(buffers);
        }
        output.b().clear();

        final int actualUncompressedLength = Snappy.uncompress(compressed, output.b());
        assert(uncompressedLength == actualUncompressedLength);

        byte result[] = new byte[actualUncompressedLength];
        output.b().get(result);
        return result;
View Full Code Here


        final int actualUncompressedLength = Snappy.uncompress(compressed, output.b());
        assert(uncompressedLength == actualUncompressedLength);

        byte result[] = new byte[actualUncompressedLength];
        output.b().get(result);
        return result;
    }

    public static int maxCompressedLength(int uncompressedSize) {
        return Snappy.maxCompressedLength(uncompressedSize);
View Full Code Here

        inputBuffer.clear();
        inputBuffer.put(bytes);
        inputBuffer.flip();

        final int uncompressedLength = Snappy.uncompressedLength(inputBuffer);
        final int outputCapacity = output.b().capacity();
        if (outputCapacity < uncompressedLength) {
            output.discard();
            output = DBBPool.allocateDirect(Math.max(outputCapacity * 2, uncompressedLength));
            buffers = new IOBuffers(input, output);
            m_buffers.set(buffers);
View Full Code Here

            output.discard();
            output = DBBPool.allocateDirect(Math.max(outputCapacity * 2, uncompressedLength));
            buffers = new IOBuffers(input, output);
            m_buffers.set(buffers);
        }
        final ByteBuffer outputBuffer = output.b();
        outputBuffer.clear();

        final int actualUncompressedLength = Snappy.uncompress(inputBuffer, outputBuffer);
        assert(uncompressedLength == actualUncompressedLength);

View Full Code Here

                    return;
                }

                try {
                    final VoltTable vt = PrivateVoltTableFactory
                            .createVoltTableFromBuffer(c.b(), true);
                    Pair<Integer, byte[]> p = VoltTableUtil.toCSV( vt, m_delimiter, null, lastNumCharacters);
                    lastNumCharacters = p.getFirst();
                    byte csvBytes[] = p.getSecond();
                    m_availableBytes.addAndGet(csvBytes.length);
                    m_available.offer(csvBytes);
View Full Code Here

        Random r = new Random(seed);
        System.out.println("Seed is " + seed);
        EELibraryLoader.loadExecutionEngineLibrary(true);
        BBContainer c = DBBPool.allocateDirect(4096);
        try {
            c.b().order(ByteOrder.LITTLE_ENDIAN);

            for (int ii = 0; ii < iterations; ii++) {
                int bytesToFill = r.nextInt(maxLength + 1);
                byte bytes[] = new byte[bytesToFill];
                r.nextBytes(bytes);
View Full Code Here

            for (int ii = 0; ii < iterations; ii++) {
                int bytesToFill = r.nextInt(maxLength + 1);
                byte bytes[] = new byte[bytesToFill];
                r.nextBytes(bytes);
                c.b().clear();
                c.b().put(bytes);
                c.b().flip();

                long nativeHash = DBBPool.getMurmur3128(c.address(), 0, bytesToFill);
                long javaHash =  MurmurHash3.hash3_x64_128(c.b(), 0, bytesToFill, 0);
View Full Code Here

            for (int ii = 0; ii < iterations; ii++) {
                int bytesToFill = r.nextInt(maxLength + 1);
                byte bytes[] = new byte[bytesToFill];
                r.nextBytes(bytes);
                c.b().clear();
                c.b().put(bytes);
                c.b().flip();

                long nativeHash = DBBPool.getMurmur3128(c.address(), 0, bytesToFill);
                long javaHash =  MurmurHash3.hash3_x64_128(c.b(), 0, bytesToFill, 0);
                if (nativeHash != javaHash) {
View Full Code Here

                int bytesToFill = r.nextInt(maxLength + 1);
                byte bytes[] = new byte[bytesToFill];
                r.nextBytes(bytes);
                c.b().clear();
                c.b().put(bytes);
                c.b().flip();

                long nativeHash = DBBPool.getMurmur3128(c.address(), 0, bytesToFill);
                long javaHash =  MurmurHash3.hash3_x64_128(c.b(), 0, bytesToFill, 0);
                if (nativeHash != javaHash) {
                    fail("Failed in iteration " + ii + " native hash " + Long.toHexString(nativeHash) +
View Full Code Here

                c.b().clear();
                c.b().put(bytes);
                c.b().flip();

                long nativeHash = DBBPool.getMurmur3128(c.address(), 0, bytesToFill);
                long javaHash =  MurmurHash3.hash3_x64_128(c.b(), 0, bytesToFill, 0);
                if (nativeHash != javaHash) {
                    fail("Failed in iteration " + ii + " native hash " + Long.toHexString(nativeHash) +
                            " java hash " + Long.toHexString(javaHash) +" with bytes " + Encoder.base64Encode(bytes));
                }
            }
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.