Examples of sweep()


Examples of org.apache.jackrabbit.core.gc.GarbageCollector.sweep()

        gc.mark();
        gc.stopScan();
        if (all) {
            gc.getDataStore().clearInUse();
        }
        gc.sweep();
        gc.close();
    }

    private static int listIdentifiers(GarbageCollector gc) throws DataStoreException {
        LOG.debug("identifiers:");
View Full Code Here

Examples of org.apache.jackrabbit.core.gc.GarbageCollector.sweep()

        try {
            garbageCollector.getDataStore().clearInUse();
            garbageCollector.mark();
            garbageCollector.stopScan();
            sleepForFile();
            int numberOfDeleted = garbageCollector.sweep();
            log("Number of deleted: " + numberOfDeleted);
            // Binary data should still be there.
            assertEquals(1, getBinaryCount(garbageCollector));
        } catch (RepositoryException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.apache.jackrabbit.core.gc.GarbageCollector.sweep()

                LOG.debug("Scanning...");
                gc.mark();
                int count = listIdentifiers(gc);
                LOG.debug("Stop; currently " + count + " identifiers");
                gc.stopScan();
                int numDeleted = gc.sweep();
                if (numDeleted > 0) {
                    LOG.debug("Deleted " + numDeleted + " identifiers");
                }
                LOG.debug("Waiting...");
                Thread.sleep(10);
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

    public void testAutoShrink() throws Exception {
        IoBuffer buf = IoBuffer.allocate(8).setAutoShrink(true);

        // Make sure the buffer doesn't shrink too much (less than the initial
        // capacity.)
        buf.sweep((byte) 1);
        buf.fill(7);
        buf.compact();
        assertEquals(8, buf.capacity());
        assertEquals(1, buf.position());
        assertEquals(8, buf.limit());
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        // Expand the buffer.
        buf.capacity(32).clear();
        assertEquals(32, buf.capacity());

        // Make sure the buffer shrinks when only 1/4 is being used.
        buf.sweep((byte) 1);
        buf.fill(24);
        buf.compact();
        assertEquals(16, buf.capacity());
        assertEquals(8, buf.position());
        assertEquals(16, buf.limit());
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        // Expand the buffer.
        buf.capacity(32).clear();
        assertEquals(32, buf.capacity());

        // Make sure the buffer shrinks when only 1/8 is being used.
        buf.sweep((byte) 1);
        buf.fill(28);
        buf.compact();
        assertEquals(8, buf.capacity());
        assertEquals(4, buf.position());
        assertEquals(8, buf.limit());
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        // Expand the buffer.
        buf.capacity(32).clear();
        assertEquals(32, buf.capacity());

        // Make sure the buffer doesn't shrink when more than 1/4 is being used.
        buf.sweep((byte) 1);
        buf.fill(23);
        buf.compact();
        assertEquals(32, buf.capacity());
        assertEquals(9, buf.position());
        assertEquals(32, buf.limit());
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        buf.putPrefixedString("A", 1, encoder);
        assertEquals(2, buf.position());
        assertEquals(1, buf.get(0));
        assertEquals('A', buf.get(1));

        buf.sweep();
        buf.putPrefixedString("A", 2, encoder);
        assertEquals(3, buf.position());
        assertEquals(0, buf.get(0));
        assertEquals(1, buf.get(1));
        assertEquals('A', buf.get(2));
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        assertEquals(3, buf.position());
        assertEquals(0, buf.get(0));
        assertEquals(1, buf.get(1));
        assertEquals('A', buf.get(2));

        buf.sweep();
        buf.putPrefixedString("A", 4, encoder);
        assertEquals(5, buf.position());
        assertEquals(0, buf.get(0));
        assertEquals(0, buf.get(1));
        assertEquals(0, buf.get(2));
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.sweep()

        assertEquals(3, buf.position());
        assertEquals(2, buf.get(0));
        assertEquals('A', buf.get(1));
        assertEquals(' ', buf.get(2));

        buf.sweep();
        buf.putPrefixedString("A", 1, 4, (byte) 32, encoder);
        assertEquals(5, buf.position());
        assertEquals(4, buf.get(0));
        assertEquals('A', buf.get(1));
        assertEquals(' ', buf.get(2));
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.