manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1226468 - in /incubator/lcf/integration/solr-4.x/trunk: CHANGES.txt mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
Date Mon, 02 Jan 2012 16:44:23 GMT
Author: kwright
Date: Mon Jan  2 16:44:23 2012
New Revision: 1226468

URL: http://svn.apache.org/viewvc?rev=1226468&view=rev
Log:
Fix for CONNECTORS-354

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

Modified: incubator/lcf/integration/solr-4.x/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/integration/solr-4.x/trunk/CHANGES.txt?rev=1226468&r1=1226467&r2=1226468&view=diff
==============================================================================
--- incubator/lcf/integration/solr-4.x/trunk/CHANGES.txt (original)
+++ incubator/lcf/integration/solr-4.x/trunk/CHANGES.txt Mon Jan  2 16:44:23 2012
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 0.2-incubating-dev =====================
 
+CONNECTORS-354: Add a parameter to allow the maximum connection pool
+size to be configurated in solrconfig.xml.
+(Karl Wright)
+
 CONNECTORS-333: Use multithreaded connection manager and tcp-no-delay
 in order to avoid sockets accumulating in CLOSE_WAIT.
 (Simon Willnauer via Karl Wright)

Modified: incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
URL: http://svn.apache.org/viewvc/incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java?rev=1226468&r1=1226467&r2=1226468&view=diff
==============================================================================
--- incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
(original)
+++ incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFQParserPlugin.java
Mon Jan  2 16:44:23 2012
@@ -79,6 +79,7 @@ public class ManifoldCFQParserPlugin ext
   int socketTimeOut;
   MultiThreadedHttpConnectionManager httpConnectionManager = null;
   HttpClient client = null;
+  int poolSize;
   
   public ManifoldCFQParserPlugin()
   {
@@ -103,14 +104,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-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
URL: http://svn.apache.org/viewvc/incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java?rev=1226468&r1=1226467&r2=1226468&view=diff
==============================================================================
--- incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
(original)
+++ incubator/lcf/integration/solr-4.x/trunk/mcf/src/java/org/apache/solr/mcf/ManifoldCFSearchComponent.java
Mon Jan  2 16:44:23 2012
@@ -71,6 +71,7 @@ public class ManifoldCFSearchComponent e
   int socketTimeOut;
   MultiThreadedHttpConnectionManager httpConnectionManager = null;
   HttpClient client = null;
+  int poolSize;
   
   public ManifoldCFSearchComponent()
   {
@@ -96,16 +97,18 @@ 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);
-
   }
 
   @Override



Mime
View raw message