Issue #1257: Update grib path keys to include hdf5 layout. Turn on TcpNoDelay
Change-Id: I296d0d4b1c204a325c499b3aeb1f9d7f16de0c9b Former-commit-id:f5fe7cf872
[formerlye32d77c87f
] [formerly68ac1abca4
] [formerlyc5e3b54caa
[formerly68ac1abca4
[formerly 29b54f75013685f1bcd9ed3129c9ba3ddf629395]]] Former-commit-id:c5e3b54caa
Former-commit-id: a0fc10b28ef8f7a0ad614832eb3f6018b40d3685 [formerlya80db469b2
] Former-commit-id:19797b9064
This commit is contained in:
parent
21424b947e
commit
4c990fa2b7
2 changed files with 15 additions and 6 deletions
|
@ -4,5 +4,9 @@
|
||||||
<key>modelInfo.modelName</key>
|
<key>modelInfo.modelName</key>
|
||||||
<order>0</order>
|
<order>0</order>
|
||||||
</pathKey>
|
</pathKey>
|
||||||
|
<pathKey>
|
||||||
|
<key>modelInfo.level</key>
|
||||||
|
<order>1</order>
|
||||||
|
</pathKey>
|
||||||
</pathKeySet>
|
</pathKeySet>
|
||||||
|
|
||||||
|
|
|
@ -109,20 +109,22 @@ public class HttpClient {
|
||||||
|
|
||||||
private ThreadSafeClientConnManager connManager = null;
|
private ThreadSafeClientConnManager connManager = null;
|
||||||
|
|
||||||
private NetworkStatistics stats = new NetworkStatistics();
|
private final NetworkStatistics stats = new NetworkStatistics();
|
||||||
|
|
||||||
private boolean gzipRequests = false;
|
private boolean gzipRequests = false;
|
||||||
|
|
||||||
private boolean handlingGzipResponses = false;
|
private boolean handlingGzipResponses = false;
|
||||||
|
|
||||||
/** number of requests currently in process by the application per host */
|
/** number of requests currently in process by the application per host */
|
||||||
private Map<String, AtomicInteger> currentRequestsCount = new ConcurrentHashMap<String, AtomicInteger>();
|
private final Map<String, AtomicInteger> currentRequestsCount = new ConcurrentHashMap<String, AtomicInteger>();
|
||||||
|
|
||||||
private HttpClient() {
|
private HttpClient() {
|
||||||
connManager = new ThreadSafeClientConnManager();
|
connManager = new ThreadSafeClientConnManager();
|
||||||
DefaultHttpClient client = new DefaultHttpClient(connManager);
|
DefaultHttpClient client = new DefaultHttpClient(connManager);
|
||||||
|
|
||||||
client.addRequestInterceptor(new HttpRequestInterceptor() {
|
client.addRequestInterceptor(new HttpRequestInterceptor() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process(final HttpRequest request,
|
public void process(final HttpRequest request,
|
||||||
final HttpContext context) throws HttpException,
|
final HttpContext context) throws HttpException,
|
||||||
IOException {
|
IOException {
|
||||||
|
@ -138,6 +140,7 @@ public class HttpClient {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.addResponseInterceptor(new HttpResponseInterceptor() {
|
client.addResponseInterceptor(new HttpResponseInterceptor() {
|
||||||
|
@Override
|
||||||
public void process(final HttpResponse response,
|
public void process(final HttpResponse response,
|
||||||
final HttpContext context) throws HttpException,
|
final HttpContext context) throws HttpException,
|
||||||
IOException {
|
IOException {
|
||||||
|
@ -148,6 +151,8 @@ public class HttpClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
HttpConnectionParams.setTcpNoDelay(client.getParams(), true);
|
||||||
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
previousConnectionFailed = false;
|
previousConnectionFailed = false;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +309,7 @@ public class HttpClient {
|
||||||
exc = e;
|
exc = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorMsg != null && exc != null) {
|
if ((errorMsg != null) && (exc != null)) {
|
||||||
if (tries > retryCount) {
|
if (tries > retryCount) {
|
||||||
previousConnectionFailed = true;
|
previousConnectionFailed = true;
|
||||||
// close/abort connection
|
// close/abort connection
|
||||||
|
@ -350,7 +355,7 @@ public class HttpClient {
|
||||||
private void processResponse(HttpResponse resp,
|
private void processResponse(HttpResponse resp,
|
||||||
IStreamHandler handlerCallback) throws CommunicationException {
|
IStreamHandler handlerCallback) throws CommunicationException {
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
if (resp != null && resp.getEntity() != null) {
|
if ((resp != null) && (resp.getEntity() != null)) {
|
||||||
try {
|
try {
|
||||||
is = resp.getEntity().getContent();
|
is = resp.getEntity().getContent();
|
||||||
handlerCallback.handleStream(is);
|
handlerCallback.handleStream(is);
|
||||||
|
@ -668,8 +673,8 @@ public class HttpClient {
|
||||||
Header ceheader = entity.getContentEncoding();
|
Header ceheader = entity.getContentEncoding();
|
||||||
if (ceheader != null) {
|
if (ceheader != null) {
|
||||||
HeaderElement[] codecs = ceheader.getElements();
|
HeaderElement[] codecs = ceheader.getElements();
|
||||||
for (int i = 0; i < codecs.length; i++) {
|
for (HeaderElement codec : codecs) {
|
||||||
if (codecs[i].getName().equalsIgnoreCase("gzip")) {
|
if (codec.getName().equalsIgnoreCase("gzip")) {
|
||||||
response.setEntity(new GzipDecompressingEntity(response
|
response.setEntity(new GzipDecompressingEntity(response
|
||||||
.getEntity()));
|
.getEntity()));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue