Search in sources :

Example 6 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project fabric8 by jboss-fuse.

the class TestBase method setUp.

@Before
public void setUp() throws Exception {
    for (int i = 0; i < NUM; i++) {
        Protocol ping = createPing();
        channels[i] = new JChannel(new TCP(), ping, new NAKACK2(), new UNICAST3(), new STABLE(), new GMS());
        channels[i].setName(Character.toString((char) ('A' + i)));
        channels[i].connect(CLUSTER_NAME);
        channels[i].setReceiver(receivers[i] = new MyReceiver());
    }
}
Also used : TCP(org.jgroups.protocols.TCP) NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) STABLE(org.jgroups.protocols.pbcast.STABLE) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS) UNICAST3(org.jgroups.protocols.UNICAST3) Before(org.junit.Before)

Example 7 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class CustomProtocolTest method testMyProtocol.

@Test(groups = Global.FUNCTIONAL)
public static void testMyProtocol() throws Exception {
    JChannel channel = new JChannel(new UDP(), new org.jgroups.tests.CustomProtocolTest.MyProtocol(), new PING(), new FD_ALL3(), new VERIFY_SUSPECT(), new NAKACK2(), new UNICAST3(), new STABLE(), new FRAG2(), new GMS());
    System.out.println("channel = " + channel);
    assert true;
}
Also used : JChannel(org.jgroups.JChannel) GMS(org.jgroups.protocols.pbcast.GMS) NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) STABLE(org.jgroups.protocols.pbcast.STABLE) Test(org.testng.annotations.Test)

Example 8 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class LargeMergeTest method setUp.

@BeforeMethod
void setUp() throws Exception {
    System.out.print("Connecting channels: ");
    for (int i = 0; i < NUM; i++) {
        channels[i] = new JChannel(new SHARED_LOOPBACK(), new DISCARD().discardAll(true), new SHARED_LOOPBACK_PING(), new MERGE3().setMinInterval(1000).setMaxInterval(3000).setCheckInterval(6000).setMaxParticipantsInMerge(NUM), new NAKACK2().useMcastXmit(false).logDiscardMessages(false).logNotFoundMessages(false).setXmitTableNumRows(5).setXmitTableMsgsPerRow(10), new UNICAST3().setXmitTableNumRows(5).setXmitTableMsgsPerRow(10).setConnExpiryTimeout(10000), new STABLE().setMaxBytes(500000), new GMS().printLocalAddress(false).setJoinTimeout(1).setLeaveTimeout(100).logViewWarnings(false).setViewAckCollectionTimeout(2000).logCollectMessages(false));
        channels[i].setName(String.valueOf((i + 1)));
        channels[i].connect("LargeMergeTest");
        System.out.print(i + 1 + " ");
    }
    System.out.println("");
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 9 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class FragTest method createChannel.

protected static JChannel createChannel(String name, Class<? extends Fragmentation> clazz, boolean use_encr) throws Exception {
    Fragmentation frag_prot = clazz.getDeclaredConstructor().newInstance();
    frag_prot.setFragSize(FRAG_SIZE);
    ASYM_ENCRYPT e = use_encr ? new ASYM_ENCRYPT().setChangeKeyOnLeave(false).setUseExternalKeyExchange(false) : null;
    return new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), e, new NAKACK2().useMcastXmit(false), new UNICAST3(), new STABLE().setMaxBytes(50000), new GMS().setJoinTimeout(500).printLocalAddress(false), new UFC(), new MFC(), frag_prot).name(name);
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS)

Example 10 with STABLE

use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.

the class Util method getTestStack.

/**
 * Returns a default stack for testing with transport = SHARED_LOOPBACK
 * @param additional_protocols Any number of protocols to add to the top of the returned protocol list
 * @return
 */
public static Protocol[] getTestStack(Protocol... additional_protocols) {
    Protocol[] protocols = { new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new NAKACK2(), new UNICAST3(), new STABLE(), new GMS().setJoinTimeout(1000), new FRAG2().setFragSize(8000) };
    if (additional_protocols == null)
        return protocols;
    Protocol[] tmp = Arrays.copyOf(protocols, protocols.length + additional_protocols.length);
    System.arraycopy(additional_protocols, 0, tmp, protocols.length, additional_protocols.length);
    return tmp;
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) STABLE(org.jgroups.protocols.pbcast.STABLE) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS)

Aggregations

STABLE (org.jgroups.protocols.pbcast.STABLE)34 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)29 GMS (org.jgroups.protocols.pbcast.GMS)27 JChannel (org.jgroups.JChannel)15 Protocol (org.jgroups.stack.Protocol)13 UNICAST3 (org.jgroups.protocols.UNICAST3)6 ArrayList (java.util.ArrayList)4 SHARED_LOOPBACK (org.jgroups.protocols.SHARED_LOOPBACK)3 DISCARD (org.jgroups.protocols.DISCARD)2 SHARED_LOOPBACK_PING (org.jgroups.protocols.SHARED_LOOPBACK_PING)2 TCP (org.jgroups.protocols.TCP)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 Test (org.testng.annotations.Test)2 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 SecureRandom (java.security.SecureRandom)1 List (java.util.List)1 Properties (java.util.Properties)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1