incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject git commit: Commit https://reviews.apache.org/r/8075/
Date Mon, 19 Nov 2012 11:03:36 GMT
Updated Branches:
  refs/heads/master 1169464e3 -> c8832cd4b


Commit https://reviews.apache.org/r/8075/

Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/c8832cd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/c8832cd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/c8832cd4

Branch: refs/heads/master
Commit: c8832cd4b64c2e395fabf5fff2461fcd8097adc0
Parents: 1169464
Author: Hiroaki Kawai <kawai@stratosphere.co.jp>
Authored: Mon Nov 19 12:02:26 2012 +0100
Committer: Hugo Trippaers <hugo@Hugos-MacBook-Pro.local>
Committed: Mon Nov 19 12:02:26 2012 +0100

----------------------------------------------------------------------
 agent/src/com/cloud/agent/AgentShell.java          |    4 +++-
 .../com/cloud/bridge/io/S3CAStorBucketAdapter.java |    4 +++-
 .../storage/template/HttpTemplateDownloader.java   |    4 +++-
 .../src/com/cloud/network/nicira/NiciraNvpApi.java |    4 +++-
 server/src/com/cloud/maint/UpgradeManagerImpl.java |    4 +++-
 5 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8832cd4/agent/src/com/cloud/agent/AgentShell.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index 05caf8e..774f222 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -39,6 +39,7 @@ import java.util.UUID;
 import javax.naming.ConfigurationException;
 
 import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.log4j.Logger;
 
@@ -61,6 +62,7 @@ import com.cloud.utils.script.Script;
 public class AgentShell implements IAgentShell {
     private static final Logger s_logger = Logger.getLogger(AgentShell.class
             .getName());
+    private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
     private final Properties _properties = new Properties();
     private final Map<String, Object> _cmdLineProperties = new HashMap<String, Object>();
@@ -224,7 +226,7 @@ public class AgentShell implements IAgentShell {
     }
 
     public static void wget(String url, File file) throws IOException {
-        final HttpClient client = new HttpClient();
+        final HttpClient client = new HttpClient(s_httpClientManager);
         final GetMethod method = new GetMethod(url);
         int response;
         response = client.executeMethod(method);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8832cd4/awsapi/src/com/cloud/bridge/io/S3CAStorBucketAdapter.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/io/S3CAStorBucketAdapter.java b/awsapi/src/com/cloud/bridge/io/S3CAStorBucketAdapter.java
index ad6f6cd..2101afe 100644
--- a/awsapi/src/com/cloud/bridge/io/S3CAStorBucketAdapter.java
+++ b/awsapi/src/com/cloud/bridge/io/S3CAStorBucketAdapter.java
@@ -58,6 +58,7 @@ import com.caringo.client.ScspResponse;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 
 /**
  * Creates an SCSP client to a CAStor cluster, configured in "storage.root",
@@ -65,6 +66,7 @@ import org.apache.commons.httpclient.Header;
  */
 public class S3CAStorBucketAdapter implements S3BucketAdapter {
     protected final static Logger s_logger = Logger.getLogger(S3CAStorBucketAdapter.class);
+    private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
     private static final int HTTP_OK = 200;
     private static final int HTTP_CREATED = 201;
@@ -444,7 +446,7 @@ public class S3CAStorBucketAdapter implements S3BucketAdapter {
     @Override
     public DataHandler loadObjectRange(String mountedRoot, String bucket, String fileName,
long startPos, long endPos) {
         try {
-            HttpClient httpClient = new HttpClient();
+            HttpClient httpClient = new HttpClient(s_httpClientManager);
             // Create a method instance.
             GetMethod method = new GetMethod(castorURL(mountedRoot, bucket, fileName));
             method.addRequestHeader("Range", "bytes=" + startPos + "-" + endPos);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8832cd4/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
index bd607b3..628ad64 100644
--- a/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/HttpTemplateDownloader.java
@@ -37,6 +37,7 @@ import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.HttpMethodRetryHandler;
 import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.NoHttpResponseException;
 import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.auth.AuthScope;
@@ -56,6 +57,7 @@ import com.cloud.utils.Pair;
  */
 public class HttpTemplateDownloader implements TemplateDownloader {
 	public static final Logger s_logger = Logger.getLogger(HttpTemplateDownloader.class.getName());
+    private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
 	private static final int CHUNK_SIZE = 1024*1024; //1M
 	private String downloadUrl;
@@ -88,7 +90,7 @@ public class HttpTemplateDownloader implements TemplateDownloader {
 		this.MAX_TEMPLATE_SIZE_IN_BYTES = maxTemplateSizeInBytes;
 		
 		this.totalBytes = 0;
-		this.client = new HttpClient();
+		this.client = new HttpClient(s_httpClientManager);
 
 		myretryhandler = new HttpMethodRetryHandler() {
 		    public boolean retryMethod(

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8832cd4/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java
b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java
index 6aeb877..26e7e0d 100644
--- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java
+++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java
@@ -44,6 +44,7 @@ import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethodBase;
 import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.cookie.CookiePolicy;
 import org.apache.commons.httpclient.methods.DeleteMethod;
@@ -62,6 +63,7 @@ import com.google.gson.reflect.TypeToken;
 public class NiciraNvpApi {
     private static final Logger s_logger = Logger.getLogger(NiciraNvpApi.class);
     private final static String _protocol = "https";
+    private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
     
     private String _name;
     private String _host;
@@ -79,7 +81,7 @@ public class NiciraNvpApi {
             throw new NiciraNvpApiException("host, adminuser and adminpass may not be null");
         }
 
-        _client = new HttpClient( );
+        _client = new HttpClient(s_httpClientManager);
         _client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
         
         try {             

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c8832cd4/server/src/com/cloud/maint/UpgradeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/maint/UpgradeManagerImpl.java b/server/src/com/cloud/maint/UpgradeManagerImpl.java
index b4bc291..c1ce3f0 100644
--- a/server/src/com/cloud/maint/UpgradeManagerImpl.java
+++ b/server/src/com/cloud/maint/UpgradeManagerImpl.java
@@ -36,6 +36,7 @@ import javax.naming.ConfigurationException;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.log4j.Logger;
 
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -54,6 +55,7 @@ import com.cloud.utils.component.ComponentLocator;
 @Local(UpgradeManager.class)
 public class UpgradeManagerImpl implements UpgradeManager {
 	private final static Logger s_logger = Logger.getLogger(UpgradeManagerImpl.class);
+    private static final MultiThreadedHttpConnectionManager s_httpClientManager = new MultiThreadedHttpConnectionManager();
 
     String _name;
     String _minimalVersion;
@@ -92,7 +94,7 @@ public class UpgradeManagerImpl implements UpgradeManager {
     public String deployNewAgent(String url) {
         s_logger.info("Updating agent with binary from " + url);
 
-        final HttpClient client = new HttpClient();
+        final HttpClient client = new HttpClient(s_httpClientManager);
         final GetMethod method = new GetMethod(url);
         int response;
         File file = null;


Mime
View raw message