Search in sources :

Example 51 with View

use of org.jgroups.View in project JGroups by belaban.

the class ViewTest method testDiff2.

public void testDiff2() {
    View one = View.create(a, 1, a, b, c);
    View two = View.create(a, 2, a, b, c, d, e);
    Address[][] diff = View.diff(one, two);
    System.out.println("diffs: " + printDiff(diff));
    Address[] joined = diff[0], left = diff[1];
    assert joined.length == 2;
    assert joined[0].equals(d) && joined[1].equals(e);
    assert left.length == 0;
}
Also used : Address(org.jgroups.Address) View(org.jgroups.View)

Aggregations

View (org.jgroups.View)51 Address (org.jgroups.Address)24 JChannel (org.jgroups.JChannel)14 GMS (org.jgroups.protocols.pbcast.GMS)6 Event (org.jgroups.Event)5 Receiver (org.jgroups.Receiver)5 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 ViewId (org.jgroups.ViewId)3 IOException (java.io.IOException)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 NetView (org.apache.geode.distributed.internal.membership.NetView)2 IpAddress (org.jgroups.stack.IpAddress)2 UUID (org.jgroups.util.UUID)2 java.io (java.io)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DataInputStream (java.io.DataInputStream)1 FileOutputStream (java.io.FileOutputStream)1 InputStream (java.io.InputStream)1