Permalink
Browse files

Merge branch 'JGRP-1581'

  • Loading branch information...
Bela Ban
Bela Ban committed Feb 27, 2013
2 parents 81591ff + 1254c88 commit b6250a47ae61fbe40fba033d5b9754f983b7ee93
Showing with 1,448 additions and 891 deletions.
  1. +1 −1 conf/fast-local.xml
  2. +9 −0 doc/manual/en/modules/advanced.xml
  3. +13 −1 src/org/jgroups/Message.java
  4. +26 −4 src/org/jgroups/demos/Draw.java
  5. +1 −1 src/org/jgroups/demos/ProgrammaticChat.java
  6. +167 −110 src/org/jgroups/protocols/ENCRYPT.java
  7. +63 −21 src/org/jgroups/protocols/FC.java
  8. +49 −46 src/org/jgroups/protocols/FRAG.java
  9. +59 −61 src/org/jgroups/protocols/FRAG2.java
  10. +70 −19 src/org/jgroups/protocols/FlowControl.java
  11. +3 −3 src/org/jgroups/protocols/FragHeader.java
  12. +56 −26 src/org/jgroups/protocols/RELAY.java
  13. +24 −3 src/org/jgroups/protocols/RSVP.java
  14. +5 −3 src/org/jgroups/protocols/SCOPE.java
  15. +23 −5 src/org/jgroups/protocols/SEQUENCER.java
  16. +20 −70 src/org/jgroups/protocols/STOMP.java
  17. +162 −37 src/org/jgroups/protocols/UNICAST.java
  18. +38 −10 src/org/jgroups/protocols/UNICAST2.java
  19. +34 −17 src/org/jgroups/protocols/UNICAST3.java
  20. +40 −36 src/org/jgroups/protocols/pbcast/FLUSH.java
  21. +24 −16 src/org/jgroups/protocols/pbcast/NAKACK2.java
  22. +110 −75 src/org/jgroups/protocols/pbcast/STABLE.java
  23. +15 −5 src/org/jgroups/protocols/pbcast/STATE.java
  24. +25 −4 src/org/jgroups/protocols/relay/RELAY2.java
  25. +20 −4 src/org/jgroups/protocols/rules/SUPERVISOR.java
  26. +6 −6 src/org/jgroups/util/BlockingInputStream.java
  27. +41 −5 src/org/jgroups/util/MessageBatch.java
  28. +10 −0 src/org/jgroups/util/Util.java
  29. +2 −2 tests/byteman/org/jgroups/tests/byteman/BecomeServerTest.java
  30. +2 −2 tests/byteman/org/jgroups/tests/byteman/ForwardToCoordFailoverTest.java
  31. +2 −2 tests/byteman/org/jgroups/tests/byteman/MessageBeforeConnectedTest.java
  32. +3 −3 tests/byteman/org/jgroups/tests/helpers/MessageBeforeConnectedTestHelper.java
  33. +2 −4 tests/junit-functional/org/jgroups/protocols/FORWARD_TO_COORD_Test.java
  34. +12 −0 tests/junit-functional/org/jgroups/protocols/NAKACK2_RetransmitTest.java
  35. +46 −29 tests/junit-functional/org/jgroups/protocols/NAKACK_Delivery_Test.java
  36. +28 −32 tests/junit-functional/org/jgroups/protocols/NAKACK_StressTest.java
  37. +1 −1 tests/junit-functional/org/jgroups/protocols/SUPERVISOR_Test.java
  38. +1 −1 tests/junit-functional/org/jgroups/protocols/UNICAST_ConnectionTests.java
  39. +1 −1 tests/junit-functional/org/jgroups/protocols/UNICAST_ContentionTest.java
  40. +83 −8 tests/junit-functional/org/jgroups/tests/BlockingInputStreamTest.java
  41. +27 −18 tests/junit-functional/org/jgroups/tests/FCTest.java
  42. +2 −2 tests/junit-functional/org/jgroups/tests/FdMonitorTest.java
  43. +1 −1 tests/junit-functional/org/jgroups/tests/FragTest.java
  44. +2 −6 tests/junit-functional/org/jgroups/tests/LargeMergeTest.java
  45. +2 −2 tests/junit-functional/org/jgroups/tests/MergeTest2.java
  46. +1 −1 tests/junit-functional/org/jgroups/tests/MergeTest3.java
  47. +55 −0 tests/junit-functional/org/jgroups/tests/MessageBatchTest.java
  48. +1 −1 tests/junit-functional/org/jgroups/tests/MessageDispatcherRSVPTest.java
  49. +1 −1 tests/junit-functional/org/jgroups/tests/NakackTest.java
  50. +1 −1 tests/junit-functional/org/jgroups/tests/OrderingTest.java
  51. +1 −1 tests/junit-functional/org/jgroups/tests/ProgrammaticApiTest.java
  52. +3 −6 tests/junit-functional/org/jgroups/tests/RSVPTest.java
  53. +3 −3 tests/junit-functional/org/jgroups/tests/Relay2Test.java
  54. +2 −2 tests/junit-functional/org/jgroups/tests/RpcDispatcherAsyncInvocationTest.java
  55. +0 −127 tests/junit/org/jgroups/tests/FlushCloseOpenTest.java
  56. +1 −1 tests/junit/org/jgroups/tests/GossipRouterTest.java
  57. +6 −7 tests/junit/org/jgroups/tests/LargeStateTransferTest.java
  58. +8 −3 tests/junit/org/jgroups/tests/ReconciliationTest.java
  59. +23 −27 tests/junit/org/jgroups/tests/SCOPE_Test.java
  60. +1 −1 tests/junit/org/jgroups/tests/SequencerMergeTest.java
  61. +3 −3 tests/junit/org/jgroups/tests/StateTransferTest.java
  62. +1 −1 tests/junit/org/jgroups/tests/TCPGOSSIP_Test.java
  63. +1 −1 tests/junit/org/jgroups/tests/TUNNELDeadLockTest.java
  64. +1 −1 tests/junit/org/jgroups/tests/TUNNEL_Test.java
  65. +4 −0 tests/perf/org/jgroups/tests/perf/MPerf.java
