Package org.voltcore.utils.DBBPool

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


            assertEquals(1024 * 1024 * 2 * 97, m_pbd.sizeInBytes());

            BBContainer retval2 = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            try {
                buffer2.clear();
                assertEquals(retval2.b(), buffer2);
                assertEquals(1024 * 1024 * 2 * 96, m_pbd.sizeInBytes());


                //Expect the file for the two polled objects to still be there
                //until the discard
View Full Code Here


        ByteBuffer defaultBuffer = defaultBuffer();
        //Now poll the rest and make sure the data is correct
        for (int ii = 0; ii < 96; ii++) {
            defaultBuffer.clear();
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
        }

        assertEquals( 0, m_pbd.sizeInBytes());
        assertTrue(m_pbd.isEmpty());
View Full Code Here

        ByteBuffer defaultBuffer = defaultBuffer();
        //Now poll all of it and make sure the data is correct
        for (int ii = 0; ii < 96; ii++) {
            defaultBuffer.clear();
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
        }

        //Expect just the current write segment
        TreeSet<String> names = getSortedDirectoryListing();
View Full Code Here

        pbd = new PersistentBinaryDeque("ha.ha", TEST_DIR);
        BBContainer bb = pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
        try {
            ByteBuffer defaultBuffer = defaultBuffer();
            defaultBuffer.clear();
            assertEquals(defaultBuffer, bb.b());
            pbd.close();
        } finally {
            bb.discard();
        }
    }
View Full Code Here

        //Now poll all of it and make sure the data is correct
        for (int ii = 0; ii < 192; ii++) {
            ByteBuffer defaultBuffer = getFilledBuffer(ii);
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
            defaultBuffer.clear();
        }

        //Expect just the current write segment
View Full Code Here

        small_pbd = new PersistentBinaryDeque(SMALL_TEST_NONCE, TEST_DIR);
        //Now poll all of it and make sure the data is correct dont poll everything out.
        for (int ii = 0; ii < 10; ii++) {
            ByteBuffer defaultBuffer = getFilledSmallBuffer(ii);
            BBContainer retval = small_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
            defaultBuffer.clear();
        }
        small_pbd.sync();
        small_pbd.close();
View Full Code Here

        //Now poll half of it and make sure the data is correct
        for (int ii = 0; ii < 96; ii++) {
            ByteBuffer defaultBuffer = getFilledBuffer(ii);
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
            defaultBuffer.clear();
        }
        m_pbd.sync();
        m_pbd.close();
View Full Code Here

        assertEquals(cnt, 192);
        //Now poll half of it and make sure the data is correct
        for (int ii = 96; ii < 192; ii++) {
            ByteBuffer defaultBuffer = getFilledBuffer(ii);
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
            defaultBuffer.clear();
        }
        //Expect just the current write segment
        names = getSortedDirectoryListing();
View Full Code Here

        //Poll and leave one behind.
        for (int ii = 96; ii < 191; ii++) {
            ByteBuffer defaultBuffer = getFilledBuffer(ii);
            BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
            assertTrue(defaultBuffer.equals(retval.b()));
            retval.discard();
            defaultBuffer.clear();
        }
        //Expect just the current write segment
        names = getSortedDirectoryListing();
View Full Code Here

                        return null;
                    }
                    try {
                        int totalWritten = 0;

                        final ByteBuffer dataBuf = data.b();
                        DefaultSnapshotDataTarget.enforceSnapshotRateLimit(dataBuf.remaining());

                        while (dataBuf.hasRemaining()) {
                            int written = m_fc.write(dataBuf);
                            if (written > 0) {
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.