Permalink
Browse files

Add helper setter methods for setting ms. This is useful for spring w…

…iring.
  • Loading branch information...
jkreps committed Jun 23, 2009
1 parent 90e07b0 commit ae68f2ffd867b29fc674abfd21a84cb7107a491d
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/java/voldemort/client/ClientConfig.java
@@ -98,6 +98,10 @@ public ClientConfig setSocketTimeout(int socketTimeout, TimeUnit unit) {
return this;
}
+ public ClientConfig setSocketTimeoutMs(int socketTimeoutMs) {
+ return setSocketTimeout(socketTimeoutMs, TimeUnit.MILLISECONDS);
+ }
+
public int getRoutingTimeout(TimeUnit unit) {
return toInt(unit.convert(routingTimeoutMs, TimeUnit.MILLISECONDS));
}
@@ -115,6 +119,10 @@ public ClientConfig setRoutingTimeout(int routingTimeout, TimeUnit unit) {
return this;
}
+ public ClientConfig setRoutingTimeoutMs(int routingTimeoutMs) {
+ return setRoutingTimeout(routingTimeoutMs, TimeUnit.MILLISECONDS);
+ }
+
public int getNodeBannagePeriod(TimeUnit unit) {
return toInt(unit.convert(defaultNodeBannageMs, TimeUnit.MILLISECONDS));
}
@@ -130,6 +138,10 @@ public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, TimeUnit unit) {
return this;
}
+ public ClientConfig setNodeBannagePeriodMs(int nodeBannagePeriodMs) {
+ return setNodeBannagePeriodMs(nodeBannagePeriodMs);
+ }
+
public int getConnectionTimeout(TimeUnit unit) {
return (int) Math.min(unit.convert(connectionTimeoutMs, TimeUnit.MILLISECONDS),
Integer.MAX_VALUE);
@@ -146,6 +158,10 @@ public ClientConfig setConnectionTimeout(int connectionTimeout, TimeUnit unit) {
return this;
}
+ public ClientConfig setConnectionTimeoutMs(int connectionTimeoutMs) {
+ return setConnectionTimeout(connectionTimeoutMs, TimeUnit.MILLISECONDS);
+ }
+
public int getThreadIdleTime(TimeUnit unit) {
return toInt(unit.convert(threadIdleMs, TimeUnit.MILLISECONDS));
}
@@ -160,6 +176,10 @@ public ClientConfig setThreadIdleTime(long threadIdleTime, TimeUnit unit) {
return this;
}
+ public ClientConfig setThreadIdleTimeMs(long threadIdleTimeMs) {
+ return setThreadIdleTime(threadIdleTimeMs, TimeUnit.MILLISECONDS);
+ }
+
public int getMaxQueuedRequests() {
return maxQueuedRequests;
}

0 comments on commit ae68f2f

Please sign in to comment.