Issue #1257: Update grib path keys to include hdf5 layout. Turn on TcpNoDelay

Change-Id: I296d0d4b1c204a325c499b3aeb1f9d7f16de0c9b

Former-commit-id: f5fe7cf872 [formerly e32d77c87f] [formerly 68ac1abca4] [formerly c5e3b54caa [formerly 68ac1abca4 [formerly 29b54f75013685f1bcd9ed3129c9ba3ddf629395]]]
Former-commit-id: c5e3b54caa
Former-commit-id: a0fc10b28ef8f7a0ad614832eb3f6018b40d3685 [formerly a80db469b2]
Former-commit-id: 19797b9064
This commit is contained in:
Richard Peter 2012-10-15 20:15:39 -05:00
parent 21424b947e
commit 4c990fa2b7
2 changed files with 15 additions and 6 deletions

View file

@ -4,5 +4,9 @@
<key>modelInfo.modelName</key>
<order>0</order>
</pathKey>
<pathKey>
<key>modelInfo.level</key>
<order>1</order>
</pathKey>
</pathKeySet>

View file

@ -109,20 +109,22 @@ public class HttpClient {
private ThreadSafeClientConnManager connManager = null;
private NetworkStatistics stats = new NetworkStatistics();
private final NetworkStatistics stats = new NetworkStatistics();
private boolean gzipRequests = false;
private boolean handlingGzipResponses = false;
/** 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() {
connManager = new ThreadSafeClientConnManager();
DefaultHttpClient client = new DefaultHttpClient(connManager);
client.addRequestInterceptor(new HttpRequestInterceptor() {
@Override
public void process(final HttpRequest request,
final HttpContext context) throws HttpException,
IOException {
@ -138,6 +140,7 @@ public class HttpClient {
});
client.addResponseInterceptor(new HttpResponseInterceptor() {
@Override
public void process(final HttpResponse response,
final HttpContext context) throws HttpException,
IOException {
@ -148,6 +151,8 @@ public class HttpClient {
}
}
});
HttpConnectionParams.setTcpNoDelay(client.getParams(), true);
this.client = client;
previousConnectionFailed = false;
}
@ -304,7 +309,7 @@ public class HttpClient {
exc = e;
}
if (errorMsg != null && exc != null) {
if ((errorMsg != null) && (exc != null)) {
if (tries > retryCount) {
previousConnectionFailed = true;
// close/abort connection
@ -350,7 +355,7 @@ public class HttpClient {
private void processResponse(HttpResponse resp,
IStreamHandler handlerCallback) throws CommunicationException {
InputStream is = null;
if (resp != null && resp.getEntity() != null) {
if ((resp != null) && (resp.getEntity() != null)) {
try {
is = resp.getEntity().getContent();
handlerCallback.handleStream(is);
@ -668,8 +673,8 @@ public class HttpClient {
Header ceheader = entity.getContentEncoding();
if (ceheader != null) {
HeaderElement[] codecs = ceheader.getElements();
for (int i = 0; i < codecs.length; i++) {
if (codecs[i].getName().equalsIgnoreCase("gzip")) {
for (HeaderElement codec : codecs) {
if (codec.getName().equalsIgnoreCase("gzip")) {
response.setEntity(new GzipDecompressingEntity(response
.getEntity()));
return;