Examples of capacity()


Examples of org.jgroups.util.RetransmitTable.capacity()

        final Message MSG=new Message(null, null, "hello world");
        for(int i=0; i < NUM_MSGS; i++)
            table.put(i, MSG);
        System.out.println("table = " + table);
        assert table.size() == NUM_MSGS;
        assert table.capacity() == 10010;
    }

    public static void testResize() {
        RetransmitTable table=new RetransmitTable(3, 10, 0);
        assert table.capacity() == 30;
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        assert table.capacity() == 10010;
    }

    public static void testResize() {
        RetransmitTable table=new RetransmitTable(3, 10, 0);
        assert table.capacity() == 30;
        addAndGet(table, 30, "30");
        addAndGet(table, 35, "35");
        assert table.capacity() == 40;
        addAndGet(table, 500, "500");
        assert table.capacity() == 510;
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

    public static void testResize() {
        RetransmitTable table=new RetransmitTable(3, 10, 0);
        assert table.capacity() == 30;
        addAndGet(table, 30, "30");
        addAndGet(table, 35, "35");
        assert table.capacity() == 40;
        addAndGet(table, 500, "500");
        assert table.capacity() == 510;

        addAndGet(table, 515, "515");
        assert table.capacity() == 520;
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        assert table.capacity() == 30;
        addAndGet(table, 30, "30");
        addAndGet(table, 35, "35");
        assert table.capacity() == 40;
        addAndGet(table, 500, "500");
        assert table.capacity() == 510;

        addAndGet(table, 515, "515");
        assert table.capacity() == 520;
    }
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        assert table.capacity() == 40;
        addAndGet(table, 500, "500");
        assert table.capacity() == 510;

        addAndGet(table, 515, "515");
        assert table.capacity() == 520;
    }

    public void testResizeWithPurge() {
        RetransmitTable table=new RetransmitTable(3, 10, 0);
        for(long i=1; i <= 100; i++)
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        List<String> list=new ArrayList<String>(20);
        for(int i=16; i < 50; i++)
            list.add("hello-" + i);
        list.add("hello-55");

        for(long i=table.getOffset(); i < table.capacity() + table.getOffset(); i++) {
            Message msg=table.get(i);
            if(msg != null) {
                String message=(String)msg.getObject();
                System.out.println(i + ": " + message);
                list.remove(message);
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        RetransmitTable table=new RetransmitTable(3, 10, 0);
        for(long i=0; i < 50; i++)
            addAndGet(table, i, "hello-" + i);
        System.out.println("table = " + table);
        assert table.size() == 50;
        assert table.capacity() == 50;
        assert table.getHighestPurged() == 0;
        assert table.getHighest() == 49;

        table.purge(43);
        addAndGet(table, 52, "hello-52");
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

            addAndGet(table, i, "hello-" + i);
        table.purge(49);
        assert table.isEmpty();
        addAndGet(table, 50, "50");
        assert table.size() == 1;
        assert table.capacity() == 50;
    }


    public static void testPurge() {
        RetransmitTable table=new RetransmitTable(5, 10, 0);
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

        assert table.size() == 80;
        table.purge(59);
        assert table.size() == 20;
        table.compact();
        assert table.size() == 20;
        assert table.capacity() == 40;
    }


    public void testCompactWithAutomaticPurging() {
        RetransmitTable table=new RetransmitTable(3, 10, 0);
View Full Code Here

Examples of org.jgroups.util.RetransmitTable.capacity()

            table.remove(i);

        assert table.size() == 20;
        table.compact();
        assert table.size() == 20;
        assert table.capacity() == 40;
    }


    protected static void addAndGet(RetransmitTable table, long seqno, String message) {
        boolean added=table.put(seqno, new Message(null, null, message));
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.