incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1183326 - in /incubator/accumulo/trunk/src: core/src/main/java/org/apache/accumulo/core/conf/Property.java server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Date Fri, 14 Oct 2011 12:24:38 GMT
Author: ecn
Date: Fri Oct 14 12:24:38 2011
New Revision: 1183326

URL: http://svn.apache.org/viewvc?rev=1183326&view=rev
Log:
ACCUMULO-28 make the client timeout configurable

Modified:
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1183326&r1=1183325&r2=1183326&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
Fri Oct 14 12:24:38 2011
@@ -93,6 +93,8 @@ public enum Property
 	TSERV_PREFIX("tserver.",null,
 			PropertyType.PREFIX,
 			"Properties in this category affect the behavior of the tablet servers"),
+	TSERV_CLIENT_TIMEOUT("tserver.client.timeout", "3s", PropertyType.TIMEDURATION, 
+			"Time to wait for clients to continue scans before closing a session."),
 	TSERV_DEFAULT_BLOCKSIZE("tserver.default.blocksize", "1M",
 						PropertyType.MEMORY,
 						"Specifies a default blocksize for the tserver caches"),

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1183326&r1=1183325&r2=1183326&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Fri Oct 14 12:24:38 2011
@@ -1130,6 +1130,8 @@ public class TabletServer extends Abstra
         private ScanResult continueScan(TInfo tinfo, long scanID, ScanSession scanSession)
                 throws NoSuchScanIDException, NotServingTabletException,
                 org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException {
+        	
+        	long timeout = acuConf.getTimeInMillis(Property.TSERV_CLIENT_TIMEOUT);
 
             if (scanSession.nextBatchTask == null) {
                 scanSession.nextBatchTask = new NextBatchTask(scanID, scanSession.interruptFlag);
@@ -1138,7 +1140,7 @@ public class TabletServer extends Abstra
 
             ScanBatch bresult;
             try {
-                bresult = scanSession.nextBatchTask.get(3, TimeUnit.SECONDS);
+                bresult = scanSession.nextBatchTask.get(timeout, TimeUnit.MILLISECONDS);
                 scanSession.nextBatchTask = null;
             } catch (ExecutionException e) {
                 sessionManager.removeSession(scanID);
@@ -1157,7 +1159,7 @@ public class TabletServer extends Abstra
                     throw new NoSuchScanIDException();
             } catch (TimeoutException e) {
                 List<TKeyValue> param = Collections.emptyList();
-                sessionManager.removeIfNotAccessed(scanID, 3000);
+                sessionManager.removeIfNotAccessed(scanID, timeout);
                 return new ScanResult(param, true);
             } catch (Throwable t) {
                 sessionManager.removeSession(scanID);



Mime
View raw message