Permalink
Browse files

Streamable: DataInputStream --> DataInput, DataOutputStream --> DataO…

  • Loading branch information...
1 parent 8239bbb commit 89c803eb5cf48bf6ccd14db1df4581e8fe4ad60c Bela Ban committed Apr 11, 2011
Showing with 355 additions and 383 deletions.
  1. +1 −1 bin/draw.bat
  2. +1 −12 bin/draw.sh
  3. +4 −0 doc/API_Changes.txt
  4. +2 −2 doc/manual/en/modules/advanced.xml
  5. +1 −1 doc/manual/en/modules/api.xml
  6. +2 −2 src/org/jgroups/MergeView.java
  7. +6 −7 src/org/jgroups/Message.java
  8. +2 −2 src/org/jgroups/View.java
  9. +2 −2 src/org/jgroups/ViewId.java
  10. +6 −4 src/org/jgroups/auth/FixedMembershipToken.java
  11. +4 −4 src/org/jgroups/auth/MD5Token.java
  12. +5 −4 src/org/jgroups/auth/RegexMembership.java
  13. +6 −4 src/org/jgroups/auth/SimpleToken.java
  14. +4 −4 src/org/jgroups/auth/X509Token.java
  15. +2 −2 src/org/jgroups/blocks/GridFile.java
  16. +1 −1 src/org/jgroups/blocks/ReplicatedTree.java
  17. +6 −6 src/org/jgroups/blocks/RequestCorrelator.java
  18. +3 −7 src/org/jgroups/blocks/executor/ExecutionService.java
  19. +4 −4 src/org/jgroups/blocks/executor/Executions.java
  20. +4 −4 src/org/jgroups/blocks/locking/Owner.java
  21. +4 −4 src/org/jgroups/blocks/mux/MuxHeader.java
  22. +4 −4 src/org/jgroups/demos/DrawCommand.java
  23. +9 −14 src/org/jgroups/demos/ExecutionServiceDemo.java
  24. +2 −2 src/org/jgroups/protocols/AuthHeader.java
  25. +2 −2 src/org/jgroups/protocols/COMPRESS.java
  26. +4 −4 src/org/jgroups/protocols/DAISYCHAIN.java
  27. +2 −2 src/org/jgroups/protocols/DISCARD.java
  28. +4 −5 src/org/jgroups/protocols/ENCRYPT.java
  29. +5 −10 src/org/jgroups/protocols/Executing.java
  30. +2 −2 src/org/jgroups/protocols/FD.java
  31. +4 −4 src/org/jgroups/protocols/FD_ALL.java
  32. +2 −2 src/org/jgroups/protocols/FD_SIMPLE.java
  33. +2 −2 src/org/jgroups/protocols/FD_SOCK.java
  34. +4 −4 src/org/jgroups/protocols/FcHeader.java
  35. +2 −2 src/org/jgroups/protocols/FragHeader.java
  36. +2 −2 src/org/jgroups/protocols/HTOTAL.java
  37. +6 −6 src/org/jgroups/protocols/Locking.java
  38. +4 −4 src/org/jgroups/protocols/PingData.java
  39. +2 −2 src/org/jgroups/protocols/PingHeader.java
  40. +4 −4 src/org/jgroups/protocols/PrioHeader.java
  41. +6 −6 src/org/jgroups/protocols/RELAY.java
  42. +4 −4 src/org/jgroups/protocols/SCOPE.java
  43. +2 −2 src/org/jgroups/protocols/SEQUENCER.java
  44. +4 −4 src/org/jgroups/protocols/SMACK.java
  45. +3 −6 src/org/jgroups/protocols/STOMP.java
  46. +2 −2 src/org/jgroups/protocols/TpHeader.java
  47. +4 −4 src/org/jgroups/protocols/UNICAST.java
  48. +4 −4 src/org/jgroups/protocols/UNICAST2.java
  49. +2 −2 src/org/jgroups/protocols/VERIFY_SUSPECT.java
  50. +2 −2 src/org/jgroups/protocols/pbcast/FLUSH.java
  51. +2 −2 src/org/jgroups/protocols/pbcast/GMS.java
  52. +4 −4 src/org/jgroups/protocols/pbcast/JoinRsp.java
  53. +2 −2 src/org/jgroups/protocols/pbcast/NakAckHeader.java
  54. +2 −2 src/org/jgroups/protocols/pbcast/STABLE.java
  55. +2 −3 src/org/jgroups/protocols/pbcast/STATE_TRANSFER.java
  56. +2 −2 src/org/jgroups/protocols/pbcast/STREAMING_STATE_TRANSFER.java
  57. +4 −4 src/org/jgroups/stack/GossipData.java
  58. +2 −2 src/org/jgroups/stack/IpAddress.java
  59. +2 −2 src/org/jgroups/util/AdditionalDataUUID.java
  60. +4 −4 src/org/jgroups/util/Digest.java
  61. +4 −4 src/org/jgroups/util/MergeId.java
  62. +2 −2 src/org/jgroups/util/PayloadUUID.java
  63. +2 −2 src/org/jgroups/util/Range.java
  64. +2 −2 src/org/jgroups/util/SingletonAddress.java
  65. +4 −4 src/org/jgroups/util/Streamable.java
  66. +2 −2 src/org/jgroups/util/TopologyUUID.java
  67. +2 −2 src/org/jgroups/util/UUID.java
  68. +100 −100 src/org/jgroups/util/Util.java
  69. +2 −2 tests/junit-functional/org/jgroups/protocols/ENCRYPT14KeystoreTest.java
  70. +2 −2 tests/junit-functional/org/jgroups/protocols/ENCRYPTAsymmetricTest.java
  71. +1 −1 tests/junit-functional/org/jgroups/tests/ConfiguratorTest.java
  72. +1 −1 tests/junit-functional/org/jgroups/tests/CustomProtocolTest.java
  73. +2 −2 tests/junit-functional/org/jgroups/tests/HeadersTest.java
  74. +4 −8 tests/junit-functional/org/jgroups/tests/MessageTest.java
  75. +6 −6 tests/junit/org/jgroups/blocks/ExecutingServiceTest.java
  76. +1 −1 tests/junit/org/jgroups/protocols/GMS_MergeTest.java
  77. +2 −2 tests/junit/org/jgroups/tests/EncryptMessageOrderTestCase.java
  78. +3 −3 tests/junit/org/jgroups/tests/SendAndReceiveTest.java
  79. +1 −1 tests/other/org/jgroups/tests/RpcDispatcherStressTest.java
  80. +5 −6 tests/other/org/jgroups/tests/UnicastTest.java
  81. +6 −6 tests/other/org/jgroups/tests/UnicastTestRpcDist.java
  82. +2 −3 tests/perf/org/jgroups/tests/perf/Data.java
  83. +4 −4 tests/perf/org/jgroups/tests/perf/MemberInfo.java