View
@@ -18,7 +18,7 @@
mcast_recv_buf_size="25M"
mcast_send_buf_size="640K"
loopback="false"
- max_bundle_size="64000"
+ max_bundle_size="64K"
max_bundle_timeout="30"
ip_ttl="${jgroups.udp.ip_ttl:0}"
enable_diagnostics="true"
@@ -1083,6 +1083,15 @@ for(Future<RspList> future: futures) {
<section id="Scopes">
<title>Scopes: concurrent message delivery for messages from the same sender</title>
+
+ <note>
+ <title>Deprecated in 3.3</title>
+ <para>
+ In 3.3, SCOPE is replaced with the <xref linkend="AsyncInvocation">Asynchronous Invocation API</xref>.
+ SCOPE will probably be removed in 4.x.
+ </para>
+ </note>
+
<para>
In the previous paragraph, we showed how the concurrent stack delivers messages from different senders
concurrently. But all (non-OOB) messages from the same sender P are delivered in the order in which
@@ -244,6 +244,13 @@ public Message(boolean create_headers) {
}
}
+ /**
+ * <em>
+ * Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the
+ * message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would
+ * retransmit a changed byte[] buffer !
+ * </em>
+ */
final public Message setBuffer(byte[] b) {
buf=b;
if(buf != null) {
@@ -256,7 +263,12 @@ final public Message setBuffer(byte[] b) {
}
/**
- * Set the internal buffer to point to a subset of a given buffer
+ * Sets the internal buffer to point to a subset of a given buffer.<p/>
+ * <em>
+ * Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the
+ * message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would
+ * retransmit a changed byte[] buffer !
+ * </em>
*
* @param b The reference to a given buffer. If null, we'll reset the buffer to null
* @param offset The initial position
@@ -422,7 +422,7 @@ public void writeState(OutputStream outstream) throws IOException {
if(state == null)
return;
synchronized(state) {
- DataOutputStream dos=new DataOutputStream(new BufferedOutputStream(outstream, 4096));
+ DataOutputStream dos=new DataOutputStream(new BufferedOutputStream(outstream));
// DataOutputStream dos=new DataOutputStream(outstream);
dos.writeInt(state.size());
for(Map.Entry<Point,Color> entry: state.entrySet()) {
@@ -433,13 +433,14 @@ public void writeState(OutputStream outstream) throws IOException {
dos.writeInt(col.getRGB());
}
dos.flush();
+ System.out.println("wrote " + state.size() + " elements");
}
}
public void readState(InputStream instream) throws IOException {
- DataInputStream in=new DataInputStream(instream);
- Map<Point,Color> new_state=new HashMap<Point,Color>();
+ DataInputStream in=new DataInputStream(new BufferedInputStream(instream));
+ Map<Point,Color> new_state=new LinkedHashMap<Point,Color>();
int num=in.readInt();
for(int i=0; i < num; i++) {
Point point=new Point(in.readInt(), in.readInt());
@@ -450,7 +451,7 @@ public void readState(InputStream instream) throws IOException {
synchronized(state) {
state.clear();
state.putAll(new_state);
- System.out.println("read state: " + state.size() + " entries");
+ System.out.println("read " + state.size() + " elements");
createOffscreenImage(true);
}
}
@@ -575,5 +576,26 @@ public void paintComponent(Graphics g) {
}
+
+ /* protected class MyPoint extends Point implements Comparable<Point> {
+ private static final long serialVersionUID=4171855995316340839L;
+
+ public MyPoint() {
+ }
+
+ public MyPoint(Point p) {
+ super(p);
+ }
+
+ public MyPoint(int x, int y) {
+ super(x,y);
+ }
+
+
+ public int compareTo(Point o) {
+ return x > o.x? 1 : x < o.x? -1 : y > o.y? 1 : y < o.y ? -1 :0;
+ }
+ }*/
+
}
@@ -30,7 +30,7 @@ public static void main(String[] args) throws Exception {
.addProtocol(new VERIFY_SUSPECT())
.addProtocol(new BARRIER())
.addProtocol(new NAKACK2())
- .addProtocol(new UNICAST2())
+ .addProtocol(new UNICAST3())
.addProtocol(new STABLE())
.addProtocol(new GMS())
.addProtocol(new UFC())
Oops, something went wrong.

0 comments on commit b6250a4

Please sign in to comment.