Package org.jgroups.protocols.pbcast

Examples of org.jgroups.protocols.pbcast.Digest


        d2=new Digest(1);
        assertFalse(d2.sameSenders(d));
    }

    public void testSameSenders1MNullSameLength() {
        d2=new Digest(3);
        assertFalse(d2.sameSenders(d));
    }
View Full Code Here


        d2=d.copy();
        assertTrue(d.sameSenders(d2));
    }

    public void testSameSendersNotIdentical() {
        d2=new Digest(3);
        d2.add(a1, 4, 500, 501);
        d2.add(a3, 20, 25, 33);
        d2.add(a2, 25, 26, 26);
        assertTrue(d.sameSenders(d2));
    }
View Full Code Here

        d2.add(a2, 25, 26, 26);
        assertTrue(d.sameSenders(d2));
    }

    public void testSameSendersNotSameLength() {
        d2=new Digest(3);
        d2.add(a1, 4, 500, 501);
        d2.add(a2, 25, 26, 26);
        assertFalse(d.sameSenders(d2));
    }
View Full Code Here

        d.writeTo(dos);
        dos.close();
        byte[] buf=outstream.toByteArray();
        ByteArrayInputStream instream=new ByteArrayInputStream(buf);
        DataInputStream dis=new DataInputStream(instream);
        Digest tmp=new Digest();
        tmp.readFrom(dis);
        assertEquals(d, tmp);
    }
View Full Code Here

        _testSize(hdr);
    }

    public void testStableHeader() throws Exception {
        org.jgroups.protocols.pbcast.STABLE.StableHeader hdr;
        Digest digest=new Digest(2);
        IpAddress addr=new IpAddress("127.0.0.1", 5555);
        digest.add(addr, 100, 200, 205);
        hdr=new STABLE.StableHeader(STABLE.StableHeader.STABLE_GOSSIP, digest);
        _testSize(hdr);

        hdr=new STABLE.StableHeader(STABLE.StableHeader.STABILITY, null);
        _testSize(hdr);
View Full Code Here

      switch (evt.getType())
      {
         case Event.GET_DIGEST:
         case Event.GET_DIGEST_STATE:

            Digest d = new Digest(members.size());
            Address sender = null;
            //all members have same digest :)
            for (int j = 0; j < members.size(); j++)
            {
               sender = (Address) members.elementAt(j);
               d.add(sender, highestSeenSeq, highestSeenSeq);
            }
            passUp(new Event(Event.GET_DIGEST_OK, d));
            return false;
         case Event.SET_DIGEST:
            Digest receivedDigest = (Digest) evt.getArg();

          // changed by bela July 12 2005, not sure if this is correct, don't know what the original author
          // intended to do here
            // myAru = receivedDigest.highSeqnoAt(0);
            myAru = receivedDigest.highSeqnoAt(localAddress);
            return false;

         case Event.VIEW_CHANGE:
            onViewChange();
            return true;
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.pbcast.Digest

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.