Skip to content

Commit a466715

Browse files
authored
Removed unused pooled connection eviction check (eclipse-vertx#1126)
Closes eclipse-vertx#1125 Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 0d10efe commit a466715

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/PoolImpl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import io.vertx.sqlclient.impl.tracing.QueryTracer;
3333
import io.vertx.sqlclient.spi.Driver;
3434

35-
import java.util.List;
3635
import java.util.function.Function;
3736
import java.util.function.Supplier;
3837

@@ -224,8 +223,4 @@ private Future<Void> doClose() {
224223
public int size() {
225224
return pool.size();
226225
}
227-
228-
public void check(Handler<AsyncResult<List<Integer>>> handler) {
229-
pool.check(handler);
230-
}
231226
}

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import io.vertx.sqlclient.spi.ConnectionFactory;
3737
import io.vertx.core.*;
3838

39-
import java.util.ArrayList;
4039
import java.util.List;
4140
import java.util.function.Function;
4241
import java.util.function.Supplier;
@@ -149,13 +148,10 @@ public <R> Future<R> execute(ContextInternal context, CommandBase<R> cmd) {
149148
if (ar.succeeded()) {
150149
Lease<PooledConnection> lease = ar.result();
151150
PooledConnection pooled = lease.get();
152-
pooled.inflight++;
153-
pooled.num++;
154151
pooled.schedule(context, cmd)
155152
.onComplete(promise)
156153
.onComplete(v -> {
157154
pooled.expirationTimestamp = System.currentTimeMillis() + idleTimeout;
158-
pooled.inflight--;
159155
lease.recycle();
160156
});
161157
} else {
@@ -231,8 +227,6 @@ public class PooledConnection implements Connection, Connection.Holder {
231227
private Holder holder;
232228
private Lease<PooledConnection> lease;
233229
public long expirationTimestamp;
234-
private int inflight;
235-
private int num;
236230
private boolean initialized;
237231
private Handler<AsyncResult<PooledConnection>> continuation;
238232

@@ -356,14 +350,4 @@ public int getSecretKey() {
356350
return conn.getSecretKey();
357351
}
358352
}
359-
360-
public void check(Handler<AsyncResult<List<Integer>>> handler) {
361-
List<Integer> list = new ArrayList<>();
362-
pool.evict(pred -> {
363-
list.add(pred.num);
364-
return false;
365-
}, ar -> {
366-
handler.handle(Future.succeededFuture(list));
367-
});
368-
}
369353
}

0 commit comments

Comments
 (0)