Package org.jgroups.util

Examples of org.jgroups.util.Digest$Entry


        Digest dd=new Digest(3);
        assertEquals(0, dd.size());
    }

    public void testConstructor3() {
        Digest dd=new MutableDigest(3);
        assertEquals(0, dd.size());
    }
View Full Code Here


        testResetAt();
    }


    public void testCopy2() {
        Digest tmp=d.copy();
        assertEquals(tmp, d);
    }
View Full Code Here

        assertEquals(tmp, d);
    }


    public void testMutableCopy() {
        Digest copy=md.copy();
        System.out.println("md=" + md + "\ncopy=" + copy);
        assertEquals(md, copy);
        md.add(a1, 4, 500, 1000);
        System.out.println("md=" + md + "\ncopy=" + copy);
        assertFalse(md.equals(copy));
View Full Code Here

    public void testSameSendersOtherIsNull() {
        assertFalse(d.sameSenders(null));
    }

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

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

    public void testSameSenders1MNullSameLength() {
        d2=new Digest(3);
        assertFalse(d2.sameSenders(d));
    }
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

    public void testStableHeader() throws Exception {
        org.jgroups.protocols.pbcast.STABLE.StableHeader hdr;
        IpAddress addr=new IpAddress("127.0.0.1", 5555);
        Map map=new HashMap();
        map.put(addr, new Digest.Entry(100, 200, 205));
        Digest digest=new Digest(map);
        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

            }
            else if(empty) {
                if(!flushProtocolInStack) {
                    down_prot.down(new Event(Event.CLOSE_BARRIER));
                }
                Digest digest=(Digest)down_prot.down(new Event(Event.GET_DIGEST));
                if(log.isDebugEnabled())
                    log.debug("digest is " + digest + ", getting application state");
                try {
                    requestApplicationStates(sender, digest, !flushProtocolInStack);
                }
View Full Code Here


    /** Set the digest and the send the state up to the application */
    void handleStateRsp(StateHeader hdr, byte[] state) {
        Address sender=hdr.sender;
        Digest tmp_digest=hdr.my_digest;
        String id=hdr.state_id;
        Address state_sender=hdr.sender;

        waiting_for_state_response=false;
        if(isDigestNeeded()){
View Full Code Here

    /**
     * Get the view and digest and send back both (MergeData) in the form of a MERGE_RSP to the sender.
     * If a merge is already in progress, send back a MergeData with the merge_rejected field set to true.
     */
    public void handleMergeRequest(Address sender, ViewId merge_id) {
        Digest digest;
        View view;

        if(sender == null) {
            if(log.isErrorEnabled()) log.error("sender == null; cannot send back a response");
            return;
View Full Code Here

TOP

Related Classes of org.jgroups.util.Digest$Entry

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.