This is an automated email from the ASF dual-hosted git repository. kenhuuu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 7178a2edccabcc960a5c4dc64db671fa08d65e63 Author: Ken Hu <[email protected]> AuthorDate: Tue Mar 31 19:35:32 2026 -0700 Update WebSocket mentions in documentation CTR --- docs/src/dev/provider/index.asciidoc | 2 +- docs/src/reference/gremlin-applications.asciidoc | 46 ++++++++++------------ docs/src/reference/gremlin-variants.asciidoc | 22 +++++------ .../reference/implementations-tinkergraph.asciidoc | 2 +- docs/src/reference/intro.asciidoc | 2 +- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc index 4ee8fbfaa8..87fc8c4a99 100644 --- a/docs/src/dev/provider/index.asciidoc +++ b/docs/src/dev/provider/index.asciidoc @@ -560,7 +560,7 @@ class MyType(object): graphson_reader = GraphSONReader({MyType.GRAPHSON_TYPE: MyType}) graphson_writer = GraphSONWriter({MyType: MyType}) -connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g', +connection = DriverRemoteConnection('http://localhost:8182/gremlin', 'g', graphson_reader=graphson_reader, graphson_writer=graphson_writer) ---- diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc index b825d456c2..8039afff90 100644 --- a/docs/src/reference/gremlin-applications.asciidoc +++ b/docs/src/reference/gremlin-applications.asciidoc @@ -546,34 +546,34 @@ include::../../../gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Docs/Reference [source,javascript] ---- // script -const client = new Client('ws://localhost:45940/gremlin', { traversalSource: "g" }); +const client = new Client('http://localhost:45940/gremlin', { traversalSource: "g" }); const conn = client.open(); const list = conn.submit("g.V().has('person','name',name).out('knows')",{name: 'marko'}).then(function (response) { ... }); // traversal -const g = gtraversal().with(new DriverRemoteConnection('ws://localhost:8182/gremlin')); +const g = gtraversal().with(new DriverRemoteConnection('http://localhost:8182/gremlin')); const list = g.V().has("person","name","marko").out("knows").toList(); ---- [source,python] ---- # script -client = Client('ws://localhost:8182/gremlin', 'g') +client = Client('http://localhost:8182/gremlin', 'g') list = client.submit("g.V().has('person','name',name).out('knows')",{'name': 'marko'}).all() # traversal -g = traversal().with(DriverRemoteConnection('ws://localhost:8182/gremlin','g')) +g = traversal().with(DriverRemoteConnection('http://localhost:8182/gremlin','g')) list = g.V().has("person","name","marko").out("knows").toList() ---- [source,go] ---- // script -client, err := NewClient("ws://localhost:8182/gremlin") +client, err := NewClient("http://localhost:8182/gremlin") resultSet, err := client.SubmitWithOptions("g.V().has('person','name',name).out('knows')", new(RequestOptionsBuilder).AddBinding("name", "marko").Create()) result, err := resultSet.All() // traversal -remote, err := NewDriverRemoteConnection("ws://localhost:8182/gremlin") +remote, err := NewDriverRemoteConnection("http://localhost:8182/gremlin") g := Traversal_().With(remote) list, err := g.V().Has("person", "name", "marko").Out("knows").ToList() ---- @@ -1006,10 +1006,10 @@ NOTE: Installing Ganglia will include `org.acplt:oncrpc`, which is an LGPL licen Regardless of the output, the metrics gathered are the same. Each metric is prefixed with `org.apache.tinkerpop.gremlin.server.GremlinServer` and the following metrics are reported: -* `channels.paused` - The current number of open channels (HTTP and Websocket) that have their writes to buffer paused +* `channels.paused` - The current number of open HTTP channels that have their writes to buffer paused when the `writeBufferHighWaterMark` configuration is exceeded. -* `channels.total` - The current number of open channels (HTTP and Websocket). -* `channels.write-pauses` - The total number of pauses across all channels (HTTP and Websocket) to buffer writes where +* `channels.total` - The current number of open HTTP channels. +* `channels.write-pauses` - The total number of pauses across all HTTP channels to buffer writes where the `writeBufferHighWaterMark` configuration is exceeded, with mean rate, as well as the 1, 5, and 15-minute rates. * `engine-name.session.session-id.*` - Metrics related to different `GremlinScriptEngine` instances configured for session-based requests where "engine-name" will be the actual name of the engine, such as "gremlin-groovy" and @@ -1798,13 +1798,9 @@ requests and then use longer per-request timeouts for those specific ones that m ** Note that `evaluationTimeout` can only attempt to interrupt the evaluation on timeout. It allows Gremlin Server to "ignore" the result of that evaluation, which means the thread in the `gremlinPool` that did the evaluation may still be consumed after the timeout if interruption does not succeed on the thread. -* When using sessions, there are different options to consider depending on the `Channelizer` implementation being -used: -** `WebSocketChannelizer` and `WsAndHttpChannelizer` - Both of these channelizers use the `gremlinPool` only for -sessionless requests and construct a single threaded pool for each session created. In this way, these channelizers -tend to optimize sessions to be long-lived. For short-lived sessions, which may be typical when using bytecode based -remote transactions, quickly creating and destroying these sessions can be expensive. It is likely that there will be -increased garbage collection times and frequency as well as a general increase in overall server processing. +* When using transactions, the server dedicates resources to maintain transaction state for each open transaction. For +high concurrency workloads with many open transactions, the server may experience increased memory usage, increased +garbage collection times and frequency as well as a general increase in overall server processing. * Graph element serialization for `Vertex` and `Edge` can be expensive, as their data structures are complex given the possible existence of multi-properties and meta-properties. When returning data from Gremlin Server only return the data that is required. For example, if only two properties of a `Vertex` are needed then simply return the two rather @@ -1831,15 +1827,15 @@ therefore just queue another heavy request. ** Consider the shape of query results as they can have an impact on server performance. The "shape" refers to the form of the result given the query. For example, `g.V()` and `g.V().fold()` both return the same results (i.e. all the vertices in the graph) but the former returns them one at a time in a stream and the latter collects them all in -memory in a `List` and then returns the one `List` result. Writing queries in ways that allow results that can stream -(only applies for websockets) is preferable and will allow the server to perform better. Another aspect of "shape" -can come into play when returning data of individual graph elements. For example, the `g.V()` form of query will stream, -but if each `Vertex` returned has lots of properties (e.g. properties with large strings or heavy blobs), this could -trigger scenarios where each streamed batch immediately exceeds `writeBufferHighWaterMark`. Simply exceeding the -`writeBufferHighWaterMark` may not trigger a pause as the server may quickly flush the buffer before the next batch, but -one could see how easily a write pause could be triggered in that state. It could make sense to configure a smaller -`batchSize` for queries results that have heavy individual objects in them as that would reduce the byte size of the -batch and allow buffer flushes to happen more often (though that may be a cost in and of itself). +memory in a `List` and then returns the one `List` result. Writing queries in ways that allow results to stream is +preferable and will allow the server to perform better. Another aspect of "shape" can come into play when returning data +of individual graph elements. For example, the `g.V()` form of query will stream, but if each `Vertex` returned has lots +of properties (e.g. properties with large strings or heavy blobs), this could trigger scenarios where each streamed +batch immediately exceeds `writeBufferHighWaterMark`. Simply exceeding the `writeBufferHighWaterMark` may not trigger a +pause as the server may quickly flush the buffer before the next batch, but one could see how easily a write pause could +be triggered in that state. It could make sense to configure a smaller `batchSize` for queries results that have heavy +individual objects in them as that would reduce the byte size of the batch and allow buffer flushes to happen more often +(though that may be a cost in and of itself). [[parameterized-scripts]] ==== Parameterized Scripts diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc index 35f189b0db..c6e8395b12 100644 --- a/docs/src/reference/gremlin-variants.asciidoc +++ b/docs/src/reference/gremlin-variants.asciidoc @@ -1345,28 +1345,28 @@ _The server is unavailable_ [source,text] ---- -Timed-out (500 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin}. Potential Cause: Connection refused: no further information -> ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin})- no connections in pool +Timed-out (500 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin}. Potential Cause: Connection refused: no further information +> ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin})- no connections in pool ---- _Client is likely issuing more requests than the pool size can handle_ [source,text] ---- -Timed-out (150 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin}. Potential Cause: Number of active requests exceeds pool size. Consider increasing the value for maxConnectionPoolSize. -ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin}) -Connection Pool Status (size=1 max=1 min=1 toCreate=0 bin=0) +Timed-out (150 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin}. Potential Cause: Number of active requests exceeds pool size. Consider increasing the value for maxConnectionPoolSize. +ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin}) +Connection Pool Status (size=1 available=1 max=1 toCreate=0 bin=0 waiter=0) > Connection{channel=5a859d62 isDead=false borrowed=1 pending=1 > markedReplaced=false closing=false created=2022-12-19T21:08:21.569613100Z > thread=gremlin-driver-conn-scheduler-1} -- bin -- ---- -_Network traffic is slow and the websocket handshake does not complete in time_ +_Network traffic is slow and the connection setup does not complete in time_ [source,text] ---- -Timed-out (250 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin}. Potential Cause: WebSocket handshake not completed in stipulated time=[100]ms -ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin}) -Connection Pool Status (size=1 max=5 min=1 toCreate=0 bin=0) +Timed-out (250 MILLISECONDS) waiting for connection on Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin}. Potential Cause: Connection setup not completed in stipulated time=[100]ms +ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin}) +Connection Pool Status (size=1 available=1 max=5 toCreate=0 bin=0 waiter=0) > Connection{channel=205fc8d2 isDead=false borrowed=1 pending=1 > markedReplaced=false closing=false created=2022-12-19T21:10:04.692921600Z > thread=gremlin-driver-conn-scheduler-1} -- bin -- ---- @@ -2876,7 +2876,7 @@ be used: [source,python] ---- -social = traversal(SocialTraversalSource).with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g')) +social = traversal(SocialTraversalSource).with_remote(DriverRemoteConnection('http://localhost:8182/gremlin','g')) social.persons('marko').knows('josh') social.persons('marko').youngest_friends_age() social.persons().filter(__.created_at_least(2)).count() @@ -2963,7 +2963,7 @@ from asynchronous code using a thread. [source,python] ---- def print_vertices(): - g = traversal().with(DriverRemoteConnection("ws://localhost:8182/gremlin")) + g = traversal().with(DriverRemoteConnection("http://localhost:8182/gremlin")) # Do your traversal. async def run_in_thread(): diff --git a/docs/src/reference/implementations-tinkergraph.asciidoc b/docs/src/reference/implementations-tinkergraph.asciidoc index 3d4155f2f4..41e3e9b451 100644 --- a/docs/src/reference/implementations-tinkergraph.asciidoc +++ b/docs/src/reference/implementations-tinkergraph.asciidoc @@ -298,7 +298,7 @@ public class GraphServiceTest { // build options to trigger different test configurations for a more dynamic approach public class GraphServiceTest { private static final GraphTraversalSource g = traversal().with( - new DriverRemoteConnection('ws://localhost:8182/gremlin')); + DriverRemoteConnection.using("localhost", 8182)); private static final GraphService service = new GraphService(g); @Test diff --git a/docs/src/reference/intro.asciidoc b/docs/src/reference/intro.asciidoc index 58fe92497d..37b54dc0c5 100644 --- a/docs/src/reference/intro.asciidoc +++ b/docs/src/reference/intro.asciidoc @@ -403,7 +403,7 @@ def g = traversal().with( from gremlin_python.process.anonymous_traversal_source import traversal g = traversal().with( - DriverRemoteConnection('ws://localhost:8182/gremlin')) + DriverRemoteConnection('http://localhost:8182/gremlin')) ---- As shown in the embedded approach in the previous section, once "g" is defined, writing Gremlin is structurally and
