You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "xtern (via GitHub)" <gi...@apache.org> on 2025/01/17 12:17:58 UTC
[PR] IGNITE-24053 [ignite-3]
xtern opened a new pull request, #5069:
URL: https://github.com/apache/ignite-3/pull/5069
https://issues.apache.org/jira/browse/IGNITE-24053
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24053 Jdbc. Use single observable time tracker for multiple JDBC connections [ignite-3]
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #5069:
URL: https://github.com/apache/ignite-3/pull/5069#discussion_r1924929528
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java:
##########
@@ -91,6 +91,13 @@ public interface InternalTransaction extends Transaction {
*/
HybridTimestamp startTimestamp();
+ /**
+ * Returns an observable timestamp provided by the observable timestamp tracker.
+ *
+ * @return observable timestamp, or {@code null} if the observable time has not yet been initialized/updated.
+ */
+ @Nullable HybridTimestamp observableTimestamp();
Review Comment:
I would suggest to save tracker in `JdbcConnectionContext` along with created transaction instead of adding a new method to `InternalTransaction`
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -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);
Review Comment:
it would be nice to throw a few lines describing rationale behind having a single tracker per driver
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24053 Jdbc. Use single observable time tracker for multiple JDBC connections [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5069:
URL: https://github.com/apache/ignite-3/pull/5069#discussion_r1925431480
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/InternalTransaction.java:
##########
@@ -91,6 +91,13 @@ public interface InternalTransaction extends Transaction {
*/
HybridTimestamp startTimestamp();
+ /**
+ * Returns an observable timestamp provided by the observable timestamp tracker.
+ *
+ * @return observable timestamp, or {@code null} if the observable time has not yet been initialized/updated.
+ */
+ @Nullable HybridTimestamp observableTimestamp();
Review Comment:
Done
##########
modules/jdbc/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java:
##########
@@ -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);
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24053 Jdbc. Use single observable time tracker for multiple JDBC connections [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern merged PR #5069:
URL: https://github.com/apache/ignite-3/pull/5069
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24053 Jdbc. Use single obserable time tracker for multiple JDBC connections [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5069:
URL: https://github.com/apache/ignite-3/pull/5069#discussion_r1923666474
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/JdbcHandlerBase.java:
##########
@@ -49,16 +48,12 @@
* Contains common methods used to process jdbc requests.
*/
abstract class JdbcHandlerBase {
-
/** {@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);
Review Comment:
was not used
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-24053 Jdbc. Use single obserable time tracker for multiple JDBC connections [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5069:
URL: https://github.com/apache/ignite-3/pull/5069#discussion_r1923665625
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/JdbcConnectionContext.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.client.handler;
+
+import static org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture;
+
+import java.time.ZoneId;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
+import org.apache.ignite.internal.hlc.HybridTimestampTracker;
+import org.apache.ignite.internal.tx.InternalTransaction;
+import org.apache.ignite.internal.tx.InternalTxOptions;
+import org.apache.ignite.internal.tx.TxManager;
+import org.apache.ignite.lang.CancelHandle;
+import org.apache.ignite.lang.CancellationToken;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * JDBC connection context.
+ */
+class JdbcConnectionContext {
Review Comment:
this class is simply moved to the top level
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org