Chris Lu
5 years ago
10 changed files with 43 additions and 25 deletions
-
2other/java/client/pom.xml
-
2other/java/client/pom_debug.xml
-
5other/java/client/src/main/java/seaweedfs/client/FilerClient.java
-
11other/java/client/src/main/java/seaweedfs/client/SeaweedRead.java
-
24other/java/client/src/main/java/seaweedfs/client/SeaweedUtil.java
-
16other/java/client/src/main/java/seaweedfs/client/SeaweedWrite.java
-
2other/java/hdfs2/dependency-reduced-pom.xml
-
2other/java/hdfs2/pom.xml
-
2other/java/hdfs3/dependency-reduced-pom.xml
-
2other/java/hdfs3/pom.xml
@ -0,0 +1,24 @@ |
|||||
|
package seaweedfs.client; |
||||
|
|
||||
|
import org.apache.http.client.HttpClient; |
||||
|
import org.apache.http.impl.client.CloseableHttpClient; |
||||
|
import org.apache.http.impl.client.HttpClientBuilder; |
||||
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
||||
|
|
||||
|
public class SeaweedUtil { |
||||
|
|
||||
|
static PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); |
||||
|
|
||||
|
static { |
||||
|
// Increase max total connection to 200 |
||||
|
cm.setMaxTotal(200); |
||||
|
// Increase default max connection per route to 20 |
||||
|
cm.setDefaultMaxPerRoute(20); |
||||
|
} |
||||
|
|
||||
|
public static CloseableHttpClient getClosableHttpClient() { |
||||
|
return HttpClientBuilder.create() |
||||
|
.setConnectionManager(cm) |
||||
|
.build(); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue