Package org.jgroups.protocols

Examples of org.jgroups.protocols.PingData


        assert rsps.isDone();
    }

    public void testBreakOnCoordRsp() {
        Responses rsps=new Responses(true);
        rsps.addResponse(new PingData(addrs[0],true,names[0],phys_addrs[0]), false);
        assert !rsps.isDone();

        rsps.addResponse(new PingData(addrs[1],true,names[1],phys_addrs[1]).coord(true), false);
        System.out.println("rsps = " + rsps);
        assert rsps.isDone();
    }
View Full Code Here


    public void testClear() {
        Responses rsps=new Responses(10, true);
        System.out.println("rsps = " + rsps);
        for(int i=0; i < 5; i++)
            rsps.addResponse(new PingData(addrs[i], true,names[i],phys_addrs[i]), false);
        System.out.println("rsps = " + rsps);
        assert rsps.size() == 5;
        assert !rsps.isDone();
        rsps.clear();
        System.out.println("rsps = " + rsps);
View Full Code Here

        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
                for(int i=5; i < 10; i++)
                    rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
            }
        }.start();

        done=rsps.waitFor(20000);
        long time=System.currentTimeMillis() - start;
View Full Code Here

        long start=System.currentTimeMillis();
        new Thread() {
            public void run() {
                Util.sleep(500);
                for(int i=0; i < 2; i++)
                    rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
                rsps.addResponse(new PingData(addrs[3], true, names[3], phys_addrs[3]).coord(true), false);
            }
        }.start();

        done=rsps.waitFor(20000);
        long time=System.currentTimeMillis() - start;
View Full Code Here

    }

    public void testIterator() throws Exception {
        Responses rsps=new Responses(10, true);
        for(int i=0; i < 5; i++)
            rsps.addResponse(new PingData(addrs[i],true,names[i],phys_addrs[i]), false);
        int count=0;
        for(PingData data: rsps) {
            if(data != null)
                count++;
            if(count == 2)
                rsps.addResponse(new PingData(addrs[5],true,names[5],phys_addrs[5]), false);
        }
        assert count == 5;
    }
View Full Code Here

                            List<PingData> mbrs=new ArrayList<PingData>();
                            map=routingTable.get(group);
                            if(map != null) {
                                for(Address logical_addr: map.keySet()) {
                                    physical_addrs=address_mappings.get(logical_addr);
                                    PingData rsp=new PingData(logical_addr, null, true, UUID.get(logical_addr),
                                                              physical_addrs != null? new ArrayList<PhysicalAddress>(physical_addrs) : null);
                                    mbrs.add(rsp);
                                }
                            }
                            output.writeShort(mbrs.size());
View Full Code Here

            request.writeTo(output);
            output.flush();

            short num_rsps=input.readShort();
            for(int i=0; i < num_rsps; i++) {
                PingData rsp=new PingData();
                rsp.readFrom(input);
                retval.add(rsp);
            }
        }
        catch(SocketException se) {
            if(log.isWarnEnabled())
View Full Code Here

                            List<PingData> mbrs=new ArrayList<PingData>();
                            map=routingTable.get(group);
                            if(map != null) {
                                for(Address logical_addr: map.keySet()) {
                                    physical_addrs=address_mappings.get(logical_addr);
                                    PingData rsp=new PingData(logical_addr, null, true, UUID.get(logical_addr),
                                                              physical_addrs != null? new ArrayList<PhysicalAddress>(physical_addrs) : null);
                                    mbrs.add(rsp);
                                }
                            }
                            output.writeShort(mbrs.size());
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.PingData

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.