Explicit boxing
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1170168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6fa7185b74
commit
5e1f6e6eb6
|
@ -86,9 +86,9 @@ public class AIMDBackoffManager implements BackoffManager {
|
||||||
int curr = connPerRoute.getMaxForRoute(route);
|
int curr = connPerRoute.getMaxForRoute(route);
|
||||||
Long lastUpdate = getLastUpdate(lastRouteBackoffs, route);
|
Long lastUpdate = getLastUpdate(lastRouteBackoffs, route);
|
||||||
long now = clock.getCurrentTime();
|
long now = clock.getCurrentTime();
|
||||||
if (now - lastUpdate < coolDown) return;
|
if (now - lastUpdate.longValue() < coolDown) return;
|
||||||
connPerRoute.setMaxForRoute(route, getBackedOffPoolSize(curr));
|
connPerRoute.setMaxForRoute(route, getBackedOffPoolSize(curr));
|
||||||
lastRouteBackoffs.put(route, now);
|
lastRouteBackoffs.put(route, Long.valueOf(now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,16 +104,16 @@ public class AIMDBackoffManager implements BackoffManager {
|
||||||
Long lastProbe = getLastUpdate(lastRouteProbes, route);
|
Long lastProbe = getLastUpdate(lastRouteProbes, route);
|
||||||
Long lastBackoff = getLastUpdate(lastRouteBackoffs, route);
|
Long lastBackoff = getLastUpdate(lastRouteBackoffs, route);
|
||||||
long now = clock.getCurrentTime();
|
long now = clock.getCurrentTime();
|
||||||
if (now - lastProbe < coolDown || now - lastBackoff < coolDown)
|
if (now - lastProbe.longValue() < coolDown || now - lastBackoff.longValue() < coolDown)
|
||||||
return;
|
return;
|
||||||
connPerRoute.setMaxForRoute(route, max);
|
connPerRoute.setMaxForRoute(route, max);
|
||||||
lastRouteProbes.put(route, now);
|
lastRouteProbes.put(route, Long.valueOf(now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long getLastUpdate(Map<HttpRoute,Long> updates, HttpRoute route) {
|
private Long getLastUpdate(Map<HttpRoute,Long> updates, HttpRoute route) {
|
||||||
Long lastUpdate = updates.get(route);
|
Long lastUpdate = updates.get(route);
|
||||||
if (lastUpdate == null) lastUpdate = 0L;
|
if (lastUpdate == null) lastUpdate = Long.valueOf(0L);
|
||||||
return lastUpdate;
|
return lastUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue