incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1183322 - in /incubator/accumulo/branches/1.3/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:14:57 GMT
Author: ecn
Date: Fri Oct 14 12:14:56 2011
New Revision: 1183322

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

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

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1183322&r1=1183321&r2=1183322&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
(original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
Fri Oct 14 12:14:56 2011
@@ -78,6 +78,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/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1183322&r1=1183321&r2=1183322&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ incubator/accumulo/branches/1.3/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Fri Oct 14 12:14:56 2011
@@ -1040,7 +1040,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);
@@ -1049,7 +1050,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);
@@ -1068,7 +1069,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