You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by co...@apache.org on 2026/04/14 19:52:37 UTC
(tinkerpop) 02/02: add airroutes server config
This is an automated email from the ASF dual-hosted git repository.
colegreer pushed a commit to branch TINKERPOP-3107
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 4316f890baae2b772f8aa7df51f4c37ff8611f45
Author: Cole Greer <Co...@improving.com>
AuthorDate: Tue Apr 14 12:52:26 2026 -0700
add airroutes server config
---
docs/src/reference/gremlin-applications.asciidoc | 2 +-
docs/src/upgrade/release-4.x.x.asciidoc | 2 +-
gremlin-server/conf/gremlin-server-airroutes.yaml | 43 ++++++++++++++++++++++
.../server/util/TinkerFactoryDataLoader.java | 5 ++-
.../server/GremlinServerConfigIntegrateTest.java | 1 +
.../server/util/TinkerFactoryDataLoaderTest.java | 20 ++++++++++
6 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 1d0d0a0c96..573a7c4199 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -538,7 +538,7 @@ Each entry specifies:
The built-in `TinkerFactoryDataLoader` loads TinkerFactory sample datasets into a graph. It accepts two config
parameters: `graph` (the name of the graph as defined in `graphs`) and `dataset` (one of `modern`, `classic`, `crew`,
-`grateful`, or `sink`).
+`grateful`, `sink`, or `airroutes`).
Custom `LifeCycleHook` implementations must have a no-arg constructor and implement the `onStartUp(Context)` and
`onShutDown(Context)` methods. The `Context` provides access to a `Logger` and the `GraphManager`.
diff --git a/docs/src/upgrade/release-4.x.x.asciidoc b/docs/src/upgrade/release-4.x.x.asciidoc
index 6cd0fdabd4..9decb6ded9 100644
--- a/docs/src/upgrade/release-4.x.x.asciidoc
+++ b/docs/src/upgrade/release-4.x.x.asciidoc
@@ -84,7 +84,7 @@ lifecycleHooks:
Each entry specifies a `className` implementing `LifeCycleHook` and an optional `config` map passed to the hook's
`init()` method. The built-in `TinkerFactoryDataLoader` supports datasets: `modern`, `classic`, `crew`, `grateful`,
-and `sink`.
+`sink`, and `airroutes`.
===== Deprecation of Groovy Init Scripts
diff --git a/gremlin-server/conf/gremlin-server-airroutes.yaml b/gremlin-server/conf/gremlin-server-airroutes.yaml
new file mode 100644
index 0000000000..c4c4529f8f
--- /dev/null
+++ b/gremlin-server/conf/gremlin-server-airroutes.yaml
@@ -0,0 +1,43 @@
+# 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.
+
+host: localhost
+port: 8182
+evaluationTimeout: 30000
+channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
+graphs: {
+ graph: conf/tinkergraph-empty.properties}
+lifecycleHooks:
+ - { className: org.apache.tinkerpop.gremlin.server.util.TinkerFactoryDataLoader, config: {graph: graph, dataset: airroutes}}
+serializers:
+ - { className: org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV4, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3] }} # application/json
+ - { className: org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV4} # application/vnd.graphbinary-v4.0
+metrics: {
+ slf4jReporter: {enabled: true, interval: 180000}}
+strictTransactionManagement: false
+idleConnectionTimeout: 0
+keepAliveInterval: 0
+maxInitialLineLength: 4096
+maxHeaderSize: 8192
+maxChunkSize: 8192
+maxRequestContentLength: 10485760
+maxAccumulationBufferComponents: 1024
+resultIterationBatchSize: 64
+writeBufferLowWaterMark: 32768
+writeBufferHighWaterMark: 65536
+ssl: {
+ enabled: false}
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoader.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoader.java
index 5cc87f8835..a211d81426 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoader.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoader.java
@@ -31,7 +31,7 @@ import java.util.Map;
* <p>Configuration parameters (via {@code config} in YAML):
* <ul>
* <li>{@code graph} — name of the graph (as defined in {@code graphs:} config) to load data into</li>
- * <li>{@code dataset} — which dataset to load: modern, classic, crew, grateful, sink</li>
+ * <li>{@code dataset} — which dataset to load: modern, classic, crew, grateful, sink, airroutes</li>
* </ul>
*
* <p>Example YAML usage:
@@ -85,6 +85,9 @@ public class TinkerFactoryDataLoader implements LifeCycleHook {
case "sink":
TinkerFactory.generateKitchenSink(tinkerGraph);
break;
+ case "airroutes":
+ TinkerFactory.generateAirRoutes(tinkerGraph);
+ break;
default:
c.getLogger().warn("TinkerFactoryDataLoader unknown dataset [{}]", dataset);
return;
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerConfigIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerConfigIntegrateTest.java
index 38e89cbddb..835aad5732 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerConfigIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerConfigIntegrateTest.java
@@ -57,6 +57,7 @@ public class GremlinServerConfigIntegrateTest {
"gremlin-server-min.yaml",
"gremlin-server-modern.yaml",
"gremlin-server-classic.yaml",
+ "gremlin-server-airroutes.yaml",
"gremlin-server-modern-readonly.yaml",
"gremlin-server-rest-modern.yaml",
"gremlin-server-transaction.yaml"
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoaderTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoaderTest.java
index 9a06fd29b5..0700c48be3 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoaderTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/util/TinkerFactoryDataLoaderTest.java
@@ -213,4 +213,24 @@ public class TinkerFactoryDataLoaderTest {
graph.close();
}
}
+
+ @Test
+ public void onStartUpShouldLoadAirRoutes() {
+ final TinkerFactoryDataLoader loader = new TinkerFactoryDataLoader();
+ final Map<String, Object> config = new HashMap<>();
+ config.put("graph", "graph");
+ config.put("dataset", "airroutes");
+ loader.init(config);
+
+ final TinkerGraph graph = TinkerGraph.open();
+ try {
+ final GraphManager gm = mock(GraphManager.class);
+ when(gm.getGraph("graph")).thenReturn(graph);
+
+ loader.onStartUp(createContext(gm));
+ assertThat((int) graph.traversal().V().count().next().longValue(), greaterThan(0));
+ } finally {
+ graph.close();
+ }
+ }
}