This is an automated email from the ASF dual-hosted git repository. spmallette pushed a commit to branch TINKERPOP-3168 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 7fac40da531b8b061e5b596d026b7f60c1b039d9 Author: Stephen Mallette <[email protected]> AuthorDate: Thu Jul 17 11:35:39 2025 -0400 TINKERPOP-3168 Deprecated UnifiedChannelizer --- CHANGELOG.asciidoc | 3 ++- docs/src/reference/gremlin-applications.asciidoc | 17 +++++------------ docs/src/upgrade/release-3.8.x.asciidoc | 10 ++++++++++ .../org/apache/tinkerpop/gremlin/server/Settings.java | 17 +++++++++++++++++ .../gremlin/server/channel/UnifiedChannelizer.java | 9 +++++++++ .../gremlin/server/handler/AbstractSession.java | 3 +++ .../gremlin/server/handler/MultiTaskSession.java | 3 +++ .../gremlin/server/handler/SessionException.java | 3 +++ .../tinkerpop/gremlin/server/handler/SessionTask.java | 3 +++ .../gremlin/server/handler/SingleTaskSession.java | 3 +++ .../gremlin/server/handler/UnifiedHandler.java | 3 +++ 11 files changed, 61 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 8bc743b338..127158c617 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,7 +28,8 @@ This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>. * Removed Vertex/ReferenceVertex from grammar. Use vertex id in traversals now instead. * Modified mathematical operators to prevent overflows in steps such as `sum()` and 'sack()' to prefer promotion to the next highest number type. * Added `DateTime` ontop of the existing 'datetime' grammar. -* Added UUID() + UUID(value) to grammar +* Added `UUID()` and `UUID(value)` to grammar. +* Deprecated the `UnifiedChannelizer`. * Modified `TraversalStrategy` construction in Javascript where configurations are now supplied as a `Map` of options. * Fixed bug in GraphSON v2 and v3 where full round trip of `TraversalStrategy` implementations was failing. * Added missing strategies to the `TraversalStrategies` global cache as well as `CoreImports` in `gremlin-groovy`. diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index 99afcf2667..031f9c2b94 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -863,10 +863,6 @@ channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer [source,yaml] channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer -NOTE: The `UnifiedChannelizer` introduced in 3.5.0 can also be used to support HTTP requests as its functionality -is similar to `WsAndHttpChannelizer`. Please see the Gremlin Server UnifiedChannelizer Section of the Upgrade -Documentation for 3.5.0 for more link:https://tinkerpop.apache.org/docs/x.y.z/upgrade/#_tinkerpop_3_5_0[details]. - The `HttpChannelizer` is already configured in the `gremlin-server-rest-modern.yaml` file that is packaged with the Gremlin Server distribution. To utilize it, start Gremlin Server as follows: @@ -1004,6 +1000,9 @@ bin/gremlin-server.sh conf/gremlin-server-min.yaml WARNING: On Windows, gremlin-server.bat will always start in the foreground. When no parameter is provided, it will start with the default `conf/gremlin-server.yaml` file. +NOTE: The following configuration options may reference the `UnifiedChannelizer`. It was deprecated in 3.8.0 and will +be removed in a future version. + The following table describes the various YAML configuration options that Gremlin Server expects: [width="100%",cols="3,10,^2",options="header"] @@ -1087,8 +1086,8 @@ See the <<metrics,Metrics>> section for more information on how to configure Gan [[opprocessor-configurations]] ==== OpProcessor Configurations -IMPORTANT: The `UnifiedChannelizer` does not rely on `OpProcessor` infrastructure. If using that channelizer, these -configuration options can be ignored. +IMPORTANT: The `UnifiedChannelizer` (deprecated in 3.8.0) does not rely on `OpProcessor` infrastructure. If using that +channelizer, these configuration options can be ignored. An `OpProcessor` provides a way to plug-in handlers to Gremlin Server's processing flow. Gremlin Server uses this plug-in system itself to expose the packaged functionality that it exposes. Configurations can be supplied to an @@ -2571,12 +2570,6 @@ simply executed serially as they arrive to the session. A failed asynchronous re in the session which may not allow later requests to succeed. Either use synchronous requests only or carefully consider error conditions with asynchronous requests. -If using the `UnifiedChannelizer`, failures in evaluation will result in the session being closed and state being -lost. Asynchronous requests that are queued on the server will be cancelled and additional requests, in-flight or -otherwise will be rejected. Users should create a new session from the `Cluster` object in this case. The alternative, -to match the old `OpProcessor` GremlinServer behavior, is to add the `maintainStateAfterException` session setting to -`true` which will instead have similar behavior to that described in this section. - [source,java] ---- Client.SessionSettings settings = diff --git a/docs/src/upgrade/release-3.8.x.asciidoc b/docs/src/upgrade/release-3.8.x.asciidoc index e8ed68dee1..cae8ec85d2 100644 --- a/docs/src/upgrade/release-3.8.x.asciidoc +++ b/docs/src/upgrade/release-3.8.x.asciidoc @@ -299,6 +299,16 @@ removed. As a result, all translators in .NET, Python, Go and Javascript have be See: link:https://issues.apache.org/jira/browse/TINKERPOP-3028[TINKERPOP-3028] +==== Deprecated UnifiedChannelizer + +The `UnifiedChannelizer` was added in 3.5.0 in any attempt to streamline Gremlin Server code paths and resource usage. +It was offered as an experimental feature and as releases went on was not further developed, particularly because of the +major changes to Gremlin Server expected in 4.0.0 when websockets are removed. The removal of websockets with a pure +reliance on HTTP will help do what the `UnifiedChannelizer` tried to do with its changes. As a result, there is no need +to continue to refine this `Channelizer` implementation and it can be deprecated. + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-3168[TINKERPOP-3168] + ==== Change to `OptionsStrategy` in `gremlin-python` The `\\__init__()` syntax has been updated to be both more pythonic and more aligned to the `gremlin-lang` syntax. diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java index 50e7444b2f..eec13df748 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java @@ -210,7 +210,10 @@ public class Settings { * created {@link Session} will queue separately given that setting per session. * <p/> * By default this value is set to 8192. + * + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public int maxWorkQueueSize = 8192; /** @@ -218,13 +221,18 @@ public class Settings { * configuration only applies to the {@link UnifiedChannelizer}. By default this value is set to 4096. * * @see #maxWorkQueueSize + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public int maxSessionTaskQueueSize = 4096; /** * Maximum number of parameters that can be passed on a request. Larger numbers may impact performance for scripts. * The default is 16 and this setting only applies to the {@link UnifiedChannelizer}. + * + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public int maxParameters = 16; /** @@ -234,14 +242,20 @@ public class Settings { * to interrupt it which will result in a timeout error to the client. If there are existing requests enqueued for * the session when this timeout is reached, those requests will not be executed and will be closed with server * errors. Open transactions will be issued a rollback. The default is 10 minutes. + * + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public long sessionLifetimeTimeout = 600000; /** * Enable the global function cache for sessions when using the {@link UnifiedChannelizer}. This setting is only * relevant when {@link #useGlobalFunctionCacheForSessions} is {@code false}. When {@link true} it means that * functions created in one request to a session remain available on the next request to that session. + * + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public boolean useGlobalFunctionCacheForSessions = true; /** @@ -252,7 +266,10 @@ public class Settings { * rapidly. Setting this value to {@code false} is mostly present to support specific use cases that may require * each session having its own engine or to match previous functionality provided by the older channelizers * produced prior to 3.5.0. + * + * @deprecated As of release 3.8.0, not replaced. */ + @Deprecated public boolean useCommonEngineForSessions = true; /** diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/UnifiedChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/UnifiedChannelizer.java index f3e910e4ab..8d7b054b00 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/UnifiedChannelizer.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/UnifiedChannelizer.java @@ -21,16 +21,23 @@ package org.apache.tinkerpop.gremlin.server.channel; import io.netty.channel.ChannelPipeline; import org.apache.tinkerpop.gremlin.server.AbstractChannelizer; import org.apache.tinkerpop.gremlin.server.Channelizer; +import org.apache.tinkerpop.gremlin.server.GremlinServer; import org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler; import org.apache.tinkerpop.gremlin.server.handler.UnifiedHandler; import org.apache.tinkerpop.gremlin.server.handler.WsAndHttpChannelizerHandler; import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A {@link Channelizer} that supports websocket and HTTP requests and does so with the most streamlined processing * model for Gremlin Server introduced with 3.5.0. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public class UnifiedChannelizer extends AbstractChannelizer { + private static final Logger logger = LoggerFactory.getLogger(UnifiedChannelizer.class); private WsAndHttpChannelizerHandler wsAndHttpChannelizerHandler; private UnifiedHandler unifiedHandler; @@ -40,6 +47,8 @@ public class UnifiedChannelizer extends AbstractChannelizer { public void init(final ServerGremlinExecutor serverGremlinExecutor) { super.init(serverGremlinExecutor); + logger.warn("The UnifiedChannelizer is deprecated and will be removed in a future release"); + wsAndHttpChannelizerHandler = new WsAndHttpChannelizerHandler(); wsAndHttpChannelizerHandler.init(serverGremlinExecutor, new HttpGremlinEndpointHandler(serializers, gremlinExecutor, graphManager, settings)); diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/AbstractSession.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/AbstractSession.java index 6680127d51..97a44b57f8 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/AbstractSession.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/AbstractSession.java @@ -89,7 +89,10 @@ import static org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.writePa * take care in understanding the way that different methods are called as they do depend on one another a bit. It * maybe best to examine the source code to determine how best to use this class or to extend from the higher order * classes of {@link SingleTaskSession} or {@link MultiTaskSession}. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public abstract class AbstractSession implements Session, AutoCloseable { private static final Logger logger = LoggerFactory.getLogger(AbstractSession.class); private static final Logger auditLogger = LoggerFactory.getLogger(GremlinServer.AUDIT_LOGGER_NAME); diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/MultiTaskSession.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/MultiTaskSession.java index fb623a9368..8f02861c02 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/MultiTaskSession.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/MultiTaskSession.java @@ -50,7 +50,10 @@ import static org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor. * to execute is supplied on the constructor and additional ones may be added as they arrive with * {@link #submitTask(SessionTask)} where they will be added to a queue where they will await execution in the thread * bound to this session. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public class MultiTaskSession extends AbstractSession { private static final Logger logger = LoggerFactory.getLogger(MultiTaskSession.class); protected final BlockingQueue<SessionTask> queue; diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionException.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionException.java index 5705de2bc8..bd8839307f 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionException.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionException.java @@ -23,7 +23,10 @@ import org.apache.tinkerpop.gremlin.util.message.ResponseMessage; /** * An exception that holds the error-related {@link ResponseMessage} which is meant to be returned to the calling * client. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public class SessionException extends Exception { private final ResponseMessage responseMessage; diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionTask.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionTask.java index 5dbe5e0bca..dc26463bdc 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionTask.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SessionTask.java @@ -31,7 +31,10 @@ import java.util.concurrent.ScheduledExecutorService; /** * A {@code SessionTask} equates to a particular incoming request to the {@link UnifiedHandler} and is analogous to * a {@link Context} in the {@link OpProcessor} approach to handling requests to the server. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public class SessionTask extends Context { public SessionTask(final RequestMessage requestMessage, final ChannelHandlerContext ctx, final Settings settings, final GraphManager graphManager, diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SingleTaskSession.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SingleTaskSession.java index 8a786d08dc..4d49c02215 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SingleTaskSession.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/SingleTaskSession.java @@ -27,7 +27,10 @@ import java.util.concurrent.RejectedExecutionException; /** * A simple {@link Session} implementation that accepts one request, processes it and exits. + * + * @deprecated As of release 3.8.0, not replaced. */ +@Deprecated public class SingleTaskSession extends AbstractSession { private static final Logger logger = LoggerFactory.getLogger(SingleTaskSession.class); protected final SessionTask onlySessionTask; diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/UnifiedHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/UnifiedHandler.java index 318a0a0792..2dfd284a0b 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/UnifiedHandler.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/UnifiedHandler.java @@ -60,8 +60,11 @@ import java.util.concurrent.TimeUnit; /** * Handler for websockets to be used with the {@link UnifiedChannelizer}. + * + * @deprecated As of release 3.8.0, not replaced. */ @ChannelHandler.Sharable +@Deprecated public class UnifiedHandler extends SimpleChannelInboundHandler<RequestMessage> { private static final Logger logger = LoggerFactory.getLogger(UnifiedHandler.class);
