public class MultiPrimaryClient extends Object implements com.singlestore.jdbc.client.Client
remark: would have been better using proxy, but for AOT compilation, avoiding to using not supported proxy class.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected Configuration |
conf |
protected com.singlestore.jdbc.client.Client |
currentClient |
protected long |
deniedListTimeout |
protected static ConcurrentMap<HostAddress,Long> |
denyList |
protected ReentrantLock |
lock |
| Constructor and Description |
|---|
MultiPrimaryClient(Configuration conf,
ReentrantLock lock) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
void |
close() |
void |
closePrepare(Prepare prepare) |
protected com.singlestore.jdbc.client.Client |
connectHost(boolean readOnly,
boolean failFast)
Trying connecting server.
|
List<com.singlestore.jdbc.client.Completion> |
execute(com.singlestore.jdbc.message.ClientMessage message) |
List<com.singlestore.jdbc.client.Completion> |
execute(com.singlestore.jdbc.message.ClientMessage message,
Statement stmt) |
List<com.singlestore.jdbc.client.Completion> |
execute(com.singlestore.jdbc.message.ClientMessage message,
Statement stmt,
int fetchSize,
long maxRows,
int resultSetConcurrency,
int resultSetType,
boolean closeOnCompletion) |
List<com.singlestore.jdbc.client.Completion> |
executePipeline(com.singlestore.jdbc.message.ClientMessage[] messages,
Statement stmt,
int fetchSize,
long maxRows,
int resultSetConcurrency,
int resultSetType,
boolean closeOnCompletion) |
protected void |
executeTransactionReplay(com.singlestore.jdbc.client.Client oldCli) |
com.singlestore.jdbc.client.Context |
getContext() |
ExceptionFactory |
getExceptionFactory() |
HostAddress |
getHostAddress() |
int |
getSocketTimeout() |
int |
getWaitTimeout() |
boolean |
isClosed() |
boolean |
isPrimary() |
void |
readStreamingResults(List<com.singlestore.jdbc.client.Completion> completions,
int fetchSize,
long maxRows,
int resultSetConcurrency,
int resultSetType,
boolean closeOnCompletion) |
protected void |
reConnect() |
void |
reset() |
void |
setReadOnly(boolean readOnly) |
void |
setSocketTimeout(int milliseconds) |
void |
syncNewState(com.singlestore.jdbc.client.Client oldCli) |
protected static final ConcurrentMap<HostAddress,Long> denyList
protected final long deniedListTimeout
protected final Configuration conf
protected boolean closed
protected final ReentrantLock lock
protected com.singlestore.jdbc.client.Client currentClient
public MultiPrimaryClient(Configuration conf, ReentrantLock lock) throws SQLException
SQLExceptionprotected com.singlestore.jdbc.client.Client connectHost(boolean readOnly,
boolean failFast)
throws SQLException
searching each connecting primary / replica connection not temporary denied until found one. searching in temporary denied host if not succeed, until reaching `retriesAllDown` attempts.
readOnly - must connect a replica / primaryfailFast - must try only not denyed serverSQLException - if not succeed to create a connection.protected void reConnect()
throws SQLException
SQLExceptionprotected void executeTransactionReplay(com.singlestore.jdbc.client.Client oldCli)
throws SQLException
SQLExceptionpublic void syncNewState(com.singlestore.jdbc.client.Client oldCli)
throws SQLException
SQLExceptionpublic List<com.singlestore.jdbc.client.Completion> execute(com.singlestore.jdbc.message.ClientMessage message) throws SQLException
execute in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic List<com.singlestore.jdbc.client.Completion> execute(com.singlestore.jdbc.message.ClientMessage message, Statement stmt) throws SQLException
execute in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic List<com.singlestore.jdbc.client.Completion> execute(com.singlestore.jdbc.message.ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion) throws SQLException
execute in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic List<com.singlestore.jdbc.client.Completion> executePipeline(com.singlestore.jdbc.message.ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion) throws SQLException
executePipeline in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic void readStreamingResults(List<com.singlestore.jdbc.client.Completion> completions, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion) throws SQLException
readStreamingResults in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic void closePrepare(Prepare prepare) throws SQLException
closePrepare in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic void close()
throws SQLException
close in interface com.singlestore.jdbc.client.Clientclose in interface AutoCloseableSQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic int getSocketTimeout()
getSocketTimeout in interface com.singlestore.jdbc.client.Clientpublic void setSocketTimeout(int milliseconds)
throws SQLException
setSocketTimeout in interface com.singlestore.jdbc.client.ClientSQLExceptionpublic int getWaitTimeout()
getWaitTimeout in interface com.singlestore.jdbc.client.Clientpublic boolean isClosed()
isClosed in interface com.singlestore.jdbc.client.Clientpublic com.singlestore.jdbc.client.Context getContext()
getContext in interface com.singlestore.jdbc.client.Clientpublic ExceptionFactory getExceptionFactory()
getExceptionFactory in interface com.singlestore.jdbc.client.Clientpublic HostAddress getHostAddress()
getHostAddress in interface com.singlestore.jdbc.client.Clientpublic boolean isPrimary()
isPrimary in interface com.singlestore.jdbc.client.Clientpublic void reset()
reset in interface com.singlestore.jdbc.client.ClientCopyright © 2023 SingleStore. All rights reserved.