pull/1733/head
LinZuXiong 7 years ago committed by Brett Wooldridge
parent a7e0d359b0
commit 8b4a6bbebb

@ -50,7 +50,7 @@ import com.zaxxer.hikari.util.SuspendResumeLock;
import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.concurrent.TimeUnit.SECONDS;
import static com.zaxxer.hikari.pool.PoolEntry.LASTACCESS_COMPARABLE; import static com.zaxxer.hikari.pool.PoolEntry.LAST_ACCESS_COMPARABLE;
import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_IN_USE; import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_IN_USE;
import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_NOT_IN_USE; import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_NOT_IN_USE;
import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_REMOVED; import static com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry.STATE_REMOVED;
@ -614,7 +614,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
afterPrefix = "After cleanup "; afterPrefix = "After cleanup ";
// Sort pool entries on lastAccessed // Sort pool entries on lastAccessed
Collections.sort(idleList, LASTACCESS_COMPARABLE); Collections.sort(idleList, LAST_ACCESS_COMPARABLE);
for (PoolEntry poolEntry : idleList) { for (PoolEntry poolEntry : idleList) {
if (clockSource.elapsedMillis(poolEntry.lastAccessed, now) > idleTimeout && connectionBag.reserve(poolEntry)) { if (clockSource.elapsedMillis(poolEntry.lastAccessed, now) > idleTimeout && connectionBag.reserve(poolEntry)) {
closeConnection(poolEntry, "(connection has passed idleTimeout)"); closeConnection(poolEntry, "(connection has passed idleTimeout)");

@ -220,7 +220,7 @@ abstract class PoolBase
/** /**
* Register MBeans for HikariConfig and HikariPool. * Register MBeans for HikariConfig and HikariPool.
* *
* @param pool a HikariPool instance * @param hikariPool a HikariPool instance
*/ */
void registerMBeans(final HikariPool hikariPool) void registerMBeans(final HikariPool hikariPool)
{ {
@ -606,7 +606,7 @@ abstract class PoolBase
/** /**
* @param poolEntry * @param poolEntry
* @param now * @param startTime
*/ */
void recordBorrowStats(final PoolEntry poolEntry, final long startTime) void recordBorrowStats(final PoolEntry poolEntry, final long startTime)
{ {

@ -38,7 +38,7 @@ final class PoolEntry implements IConcurrentBagEntry
{ {
private static final Logger LOGGER = LoggerFactory.getLogger(PoolEntry.class); private static final Logger LOGGER = LoggerFactory.getLogger(PoolEntry.class);
static final Comparator<PoolEntry> LASTACCESS_COMPARABLE; static final Comparator<PoolEntry> LAST_ACCESS_COMPARABLE;
Connection connection; Connection connection;
long lastAccessed; long lastAccessed;
@ -56,7 +56,7 @@ final class PoolEntry implements IConcurrentBagEntry
static static
{ {
LASTACCESS_COMPARABLE = new Comparator<PoolEntry>() { LAST_ACCESS_COMPARABLE = new Comparator<PoolEntry>() {
@Override @Override
public int compare(final PoolEntry entryOne, final PoolEntry entryTwo) { public int compare(final PoolEntry entryOne, final PoolEntry entryTwo) {
return Long.compare(entryOne.lastAccessed, entryTwo.lastAccessed); return Long.compare(entryOne.lastAccessed, entryTwo.lastAccessed);
@ -87,7 +87,7 @@ final class PoolEntry implements IConcurrentBagEntry
} }
/** /**
* @param endOfLife * @param endOfLife the end future
*/ */
void setFutureEol(final ScheduledFuture<?> endOfLife) void setFutureEol(final ScheduledFuture<?> endOfLife)
{ {

Loading…
Cancel
Save