Package org.jgroups.util

Examples of org.jgroups.util.MutableDigest.merge()


            Digest tmp_digest=data.getDigest();
            if(tmp_digest == null) {
                if(log.isErrorEnabled()) log.error("tmp_digest == null; skipping");
                continue;
            }
            retval.merge(tmp_digest);
        }
        return retval.copy();
    }

    /**
 
View Full Code Here


          .set(a1, 499,502).set(a2, 26,27).set(a3, 26,35);

        System.out.println("d: " + d);
        System.out.println("digest: " + digest);
       
        digest.merge(d);
        System.out.println("merged digest: " + digest);

        Assert.assertEquals(d.capacity(), 3);
        Assert.assertEquals(digest.capacity(), 3);
View Full Code Here

        View tmp_view=View.create(a1,1,a1,a2,a3,ip1,ip2);
        MutableDigest cons_d=new MutableDigest(tmp_view.getMembersRaw());

        cons_d.set(ip1,10,10);
        cons_d.set(ip2,20,20);
        cons_d.merge(d);

        Assert.assertEquals(cons_d.capacity(), 5);

        Assert.assertEquals(cons_d.get(ip1)[0], 10);
        Assert.assertEquals(cons_d.get(ip2)[0], 20);
View Full Code Here

        Address coord=members.get(0);
        View view=new View(coord, 2, members);
        MutableDigest digest=new MutableDigest(view.getMembersRaw());
        for(JChannel ch: channels) {
            NAKACK2 nakack=(NAKACK2)ch.getProtocolStack().findProtocol(NAKACK2.class);
            digest.merge(nakack.getDigest(ch.getAddress()));
        }
        for(JChannel ch: channels) {
            GMS gms=(GMS)ch.getProtocolStack().findProtocol(GMS.class);
            gms.installView(view, digest);
        }
View Full Code Here

        Channel coord_channel = findChannel(coord);
        System.out.println("coord_channel: " + coord_channel.getAddress());
       
        MutableDigest digest=new MutableDigest(coord_view.getMembersRaw());
        NAKACK2 nakack=(NAKACK2)coord_channel.getProtocolStack().findProtocol(NAKACK2.class);
        digest.merge(nakack.getDigest(coord));
       
        GMS gms=(GMS)coord_channel.getProtocolStack().findProtocol(GMS.class);
        gms.installView(coord_view, digest);
        System.out.println("gms.getView() " + gms.getView());
       
View Full Code Here

        Address coord=members.get(0);
        View view=new View(coord, 0, members);
        MutableDigest digest=new MutableDigest(view.getMembersRaw());
        for(JChannel ch: channels) {
            NAKACK2 nakack=(NAKACK2)ch.getProtocolStack().findProtocol(NAKACK2.class);
            digest.merge(nakack.getDigest(ch.getAddress()));
        }
        for(JChannel ch: channels) {
            GMS gms=(GMS)ch.getProtocolStack().findProtocol(GMS.class);
            System.out.println("Injecting view " + view + " into " + ch.getAddress());
            gms.installView(view, digest);
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.