Package org.voltcore.utils.DBBPool

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


                next = DBBPool.allocateDirect(newCapacity);
            } else {
                next = DBBPool.wrapBB(ByteBuffer.allocate(newCapacity));
            }
            buffer.b().flip();
            next.b().put(buffer.b());
            assert next.b().remaining() == newRemaining;
            buffer.discard();
            buffer = next;
            if (callback != null) callback.onBufferGrow(this);
            assert(buffer.b().order() == ByteOrder.BIG_ENDIAN);
View Full Code Here


            } else {
                next = DBBPool.wrapBB(ByteBuffer.allocate(newCapacity));
            }
            buffer.b().flip();
            next.b().put(buffer.b());
            assert next.b().remaining() == newRemaining;
            buffer.discard();
            buffer = next;
            if (callback != null) callback.onBufferGrow(this);
            assert(buffer.b().order() == ByteOrder.BIG_ENDIAN);
        }
View Full Code Here

        }

        for (long ii = 0; ii < 96; ii++) {
            BBContainer cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertNotNull(cont);
            assertEquals(cont.b().remaining(), 1024 * 1024 * 2);
            while (cont.b().remaining() > 15) {
                assertEquals(cont.b().getLong(), ii);
                cont.b().getLong();
            }
            cont.discard();
View Full Code Here

        for (long ii = 0; ii < 96; ii++) {
            BBContainer cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertNotNull(cont);
            assertEquals(cont.b().remaining(), 1024 * 1024 * 2);
            while (cont.b().remaining() > 15) {
                assertEquals(cont.b().getLong(), ii);
                cont.b().getLong();
            }
            cont.discard();
        }
View Full Code Here

        for (long ii = 0; ii < 96; ii++) {
            BBContainer cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertNotNull(cont);
            assertEquals(cont.b().remaining(), 1024 * 1024 * 2);
            while (cont.b().remaining() > 15) {
                assertEquals(cont.b().getLong(), ii);
                cont.b().getLong();
            }
            cont.discard();
        }
    }
View Full Code Here

            BBContainer cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertNotNull(cont);
            assertEquals(cont.b().remaining(), 1024 * 1024 * 2);
            while (cont.b().remaining() > 15) {
                assertEquals(cont.b().getLong(), ii);
                cont.b().getLong();
            }
            cont.discard();
        }
    }

View Full Code Here

        long blocksFound = 0;
        BBContainer cont = null;
        while ((cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY)) != null) {
            try {
                ByteBuffer buffer = cont.b();
                if (blocksFound == 45) {
                    blocksFound++;//white lie, so we expect the right block contents
                }
                assertEquals(buffer.remaining(), 1024 * 1024 * 2);
                while (buffer.remaining() > 15) {
View Full Code Here

        long blocksFound = 0;
        BBContainer cont = null;
        while ((cont = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY)) != null) {
            try {
                ByteBuffer buffer = cont.b();
                if (blocksFound == 45) {
                    assertEquals(buffer.remaining(), 1024 * 1024);
                } else {
                    assertEquals(buffer.remaining(), 1024 * 1024 * 2);
                }
View Full Code Here

        //Poll the two at the front and check that the contents are what is expected
        BBContainer retval1 = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
        try {
            buffer1.clear();
            System.err.println(Long.toHexString(buffer1.getLong(0)) + " " + Long.toHexString(retval1.b().getLong(0)));
            assertEquals(retval1.b(), buffer1);
            assertEquals(1024 * 1024 * 2 * 97, m_pbd.sizeInBytes());

            BBContainer retval2 = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            try {
View Full Code Here

        //Poll the two at the front and check that the contents are what is expected
        BBContainer retval1 = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
        try {
            buffer1.clear();
            System.err.println(Long.toHexString(buffer1.getLong(0)) + " " + Long.toHexString(retval1.b().getLong(0)));
            assertEquals(retval1.b(), buffer1);
            assertEquals(1024 * 1024 * 2 * 97, m_pbd.sizeInBytes());

            BBContainer retval2 = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            try {
                buffer2.clear();
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.