Permalink
Browse files

Changed from NAKACK to NAKACK2

  • Loading branch information...
1 parent 348cdc3 commit ac8be874a4196e524c143e394fe05a48ef4769cb Bela Ban committed Feb 3, 2012
Showing with 12 additions and 12 deletions.
  1. +1 −1 src/org/jgroups/protocols/pbcast/NAKACK2.java
  2. +11 −11 tests/junit/org/jgroups/protocols/GMS_MergeTest.java
@@ -978,7 +978,7 @@ protected void adjustReceivers(List<Address> new_members) {
/**
* Returns a message digest: for each member P the highest delivered and received seqno is added
*/
- protected Digest getDigest() {
+ public Digest getDigest() {
final Map<Address,long[]> map=new HashMap<Address,long[]>();
for(Map.Entry<Address,Table<Message>> entry: xmit_table.entrySet()) {
Address sender=entry.getKey(); // guaranteed to be non-null (CCHM)
@@ -5,7 +5,7 @@
import org.jgroups.conf.ProtocolStackConfigurator;
import org.jgroups.conf.ClassConfigurator;
import org.jgroups.protocols.pbcast.GMS;
-import org.jgroups.protocols.pbcast.NAKACK;
+import org.jgroups.protocols.pbcast.NAKACK2;
import org.jgroups.protocols.pbcast.STABLE;
import org.jgroups.stack.ProtocolStack;
import org.jgroups.tests.ChannelTestBase;
@@ -27,7 +27,7 @@
@Test(groups={Global.STACK_INDEPENDENT}, sequential=true)
public class GMS_MergeTest extends ChannelTestBase {
static final String simple_props="SHARED_LOOPBACK:PING(timeout=1000):" +
- "pbcast.NAKACK(use_mcast_xmit=false;log_discard_msgs=false;log_not_found_msgs=false)" +
+ "pbcast.NAKACK2(use_mcast_xmit=false;log_discard_msgs=false;log_not_found_msgs=false)" +
":UNICAST:pbcast.STABLE(stability_delay=200):pbcast.GMS:FC:FRAG2";
static final String flush_props=simple_props + ":pbcast.FLUSH";
@@ -322,9 +322,9 @@ static void _testMergeAsymmetricPartitions(String props, String cluster_name) th
checkMessages(NUM * 2, receivers[0], receivers[2]);
checkMessages(0, receivers[1]);
- Digest da=((NAKACK)a.getProtocolStack().findProtocol(NAKACK.class)).getDigest(),
- db=((NAKACK)b.getProtocolStack().findProtocol(NAKACK.class)).getDigest(),
- dc=((NAKACK)c.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
+ Digest da=((NAKACK2)a.getProtocolStack().findProtocol(NAKACK2.class)).getDigest(),
+ db=((NAKACK2)b.getProtocolStack().findProtocol(NAKACK2.class)).getDigest(),
+ dc=((NAKACK2)c.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
System.out.println("Digest A: " + da + "\nDigest B: " + db + "\nDigest C: " + dc);
System.out.println("Running stability protocol on B and C now");
@@ -339,9 +339,9 @@ static void _testMergeAsymmetricPartitions(String props, String cluster_name) th
Util.sleep(300);
}
- db=((NAKACK)a.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
- db=((NAKACK)b.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
- dc=((NAKACK)c.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
+ db=((NAKACK2)a.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
+ db=((NAKACK2)b.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
+ dc=((NAKACK2)c.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
System.out.println("(after purging)\nDigest A: " + da + "\nDigest B: " + db + "\nDigest C: " + dc);
// now enable traffic reception of B and C on A:
@@ -415,8 +415,8 @@ static void _testMergeAsymmetricPartitions2(String props, String cluster_name) t
for(MyReceiver receiver: receivers)
receiver.clear();
- Digest da=((NAKACK)a.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
- Digest db=((NAKACK)b.getProtocolStack().findProtocol(NAKACK.class)).getDigest();
+ Digest da=((NAKACK2)a.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
+ Digest db=((NAKACK2)b.getProtocolStack().findProtocol(NAKACK2.class)).getDigest();
System.out.println("(after purging)\nDigest A: " + da + "\nDigest B: " + db);
Address merge_leader=determineLeader(channels, "A", "B");
@@ -649,7 +649,7 @@ private static void print(JChannel[] channels) {
private static void printDigests(JChannel[] channels) {
for(JChannel ch: channels) {
- NAKACK nak=(NAKACK)ch.getProtocolStack().findProtocol(NAKACK.class);
+ NAKACK2 nak=(NAKACK2)ch.getProtocolStack().findProtocol(NAKACK2.class);
Digest digest=nak.getDigest();
System.out.println(ch.getName() + ": " + digest.toStringSorted());
}

0 comments on commit ac8be87

Please sign in to comment.