Package org.jgroups.util

Examples of org.jgroups.util.Queue$Element


        assertEquals(2, queue.size());
        queue.close(true);
        assertEquals(2, queue.size());
        queue.clear();
        assertEquals(0, queue.size());
        queue=new Queue();
        queue.add("one");
        queue.add("two");
        queue.clear();
        assertEquals(0, queue.size());
        queue.add("one");
View Full Code Here


        System.out.println("diff is " + Math.abs(diff) + "; " + (q2 < q1 ? "LinkedListQueue" : "Queue") + " is faster");
    }


    long measureQueue() throws Exception {
        Queue q=new Queue();
        long start, stop;

        start=System.currentTimeMillis();
        for(int i=0; i < num_elements; i++) {
            if(i % 2 == 0)
                q.add(new Integer(i));
            else
                q.addAtHead(new Integer(i));
        }

        while(q.size() > 0)
            q.remove();

        stop=System.currentTimeMillis();
        return stop - start;
    }
View Full Code Here

            diag_handler=new DiagnosticsHandler();
            diag_handler.start();
        }

        if(use_incoming_packet_handler) {
            incoming_packet_queue=new Queue();
            incoming_packet_handler=new IncomingPacketHandler();
            incoming_packet_handler.start();
        }

        if(loopback) {
            incoming_msg_queue=new Queue();
            incoming_msg_handler=new IncomingMessageHandler();
            incoming_msg_handler.start();
        }

        if(use_outgoing_packet_handler) {
View Full Code Here

    }


    private void startEventHandlerThread() {
        if(event_queue == null)
            event_queue=new Queue();
        if(evt_thread == null) {
            evt_thread=new Thread(this, "GMS.EventHandlerThread");
            evt_thread.setDaemon(true);
            evt_thread.start();
        }
View Full Code Here

            diag_handler=new DiagnosticsHandler();
            diag_handler.start();
        }

        if(use_incoming_packet_handler && !use_concurrent_stack) {
            incoming_packet_queue=new Queue();
            incoming_packet_handler=new IncomingPacketHandler();
            incoming_packet_handler.start();
        }

        if(loopback && !use_concurrent_stack) {
            incoming_msg_queue=new Queue();
            incoming_msg_handler=new IncomingMessageHandler();
            incoming_msg_handler.start();
        }

        if(enable_bundling) {
View Full Code Here

        System.out.println("Time to insert and remove " + num_elements + " into Queue:           " + q1 + " ms");
    }


    long measureQueue() throws Exception {
        Queue q=new Queue();
        long start, stop;

        start=System.currentTimeMillis();
        for(int i=0; i < num_elements; i++) {
            if(i % 2 == 0)
                q.add(new Integer(i));
            else
                q.addAtHead(new Integer(i));
        }

        while(q.size() > 0)
            q.remove();

        stop=System.currentTimeMillis();
        return stop - start;
    }
View Full Code Here

                diag_handler.registerProbeHandler(handler);
            preregistered_probe_handlers.clear();
        }

        if(use_incoming_packet_handler && !use_concurrent_stack) {
            incoming_packet_queue=new Queue();
            incoming_packet_handler=new IncomingPacketHandler();
            incoming_packet_handler.start();
        }

        if(loopback && !use_concurrent_stack) {
            incoming_msg_queue=new Queue();
            incoming_msg_handler=new IncomingMessageHandler();
            incoming_msg_handler.start();
        }

        if(enable_bundling) {
View Full Code Here

                diag_handler.registerProbeHandler(handler);
            preregistered_probe_handlers.clear();
        }

        if(use_incoming_packet_handler && !use_concurrent_stack) {
            incoming_packet_queue=new Queue();
            incoming_packet_handler=new IncomingPacketHandler();
            incoming_packet_handler.start();
        }

        if(loopback && !use_concurrent_stack) {
            incoming_msg_queue=new Queue();
            incoming_msg_handler=new IncomingMessageHandler();
            incoming_msg_handler.start();
        }

        if(enable_bundling) {
View Full Code Here

        super(Name_);
    }

    public void setUp() throws Exception {
        super.setUp();
        queue=new Queue();
    }
View Full Code Here

        assertEquals(2, queue.size());
        queue.close(true);
        assertEquals(2, queue.size());
        queue.clear();
        assertEquals(0, queue.size());
        queue=new Queue();
        queue.add("one");
        queue.add("two");
        queue.clear();
        assertEquals(0, queue.size());
        queue.add("one");
View Full Code Here

TOP

Related Classes of org.jgroups.util.Queue$Element

Copyright © 2018 www.massapicom. 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.