Package org.voltcore.utils.DBBPool

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


        //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
        TreeSet<String> names = getSortedDirectoryListing();
View Full Code Here


        //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();
        small_pbd = null;
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();
        m_pbd = null;
View Full Code Here

        //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();
        assertEquals(3, names.size());
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();
        assertEquals(1, names.size());
View Full Code Here

        names = getSortedDirectoryListing();
        assertEquals(4, names.size());
        assertTrue(names.first().equals("pbd_nonce.5.pbd"));

        BBContainer retval = m_pbd.poll(PersistentBinaryDeque.UNSAFE_CONTAINER_FACTORY);
        retval.discard();
        names = getSortedDirectoryListing();
        assertEquals(3, names.size());
        assertTrue(names.first().equals("pbd_nonce.6.pbd"));

    }
View Full Code Here

                    /*
                     * If a filter nulled out the buffer do nothing.
                     */
                    if (data == null) return null;
                    if (m_writeFailed) {
                        data.discard();
                        return null;
                    }
                    try {
                        int totalWritten = 0;

View Full Code Here

                        if (m_bytesSinceLastSync.addAndGet(totalWritten) > m_bytesAllowedBeforeSync) {
                            m_fc.force(false);
                            m_bytesSinceLastSync.set(0);
                        }
                    } finally {
                        data.discard();
                    }
                } catch (Throwable t) {
                    m_writeException = t;
                    m_writeFailed = true;
                    throw Throwables.propagate(t);
View Full Code Here

            assertEquals( RecoveryMessageType.Complete.ordinal(), container.b().get());
            assertEquals( STOCK_TABLEID, container.b().getInt());

            assertEquals( sourceEngine.tableHashCode(STOCK_TABLEID), destinationEngine.get().tableHashCode(STOCK_TABLEID));
        } finally {
            container.discard();
        }
    }

    private int warehouseTableId(Catalog catalog) {
        return catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("WAREHOUSE").getRelativeIndex();
View Full Code Here

        try {
            List<BBContainer> output = new ArrayList<BBContainer>();
            output.add(container);
            assertEquals(0, sourceEngine.tableStreamSerializeMore(STOCK_TABLEID, TableStreamType.ELASTIC_INDEX, output).getSecond()[0]);
        } finally {
            container.discard();
        }
    }


    private ExecutionEngine sourceEngine;
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.