use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.
the class RemoteGetStressTest method createChannel.
protected static JChannel createChannel(String name) throws Exception {
SHARED_LOOPBACK sl = new SHARED_LOOPBACK();
sl.getThreadPool().setMinThreads(1).setMaxThreads(5);
Protocol[] protocols = { sl, new SHARED_LOOPBACK_PING(), new NAKACK2(), new UNICAST3(), new STABLE(), new GMS(), new UFC(), new MFC().setMaxCredits(2000000).setMinThreshold(0.4), new FRAG2().setFragSize(8000) };
return new JChannel(protocols).name(name);
}
use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.
the class GossipRouterTest method createTunnelChannel.
protected JChannel createTunnelChannel(String name, boolean include_failure_detection) throws Exception {
TUNNEL tunnel = new TUNNEL().setValue("bind_addr", bind_addr).setValue("reconnect_interval", 1000);
tunnel.setGossipRouterHosts(gossip_router_hosts);
List<Protocol> protocols = new ArrayList<>();
protocols.addAll(Arrays.asList(tunnel, new PING(), new MERGE3().setValue("min_interval", 1000).setValue("max_interval", 3000)));
if (include_failure_detection) {
List<Protocol> tmp = new ArrayList<>(2);
tmp.add(new FD().setValue("timeout", 2000).setValue("max_tries", 2));
tmp.add(new VERIFY_SUSPECT());
protocols.addAll(tmp);
}
protocols.addAll(Arrays.asList(new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE(), new GMS().joinTimeout(10)));
JChannel ch = new JChannel(protocols);
if (name != null)
ch.setName(name);
return ch;
}
use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.
the class MergeTest2 method createChannel.
protected JChannel createChannel(String name) throws Exception {
SHARED_LOOPBACK shared_loopback = new SHARED_LOOPBACK();
shared_loopback.setDiagnosticsHandler(handler);
JChannel retval = new JChannel(shared_loopback, new DISCARD().setValue("discard_all", true), new SHARED_LOOPBACK_PING(), new NAKACK2().setValue("use_mcast_xmit", false).setValue("log_discard_msgs", false).setValue("log_not_found_msgs", false), new UNICAST3(), new STABLE().setValue("max_bytes", 50000), new GMS().setValue("print_local_addr", false).setValue("leave_timeout", 100).setValue("merge_timeout", 3000).setValue("log_view_warnings", false).setValue("view_ack_collection_timeout", 50).setValue("log_collect_msgs", false));
retval.setName(name);
JmxConfigurator.registerChannel(retval, Util.getMBeanServer(), name, retval.getClusterName(), true);
retval.connect("MergeTest2");
return retval;
}
use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.
the class OOBTest method testOOBMessageLoss.
/**
* Tests https://jira.jboss.org/jira/browse/JGRP-1079
*/
public void testOOBMessageLoss() throws Exception {
// we only need 1 channel
Util.close(b);
MyReceiver receiver = new MySleepingReceiver("A", 1000);
a.setReceiver(receiver);
final int NUM = 10;
for (int i = 1; i <= NUM; i++) a.send(new BytesMessage(null, i).setFlag(Message.Flag.OOB));
STABLE stable = a.getProtocolStack().findProtocol(STABLE.class);
if (stable != null)
stable.gc();
Collection<Integer> msgs = receiver.getMsgs();
for (int i = 0; i < 20; i++) {
if (msgs.size() == NUM)
break;
Util.sleep(1000);
sendStableMessages(a, b);
}
System.out.println("msgs = " + Util.print(msgs));
assert msgs.size() == NUM : "expected " + NUM + " messages but got " + msgs.size() + ", msgs=" + Util.print(msgs);
for (int i = 1; i <= NUM; i++) assert msgs.contains(i);
}
use of org.jgroups.protocols.pbcast.STABLE in project JGroups by belaban.
the class OOBTest method setStableGossip.
private static void setStableGossip(JChannel... channels) {
for (JChannel channel : channels) {
ProtocolStack stack = channel.getProtocolStack();
STABLE stable = stack.findProtocol(STABLE.class);
stable.setDesiredAverageGossip(2000);
}
}
Aggregations