Skip to content

Commit 7178a2e

Browse files
committed
Update WebSocket mentions in documentation CTR
1 parent ca05acf commit 7178a2e

5 files changed

Lines changed: 35 additions & 39 deletions

File tree

docs/src/dev/provider/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ class MyType(object):
560560
graphson_reader = GraphSONReader({MyType.GRAPHSON_TYPE: MyType})
561561
graphson_writer = GraphSONWriter({MyType: MyType})
562562
563-
connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g',
563+
connection = DriverRemoteConnection('http://localhost:8182/gremlin', 'g',
564564
graphson_reader=graphson_reader,
565565
graphson_writer=graphson_writer)
566566
----

docs/src/reference/gremlin-applications.asciidoc

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -546,34 +546,34 @@ include::../../../gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Docs/Reference
546546
[source,javascript]
547547
----
548548
// script
549-
const client = new Client('ws://localhost:45940/gremlin', { traversalSource: "g" });
549+
const client = new Client('http://localhost:45940/gremlin', { traversalSource: "g" });
550550
const conn = client.open();
551551
const list = conn.submit("g.V().has('person','name',name).out('knows')",{name: 'marko'}).then(function (response) { ... });
552552
553553
// traversal
554-
const g = gtraversal().with(new DriverRemoteConnection('ws://localhost:8182/gremlin'));
554+
const g = gtraversal().with(new DriverRemoteConnection('http://localhost:8182/gremlin'));
555555
const list = g.V().has("person","name","marko").out("knows").toList();
556556
----
557557
[source,python]
558558
----
559559
# script
560-
client = Client('ws://localhost:8182/gremlin', 'g')
560+
client = Client('http://localhost:8182/gremlin', 'g')
561561
list = client.submit("g.V().has('person','name',name).out('knows')",{'name': 'marko'}).all()
562562
563563
# traversal
564-
g = traversal().with(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
564+
g = traversal().with(DriverRemoteConnection('http://localhost:8182/gremlin','g'))
565565
list = g.V().has("person","name","marko").out("knows").toList()
566566
----
567567
[source,go]
568568
----
569569
// script
570-
client, err := NewClient("ws://localhost:8182/gremlin")
570+
client, err := NewClient("http://localhost:8182/gremlin")
571571
resultSet, err := client.SubmitWithOptions("g.V().has('person','name',name).out('knows')",
572572
new(RequestOptionsBuilder).AddBinding("name", "marko").Create())
573573
result, err := resultSet.All()
574574
575575
// traversal
576-
remote, err := NewDriverRemoteConnection("ws://localhost:8182/gremlin")
576+
remote, err := NewDriverRemoteConnection("http://localhost:8182/gremlin")
577577
g := Traversal_().With(remote)
578578
list, err := g.V().Has("person", "name", "marko").Out("knows").ToList()
579579
----
@@ -1006,10 +1006,10 @@ NOTE: Installing Ganglia will include `org.acplt:oncrpc`, which is an LGPL licen
10061006
Regardless of the output, the metrics gathered are the same. Each metric is prefixed with
10071007
`org.apache.tinkerpop.gremlin.server.GremlinServer` and the following metrics are reported:
10081008
1009-
* `channels.paused` - The current number of open channels (HTTP and Websocket) that have their writes to buffer paused
1009+
* `channels.paused` - The current number of open HTTP channels that have their writes to buffer paused
10101010
when the `writeBufferHighWaterMark` configuration is exceeded.
1011-
* `channels.total` - The current number of open channels (HTTP and Websocket).
1012-
* `channels.write-pauses` - The total number of pauses across all channels (HTTP and Websocket) to buffer writes where
1011+
* `channels.total` - The current number of open HTTP channels.
1012+
* `channels.write-pauses` - The total number of pauses across all HTTP channels to buffer writes where
10131013
the `writeBufferHighWaterMark` configuration is exceeded, with mean rate, as well as the 1, 5, and 15-minute rates.
10141014
* `engine-name.session.session-id.*` - Metrics related to different `GremlinScriptEngine` instances configured for
10151015
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
17981798
** Note that `evaluationTimeout` can only attempt to interrupt the evaluation on timeout. It allows Gremlin
17991799
Server to "ignore" the result of that evaluation, which means the thread in the `gremlinPool` that did the evaluation
18001800
may still be consumed after the timeout if interruption does not succeed on the thread.
1801-
* When using sessions, there are different options to consider depending on the `Channelizer` implementation being
1802-
used:
1803-
** `WebSocketChannelizer` and `WsAndHttpChannelizer` - Both of these channelizers use the `gremlinPool` only for
1804-
sessionless requests and construct a single threaded pool for each session created. In this way, these channelizers
1805-
tend to optimize sessions to be long-lived. For short-lived sessions, which may be typical when using bytecode based
1806-
remote transactions, quickly creating and destroying these sessions can be expensive. It is likely that there will be
1807-
increased garbage collection times and frequency as well as a general increase in overall server processing.
1801+
* When using transactions, the server dedicates resources to maintain transaction state for each open transaction. For
1802+
high concurrency workloads with many open transactions, the server may experience increased memory usage, increased
1803+
garbage collection times and frequency as well as a general increase in overall server processing.
18081804
* Graph element serialization for `Vertex` and `Edge` can be expensive, as their data structures are complex given the
18091805
possible existence of multi-properties and meta-properties. When returning data from Gremlin Server only return the
18101806
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.
18311827
** Consider the shape of query results as they can have an impact on server performance. The "shape" refers to the form
18321828
of the result given the query. For example, `g.V()` and `g.V().fold()` both return the same results (i.e. all the
18331829
vertices in the graph) but the former returns them one at a time in a stream and the latter collects them all in
1834-
memory in a `List` and then returns the one `List` result. Writing queries in ways that allow results that can stream
1835-
(only applies for websockets) is preferable and will allow the server to perform better. Another aspect of "shape"
1836-
can come into play when returning data of individual graph elements. For example, the `g.V()` form of query will stream,
1837-
but if each `Vertex` returned has lots of properties (e.g. properties with large strings or heavy blobs), this could
1838-
trigger scenarios where each streamed batch immediately exceeds `writeBufferHighWaterMark`. Simply exceeding the
1839-
`writeBufferHighWaterMark` may not trigger a pause as the server may quickly flush the buffer before the next batch, but
1840-
one could see how easily a write pause could be triggered in that state. It could make sense to configure a smaller
1841-
`batchSize` for queries results that have heavy individual objects in them as that would reduce the byte size of the
1842-
batch and allow buffer flushes to happen more often (though that may be a cost in and of itself).
1830+
memory in a `List` and then returns the one `List` result. Writing queries in ways that allow results to stream is
1831+
preferable and will allow the server to perform better. Another aspect of "shape" can come into play when returning data
1832+
of individual graph elements. For example, the `g.V()` form of query will stream, but if each `Vertex` returned has lots
1833+
of properties (e.g. properties with large strings or heavy blobs), this could trigger scenarios where each streamed
1834+
batch immediately exceeds `writeBufferHighWaterMark`. Simply exceeding the `writeBufferHighWaterMark` may not trigger a
1835+
pause as the server may quickly flush the buffer before the next batch, but one could see how easily a write pause could
1836+
be triggered in that state. It could make sense to configure a smaller `batchSize` for queries results that have heavy
1837+
individual objects in them as that would reduce the byte size of the batch and allow buffer flushes to happen more often
1838+
(though that may be a cost in and of itself).
18431839
18441840
[[parameterized-scripts]]
18451841
==== Parameterized Scripts

docs/src/reference/gremlin-variants.asciidoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,28 +1345,28 @@ _The server is unavailable_
13451345
13461346
[source,text]
13471347
----
1348-
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
1349-
> ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin})- no connections in pool
1348+
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
1349+
> ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin})- no connections in pool
13501350
----
13511351
13521352
_Client is likely issuing more requests than the pool size can handle_
13531353
13541354
[source,text]
13551355
----
1356-
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.
1357-
ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin})
1358-
Connection Pool Status (size=1 max=1 min=1 toCreate=0 bin=0)
1356+
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.
1357+
ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin})
1358+
Connection Pool Status (size=1 available=1 max=1 toCreate=0 bin=0 waiter=0)
13591359
> 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}
13601360
-- bin --
13611361
----
13621362
1363-
_Network traffic is slow and the websocket handshake does not complete in time_
1363+
_Network traffic is slow and the connection setup does not complete in time_
13641364
13651365
[source,text]
13661366
----
1367-
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
1368-
ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=ws://localhost:45940/gremlin})
1369-
Connection Pool Status (size=1 max=5 min=1 toCreate=0 bin=0)
1367+
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
1368+
ConnectionPool (Host{address=localhost/127.0.0.1:45940, hostUri=http://localhost:45940/gremlin})
1369+
Connection Pool Status (size=1 available=1 max=5 toCreate=0 bin=0 waiter=0)
13701370
> 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}
13711371
-- bin --
13721372
----
@@ -2876,7 +2876,7 @@ be used:
28762876
28772877
[source,python]
28782878
----
2879-
social = traversal(SocialTraversalSource).with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
2879+
social = traversal(SocialTraversalSource).with_remote(DriverRemoteConnection('http://localhost:8182/gremlin','g'))
28802880
social.persons('marko').knows('josh')
28812881
social.persons('marko').youngest_friends_age()
28822882
social.persons().filter(__.created_at_least(2)).count()
@@ -2963,7 +2963,7 @@ from asynchronous code using a thread.
29632963
[source,python]
29642964
----
29652965
def print_vertices():
2966-
g = traversal().with(DriverRemoteConnection("ws://localhost:8182/gremlin"))
2966+
g = traversal().with(DriverRemoteConnection("http://localhost:8182/gremlin"))
29672967
# Do your traversal.
29682968
29692969
async def run_in_thread():

docs/src/reference/implementations-tinkergraph.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public class GraphServiceTest {
298298
// build options to trigger different test configurations for a more dynamic approach
299299
public class GraphServiceTest {
300300
private static final GraphTraversalSource g = traversal().with(
301-
new DriverRemoteConnection('ws://localhost:8182/gremlin'));
301+
DriverRemoteConnection.using("localhost", 8182));
302302
private static final GraphService service = new GraphService(g);
303303
304304
@Test

docs/src/reference/intro.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def g = traversal().with(
403403
from gremlin_python.process.anonymous_traversal_source import traversal
404404
405405
g = traversal().with(
406-
DriverRemoteConnection('ws://localhost:8182/gremlin'))
406+
DriverRemoteConnection('http://localhost:8182/gremlin'))
407407
----
408408
409409
As shown in the embedded approach in the previous section, once "g" is defined, writing Gremlin is structurally and

0 commit comments

Comments
 (0)