Skip to content
Browse files

Cleanup of connection flag for retry (minor) - TESTED

  • Loading branch information...
1 parent af6c58e commit f07aa3661520cf2a5dd9f01a6c52967e2d7a6503 @alphazero committed Oct 11, 2011
View
3 core/api/src/main/java/org/jredis/connector/Connection.java
@@ -172,8 +172,7 @@
MODALITY,
/** On Connect (or reconnect after faults or timeouts) the maximum duration that you are willing to wait, milliseconds */
MAX_CONNECT_WAIT,
- /** To be deprecated -- number of reconnect attempts after timeouts or faults. */
- @Deprecated
+ /** number of reconnect attempts after timeouts or faults. */
MAX_CONNECT_ATTEMPT,
/** if specified, is used to create the new protocol */
PROTOCOL_CLASS,
View
2 core/api/src/main/java/org/jredis/connector/ConnectionSpec.java
@@ -154,7 +154,7 @@
public int getReconnectCnt ();
/**
* @param cnt
- * @return the {@link ConnectionSpec}
+ * @return the {@link ConnectionSpec}
*/
public ConnectionSpec setReconnectCnt(int cnt);
/**
View
22 core/ri/src/main/java/org/jredis/ri/alphazero/connection/DefaultConnectionSpec.java
@@ -52,23 +52,21 @@
static final int DEFAULT_REDIS_DB = 0;
static final byte[] DEFAULT_REDIS_PASSWORD = null;
- /** defaults to 3 */
- static final int DEFAULT_RECONNECT_CNT = 3;
- /** defautls to 48KB */
+ /** def value: <code>48KB</code> */
private static final int DEFAULT_RCV_BUFF_SIZE = 1024 * 48;
- /** defaults to 48KB */
+ /** def value: <code>48KB</code> */
private static final int DEFAULT_SND_BUFF_SIZE = 1024 * 48;
- /** defaults to 5000 msecs */
+ /** def value: <code>5000 msecs</code> */
static final int DEFAULT_READ_TIMEOUT_MSEC = 5000;
- /** defaults to 1 second (the min on Redis) */
+ /** def value: <code>1</code> sec. (min timeout in redis conf */
static final int DEFAULT_HEARTBEAT_SEC = 1;
- /** higher priority pref is bandwidth */
+ /** def value: <code>0</code> e.g. higher priority pref is bandwidth */
private static final int DEFAULT_SO_PREF_BANDWIDTH = 0;
- /** second priority pref is latency */
+ /** def value: <code>1</code> e.g. second priority pref is latency */
private static final int DEFAULT_SO_PREF_LATENCY = 1;
- /** thrid priority pref is connection time */
+ /** def value: <code>3</code> e.g. third priority pref is connection time */
private static final int DEFAULT_SO_PREF_CONN_TIME = 2;
/** def value: <code>true</code> */
@@ -85,7 +83,7 @@
/** def value: <code>Modality.Synchronous</code> */
private static final Modality DEFAULT_CP_CONN_MODALITY = Modality.Synchronous;
/** def value: <code>3</code> */
- private static final Integer DEFAULT_CP_MAX_CONNECT_ATTEMPT = 3;
+ private static final int DEFAULT_CP_MAX_CONNECT_ATTEMPT = 3;
// ------------------------------------------------------------------------
// Constructors
@@ -139,8 +137,8 @@ public DefaultConnectionSpec (InetAddress address, int port, int database, byte[
* @see DefaultProtocolFactory
*/
private void setDefaultValues () {
- // reconnect try count
- setReconnectCnt(DEFAULT_RECONNECT_CNT);
+// // reconnect try count
+// setReconnectCnt(DEFAULT_CP_MAX_CONNECT_ATTEMPT);
// tcp socket flags
setSocketFlag(Connection.Socket.Flag.SO_KEEP_ALIVE, true);

0 comments on commit f07aa36

Please sign in to comment.
Something went wrong with that request. Please try again.