public class PreparedStatementCache extends Object
| Constructor and Description |
|---|
PreparedStatementCache(SocketConnectionBase conn,
int cacheCapacity) |
| Modifier and Type | Method and Description |
|---|---|
Handler<AsyncResult<PreparedStatement>> |
appendStmtReq(String sql,
Handler<AsyncResult<PreparedStatement>> originalHandler)
Append a new prepared statement request to this cache.
|
void |
remove(String sql)
Remove the cached entry when the cached statement is closing so that pending requests will not use a closed prepared statement.
|
public PreparedStatementCache(SocketConnectionBase conn, int cacheCapacity)
public Handler<AsyncResult<PreparedStatement>> appendStmtReq(String sql, Handler<AsyncResult<PreparedStatement>> originalHandler)
sql - the sql string to be prepareoriginalHandler - the original prepare command handlernull if the result has been cached or the network request is inflight,
or a new Handler which represents the handler of all appending req waiters so it can be called when the command response is ready.public void remove(String sql)
sql - the identified sql of the cached statementCopyright © 2020. All rights reserved.