-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-24053 Jdbc. Use single observable time tracker for multiple JDBC connections #5069
base: main
Are you sure you want to change the base?
Conversation
07a0f0c
to
5b32958
Compare
bb8a386
to
4af7a93
Compare
/** | ||
* JDBC connection context. | ||
*/ | ||
class JdbcConnectionContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class is simply moved to the top level
/** {@link SqlQueryType}s allowed in JDBC select statements. **/ | ||
public static final Set<SqlQueryType> SELECT_STATEMENT_QUERIES = Set.of( | ||
SqlQueryType.QUERY, | ||
SqlQueryType.EXPLAIN | ||
); | ||
|
||
/** {@link SqlQueryType}s allowed in JDBC update statements. **/ | ||
public static final Set<SqlQueryType> UPDATE_STATEMENT_QUERIES = Set.of(DML, DDL, KILL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was not used
* | ||
* @return observable timestamp, or {@code null} if the observable time has not yet been initialized/updated. | ||
*/ | ||
@Nullable HybridTimestamp observableTimestamp(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to save tracker in JdbcConnectionContext
along with created transaction instead of adding a new method to InternalTransaction
@@ -161,6 +162,9 @@ public class IgniteJdbcDriver implements Driver { | |||
/** Minor version. */ | |||
private static final int MINOR_VER = ProtocolVersion.LATEST_VER.minor(); | |||
|
|||
/** Tracker of the latest time observed by client. */ | |||
private final HybridTimestampTracker observableTimeTracker = HybridTimestampTracker.atomicTracker(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to throw a few lines describing rationale behind having a single tracker per driver
https://issues.apache.org/jira/browse/IGNITE-24053
HybridTimestampTracker
moved tocore
module so that it can be used by client.IgniteJdbcDriver
. Single instance of tracker is used for all connections created using driver.observableTime
field.JdbcObservableTimeAwareRequest
with a time tracker was added.Time is transferred from client to server only when executing
queryAsync(..)
method.Time is transferred from the server to the client when executing the following methods:
queryAsync(..)
batchAsync(..)
batchPrepStatementAsync(..)
finishTxAsync(..)