manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1226464 - in /incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf: ManifoldCFQParserPlugin.java ManifoldCFSearchComponent.java
Date Mon, 02 Jan 2012 16:38:39 GMT
Author: kwright
Date: Mon Jan  2 16:38:38 2012
New Revision: 1226464

URL: http://svn.apache.org/viewvc?rev=1226464&view=rev
Log:
Fix for CONNECTORS-354.  Add ConnectionPoolSize integer parameter.

Modified:
    incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
    incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java

Modified: incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
URL: http://svn.apache.org/viewvc/incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java?rev=1226464&r1=1226463&r2=1226464&view=diff
==============================================================================
--- incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
(original)
+++ incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
Mon Jan  2 16:38:38 2012
@@ -78,6 +78,7 @@ public class ManifoldCFQParserPlugin ext
   int socketTimeOut;
   MultiThreadedHttpConnectionManager httpConnectionManager = null;
   HttpClient client = null;
+  int poolSize;
   
   public ManifoldCFQParserPlugin()
   {
@@ -101,14 +102,17 @@ public class ManifoldCFQParserPlugin ext
     fieldDenyDocument = denyAttributePrefix+"document";
     fieldAllowShare = allowAttributePrefix+"share";
     fieldDenyShare = denyAttributePrefix+"share";
+    Integer connectionPoolSize = (Integer)args.get("ConnectionPoolSize");
+    poolSize = (connectionPoolSize==null)?50:connectionPoolSize.intValue();
 
     // Initialize the connection pool
     HttpConnectionManagerParams params = new HttpConnectionManagerParams();
     params.setTcpNoDelay(true);
     params.setStaleCheckingEnabled(false);
+    params.setDefaultMaxConnectionsPerHost(poolSize);
+    params.setMaxTotalConnections(poolSize);
     httpConnectionManager = new MultiThreadedHttpConnectionManager();
     httpConnectionManager.setParams(params);
-    // MHL to set the pool size
     client = new HttpClient(httpConnectionManager);
   }
 

Modified: incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
URL: http://svn.apache.org/viewvc/incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java?rev=1226464&r1=1226463&r2=1226464&view=diff
==============================================================================
--- incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
(original)
+++ incubator/lcf/integration/solr-3.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
Mon Jan  2 16:38:38 2012
@@ -70,6 +70,7 @@ public class ManifoldCFSearchComponent e
   int socketTimeOut;
   MultiThreadedHttpConnectionManager httpConnectionManager = null;
   HttpClient client = null;
+  int poolSize;
   
   public ManifoldCFSearchComponent()
   {
@@ -103,14 +104,17 @@ public class ManifoldCFSearchComponent e
     fieldDenyDocument = denyAttributePrefix+"document";
     fieldAllowShare = allowAttributePrefix+"share";
     fieldDenyShare = denyAttributePrefix+"share";
-    
+    Integer connectionPoolSize = (Integer)args.get("ConnectionPoolSize");
+    poolSize = (connectionPoolSize==null)?50:connectionPoolSize.intValue();
+
     // Initialize the connection pool
     HttpConnectionManagerParams params = new HttpConnectionManagerParams();
     params.setTcpNoDelay(true);
     params.setStaleCheckingEnabled(false);
+    params.setDefaultMaxConnectionsPerHost(poolSize);
+    params.setMaxTotalConnections(poolSize);
     httpConnectionManager = new MultiThreadedHttpConnectionManager();
     httpConnectionManager.setParams(params);
-    // MHL to set the pool size
     client = new HttpClient(httpConnectionManager);
   }
 



Mime
View raw message