Search in sources :

Example 31 with JChannel

use of org.jgroups.JChannel 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 32 with JChannel

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

the class ClusterSplitLockTest method disconnectAndDestroy.

private void disconnectAndDestroy(int i) throws Exception {
    JChannel channel = channels[i];
    Util.close(channel);
}
Also used : JChannel(org.jgroups.JChannel)

Example 33 with JChannel

use of org.jgroups.JChannel 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 34 with JChannel

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

the class LargeMergeTest method getStats.

protected String getStats() {
    StringBuilder sb = new StringBuilder();
    int merge_task_running = 0;
    int merge_canceller_running = 0;
    int merge_in_progress = 0;
    int gms_merge_task_running = 0;
    for (JChannel ch : channels) {
        MERGE3 merge3 = ch.getProtocolStack().findProtocol(MERGE3.class);
        if (merge3 != null && merge3.isMergeTaskRunning())
            merge_task_running++;
        GMS gms = ch.getProtocolStack().findProtocol(GMS.class);
        if (gms.isMergeKillerRunning())
            merge_canceller_running++;
        if (gms.isMergeInProgress())
            merge_in_progress++;
        if (gms.isMergeTaskRunning())
            gms_merge_task_running++;
    }
    sb.append("merge tasks running: " + merge_task_running).append("\n");
    sb.append("merge killers running: " + merge_canceller_running).append("\n");
    sb.append("merge in progress: " + merge_in_progress).append("\n");
    sb.append("gms.merge tasks running: " + gms_merge_task_running).append("\n");
    return sb.toString();
}
Also used : JChannel(org.jgroups.JChannel) GMS(org.jgroups.protocols.pbcast.GMS)

Example 35 with JChannel

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

the class ConfiguratorTest method setUp.

@BeforeMethod
void setUp() throws Exception {
    ch = new JChannel(new UDP(), new PING(), new FD_ALL3(), new NAKACK2().setXmitInterval(500), new UNICAST3(), new MFC());
    stack = ch.getProtocolStack();
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

JChannel (org.jgroups.JChannel)119 GMS (org.jgroups.protocols.pbcast.GMS)22 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)21 Protocol (org.jgroups.stack.Protocol)18 STABLE (org.jgroups.protocols.pbcast.STABLE)15 View (org.jgroups.View)14 Message (org.jgroups.Message)10 ArrayList (java.util.ArrayList)9 Address (org.jgroups.Address)7 IOException (java.io.IOException)6 Test (org.testng.annotations.Test)5 InetSocketAddress (java.net.InetSocketAddress)4 HashMap (java.util.HashMap)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)4 LockService (org.jgroups.blocks.locking.LockService)4 Test (org.junit.Test)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 ChannelBroadcastEndpointFactory (org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory)3