View
@@ -11,7 +11,7 @@ set PROPS=%PROPS%:TCPGOSSIP(initial_hosts=localhost[5556];gossip_refresh_rate=10
set PROPS=%PROPS%:MERGE2(min_interval=5000;max_interval=10000)
set PROPS=%PROPS%:FD_SOCK
set PROPS=%PROPS%:VERIFY_SUSPECT(timeout=1500)
-set PROPS=%PROPS%:pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800)
+set PROPS=%PROPS%:pbcast.NAKACK(retransmit_timeout=600,1200,2400,4800)
set PROPS=%PROPS%:UNICAST(timeout=600,1200,2400,4800)
set PROPS=%PROPS%:pbcast.STABLE(desired_avg_gossip=20000)
set PROPS=%PROPS%:FRAG(frag_size=8096;down_thread=false;up_thread=false)
View
@@ -29,23 +29,12 @@ CLASSPATH="$relpath/../classes$SEP$relpath/../conf$SEP"
if [ "$debug" = "true" ]; then
JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=jgc1"
fi
-PROPS="\
-TUNNEL(router_host=localhost;router_port=5556):\
-TCPGOSSIP(initial_hosts=localhost[5556];gossip_refresh_rate=10000;num_initial_members=3;up_thread=true;down_thread=true):\
-MERGE2(min_interval=5000;max_interval=10000):\
-FD_SOCK:\
-VERIFY_SUSPECT(timeout=1500):\
-pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):\
-UNICAST(timeout=600,1200,2400,4800):\
-pbcast.STABLE(desired_avg_gossip=20000):\
-FRAG(frag_size=8096;down_thread=false;up_thread=false):\
-pbcast.GMS(join_timeout=5000;print_local_addr=true)"
if [ "$cygwin" = "true" ]; then
CLASSPATH=`echo $CLASSPATH | sed -e 's/\;/\\\\;/g'`
fi
-java -classpath $CLASSPATH $JAVA_OPTS org.jgroups.demos.Draw -props $PROPS $*
+java -classpath $CLASSPATH $JAVA_OPTS org.jgroups.demos.Draw $*
View
@@ -34,6 +34,10 @@ API changes in 3.0.0
- Removed deprecated methods and classes
+- Streamable: DataInputStream --> DataInput, DataOutputStream --> DataOutput
+
+
+
@@ -138,7 +138,7 @@
<FD timeout="10000" max_tries="5" shun="true"/>
<VERIFY_SUSPECT timeout="1500" />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"/>
@@ -417,7 +417,7 @@
num_initial_members="3"/>
<VERIFY_SUSPECT timeout="1500" />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
@@ -575,7 +575,7 @@
<VERIFY_SUSPECT timeout="1500" />
<BARRIER />
<pbcast.NAKACK
- use_mcast_xmit="false" gc_lag="0"
+ use_mcast_xmit="false"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200,2400,3600"/>
@@ -97,7 +97,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
super.writeTo(out);
// write subgroups
@@ -114,7 +114,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
super.readFrom(in);
short len=in.readShort();
if(len > 0) {
@@ -10,9 +10,7 @@
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import java.io.*;
import java.util.Map;
@@ -527,10 +525,11 @@ public String printObjectHeaders() {
/**
* Streams all members (dest and src addresses, buffer and headers) to the output stream.
+ *
* @param out
* @throws IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
byte leading=0;
if(dest_addr != null)
@@ -623,7 +622,7 @@ public void writeToNoAddrs(Address src, DataOutputStream out) throws IOException
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
// 1. read the leading byte first
byte leading=in.readByte();
@@ -751,14 +750,14 @@ public static String transientFlagsToString(byte flags) {
return sb.toString();
}
- private static void writeHeader(Header hdr, DataOutputStream out) throws IOException {
+ private static void writeHeader(Header hdr, DataOutput out) throws IOException {
short magic_number=ClassConfigurator.getMagicNumber(hdr.getClass());
out.writeShort(magic_number);
hdr.writeTo(out);
}
- private static Header readHeader(DataInputStream in) throws IOException {
+ private static Header readHeader(DataInput in) throws IOException {
try {
short magic_number=in.readShort();
Class clazz=ClassConfigurator.get(magic_number);
@@ -182,7 +182,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
// vid
if(vid != null) {
out.writeBoolean(true);
@@ -196,7 +196,7 @@ public void writeTo(DataOutputStream out) throws IOException {
}
@SuppressWarnings("unchecked")
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
boolean b;
// vid:
b=in.readBoolean();
@@ -124,12 +124,12 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
id=in.readLong();
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
Util.writeAddress(coord_addr, out);
out.writeLong(id);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
coord_addr=Util.readAddress(in);
id=in.readLong();
}
@@ -21,8 +21,8 @@
*/
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -122,10 +122,11 @@ public void setMemberList(String list) {
/**
* Required to serialize the object to pass across the wire
*
+ *
* @param out
* @throws java.io.IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken writeTo()");
}
@@ -135,12 +136,13 @@ public void writeTo(DataOutputStream out) throws IOException {
/**
* Required to deserialize the object when read in from the wire
*
+ *
* @param in
* @throws IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken readFrom()");
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import org.jgroups.Message;
@@ -121,14 +121,14 @@ public boolean authenticate(AuthToken token, Message msg) {
return false;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("MD5Token writeTo()");
}
Util.writeString(this.auth_value, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("MD5Token readFrom()");
@@ -28,8 +28,8 @@
import org.jgroups.annotations.Property;
import org.jgroups.util.UUID;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -111,16 +111,17 @@ public boolean authenticate(AuthToken token, Message msg) {
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
}
/**
* Required to deserialize the object when read in from the wire
+ *
* @param in
* @throws java.io.IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
}
}
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import org.jgroups.Message;
@@ -77,10 +77,11 @@ public boolean authenticate(AuthToken token, Message msg) {
/**
* Required to serialize the object to pass across the wire
*
+ *
* @param out
* @throws IOException
*/
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken writeTo()");
}
@@ -90,12 +91,13 @@ public void writeTo(DataOutputStream out) throws IOException {
/**
* Required to deserialize the object when read in from the wire
*
+ *
* @param in
* @throws IOException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("SimpleToken readFrom()");
@@ -1,7 +1,7 @@
package org.jgroups.auth;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.KeyStore;
@@ -146,14 +146,14 @@ public boolean authenticate(AuthToken token, Message msg) {
return false;
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
if (log.isDebugEnabled()) {
log.debug("X509Token writeTo()");
}
Util.writeByteBuffer(this.encryptedToken, out);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException,
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException,
InstantiationException {
if (log.isDebugEnabled()) {
log.debug("X509Token readFrom()");
@@ -365,14 +365,14 @@ public String toString() {
return sb.toString();
}
- public void writeTo(DataOutputStream out) throws IOException {
+ public void writeTo(DataOutput out) throws IOException {
out.writeInt(length);
out.writeLong(modification_time);
out.writeInt(chunk_size);
out.writeByte(flags);
}
- public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException {
+ public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException {
length=in.readInt();
modification_time=in.readLong();
chunk_size=in.readInt();
@@ -964,7 +964,7 @@ public static void main(String[] args) {
"FD_SOCK:" +
"VERIFY_SUSPECT(timeout=1500):" +
"pbcast.STABLE(desired_avg_gossip=20000):" +
- "pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):" +
+ "pbcast.NAKACK(retransmit_timeout=600,1200,2400,4800):" +
"UNICAST(timeout=5000):" +
"FRAG(frag_size=16000;down_thread=false;up_thread=false):" +
"pbcast.GMS(join_timeout=5000;" +
Oops, something went wrong.

0 comments on commit 89c803e

Please sign in to comment.