Skip to content

Commit 7f33ecc

Browse files
committed
Added conf and script files
1 parent a3761be commit 7f33ecc

9 files changed

+377
-4
lines changed

conf/dynamodb.properties

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#general Titan configuration
2+
gremlin.graph=com.thinkaurelius.titan.core.TitanFactory
3+
ids.block-size=100000
4+
storage.setup-wait=60000
5+
storage.buffer-size=1024
6+
# Metrics configuration - http://s3.thinkaurelius.com/docs/titan/1.0.0/titan-config-ref.html#_metrics
7+
#metrics.enabled=true
8+
#metrics.prefix=t
9+
# Required; specify logging interval in milliseconds
10+
#metrics.csv.interval=500
11+
#metrics.csv.directory=metrics
12+
# Turn off titan retries as we batch and have our own exponential backoff strategy.
13+
storage.write-time=1 ms
14+
storage.read-time=1 ms
15+
storage.backend=com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager
16+
schema.default=none
17+
18+
#Amazon DynamoDB Storage Backend for Titan configuration
19+
storage.dynamodb.force-consistent-read=true
20+
storage.dynamodb.prefix=v100
21+
storage.dynamodb.metrics-prefix=d
22+
storage.dynamodb.enable-parallel-scans=false
23+
storage.dynamodb.max-self-throttled-retries=60
24+
storage.dynamodb.control-plane-rate=10
25+
26+
# DynamoDB client configuration: credentials
27+
storage.dynamodb.client.credentials.class-name=com.amazonaws.auth.DefaultAWSCredentialsProviderChain
28+
storage.dynamodb.client.credentials.constructor-args=
29+
30+
# DynamoDB client configuration: endpoint (Below, set to DynamoDB Local as invoked by mvn test -Pstart-dynamodb-local).
31+
# You can change the endpoint to point to Production DynamoDB regions.)
32+
storage.dynamodb.client.endpoint=https://dynamodb.us-east-1.amazonaws.com
33+
34+
# max http connections - not recommended to use more than 250 connections in DynamoDB Local
35+
storage.dynamodb.client.connection-max=250
36+
# turn off sdk retries
37+
storage.dynamodb.client.retry-error-max=0
38+
39+
# DynamoDB client configuration: thread pool
40+
storage.dynamodb.client.executor.core-pool-size=25
41+
# Do not need more threads in thread pool than the number of http connections
42+
storage.dynamodb.client.executor.max-pool-size=250
43+
storage.dynamodb.client.executor.keep-alive=60000
44+
storage.dynamodb.client.executor.max-concurrent-operations=1
45+
# should be at least as large as the storage.buffer-size
46+
storage.dynamodb.client.executor.max-queue-length=1024
47+
48+
# 750 r/w CU result in provisioning the maximum equal numbers read and write Capacity Units that can
49+
# be set on one table before it is split into two or more partitions for IOPS. If you will have more than one Rexster server
50+
# accessing the same graph, you should set the read-rate and write-rate properties to values commensurately lower than the
51+
# read and write capacity of the backend tables.
52+
53+
storage.dynamodb.stores.edgestore.capacity-read=1
54+
storage.dynamodb.stores.edgestore.capacity-write=1
55+
storage.dynamodb.stores.edgestore.read-rate=1
56+
storage.dynamodb.stores.edgestore.write-rate=1
57+
storage.dynamodb.stores.edgestore.scan-limit=100
58+
59+
storage.dynamodb.stores.graphindex.capacity-read=1
60+
storage.dynamodb.stores.graphindex.capacity-write=1
61+
storage.dynamodb.stores.graphindex.read-rate=1
62+
storage.dynamodb.stores.graphindex.write-rate=1
63+
storage.dynamodb.stores.graphindex.scan-limit=100
64+
65+
storage.dynamodb.stores.systemlog.capacity-read=1
66+
storage.dynamodb.stores.systemlog.capacity-write=1
67+
storage.dynamodb.stores.systemlog.read-rate=1
68+
storage.dynamodb.stores.systemlog.write-rate=1
69+
storage.dynamodb.stores.systemlog.scan-limit=10
70+
71+
storage.dynamodb.stores.titan_ids.capacity-read=1
72+
storage.dynamodb.stores.titan_ids.capacity-write=1
73+
storage.dynamodb.stores.titan_ids.read-rate=1
74+
storage.dynamodb.stores.titan_ids.write-rate=1
75+
storage.dynamodb.stores.titan_ids.scan-limit=10
76+
77+
storage.dynamodb.stores.system_properties.capacity-read=1
78+
storage.dynamodb.stores.system_properties.capacity-write=10
79+
storage.dynamodb.stores.system_properties.read-rate=1
80+
storage.dynamodb.stores.system_properties.write-rate=1
81+
storage.dynamodb.stores.system_properties.scan-limit=10
82+
83+
storage.dynamodb.stores.txlog.capacity-read=1
84+
storage.dynamodb.stores.txlog.capacity-write=1
85+
storage.dynamodb.stores.txlog.read-rate=1
86+
storage.dynamodb.stores.txlog.write-rate=1
87+
storage.dynamodb.stores.txlog.scan-limit=10
88+
89+
# elasticsearch config that is required to run GraphOfTheGods
90+
index.search.backend=elasticsearch
91+
index.search.directory=/tmp/searchindex
92+
index.search.elasticsearch.client-only=false
93+
index.search.elasticsearch.local-mode=true
94+
index.search.elasticsearch.interface=NODE

conf/gremlin-server.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,23 @@ threadPoolWorker: 1
2121
gremlinPool: 8
2222
scriptEvaluationTimeout: 30000
2323
serializedResponseTimeout: 30000
24-
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
24+
#channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
25+
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
2526
graphs: {
2627
graph: conf/gremlin-server/dynamodb.properties}
2728
plugins:
28-
- tinkerpop.tinkergraph
29+
- aurelius.titan
30+
# - tinkerpop.tinkergraph
2931
scriptEngines: {
3032
gremlin-groovy: {
3133
imports: [java.lang.Math],
3234
staticImports: [java.lang.Math.PI],
33-
scripts: [scripts/generate-modern.groovy]}}
35+
scripts: [/scripts/empty-sample.groovy]}}
3436
serializers:
3537
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+json
3638
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/json
3739
metrics: {
38-
slf4jReporter: {enabled: true, interval: 180000}}
40+
slf4jReporter: {enabled: true, interval: 180000}}
3941
#strictTransactionManagement: false
4042
threadPoolBoss: 1
4143
maxInitialLineLength: 4096
@@ -44,3 +46,5 @@ maxChunkSize: 8192
4446
maxContentLength: 65536
4547
maxAccumulationBufferComponents: 1024
4648
resultIterationBatchSize: 64
49+
ssl: {
50+
enabled: false}

scripts/empty-sample-secure.groovy

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/*******************************************************************
21+
* This script is meant to be executed with the
22+
* conf/gremlin-server-secure.yaml configuration file as an example
23+
* of how an init script running with CompileStaticCustomizerProvider
24+
* or TypeCheckedCustomizerProvider must be written to properly
25+
* execute.
26+
*******************************************************************/
27+
28+
// An example of an initialization script that can be configured to run in Gremlin Server.
29+
// Functions defined here will go into global cache and will not be removed from there
30+
// unless there is a reset of the ScriptEngine.
31+
def addItUp(int x, int y) { x + y }
32+
33+
// an init script that returns a Map allows explicit setting of global bindings.
34+
def globals = [:]
35+
36+
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
37+
// note that the name of the key in the "global" map is unimportant. As this script,
38+
// runs as part of a sandbox configuration, type-checking is enabled and thus the
39+
// LifeCycleHook type needs to be defined for the "ctx" variable.
40+
globals << [hook : [
41+
onStartUp: { LifeCycleHook.Context ctx ->
42+
ctx.logger.info("Executed once at startup of Gremlin Server.")
43+
},
44+
onShutDown: { LifeCycleHook.Context ctx ->
45+
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
46+
}
47+
] as LifeCycleHook]
48+
49+
// define the default TraversalSource to bind queries to - this one will be named "g".
50+
globals << [g : graph.traversal()]

scripts/empty-sample.groovy

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// An example of an initialization script that can be configured to run in Gremlin Server.
21+
// Functions defined here will go into global cache and will not be removed from there
22+
// unless there is a reset of the ScriptEngine.
23+
def addItUp(x, y) { x + y }
24+
25+
// an init script that returns a Map allows explicit setting of global bindings.
26+
def globals = [:]
27+
28+
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
29+
// note that the name of the key in the "global" map is unimportant.
30+
globals << [hook : [
31+
onStartUp: { ctx ->
32+
ctx.logger.info("Executed once at startup of Gremlin Server.")
33+
},
34+
onShutDown: { ctx ->
35+
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
36+
}
37+
] as LifeCycleHook]
38+
39+
// define the default TraversalSource to bind queries to - this one will be named "g".
40+
globals << [g : graph.traversal()]

scripts/generate-classic.groovy

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// an init script that returns a Map allows explicit setting of global bindings.
21+
def globals = [:]
22+
23+
// Generates the classic graph into an "empty" TinkerGraph via LifeCycleHook.
24+
// Note that the name of the key in the "global" map is unimportant.
25+
globals << [hook : [
26+
onStartUp: { ctx ->
27+
ctx.logger.info("Loading 'classic' graph data.")
28+
TinkerFactory.generateClassic(graph)
29+
}
30+
] as LifeCycleHook]
31+
32+
// define the default TraversalSource to bind queries to - this one will be named "g".
33+
globals << [g : graph.traversal()]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// an init script that returns a Map allows explicit setting of global bindings.
21+
def globals = [:]
22+
23+
// Generates the modern graph into an "empty" TinkerGraph via LifeCycleHook.
24+
// Note that the name of the key in the "global" map is unimportant.
25+
globals << [hook : [
26+
onStartUp: { ctx ->
27+
ctx.logger.info("Loading 'modern' graph data.")
28+
TinkerFactory.generateClassic(graph)
29+
}
30+
] as LifeCycleHook]
31+
32+
// define the default TraversalSource to bind queries to - this one will be named "g".
33+
globals << [g : graph.traversal(GraphTraversalSource.build().with(ReadOnlyStrategy.instance()))]

scripts/generate-modern.groovy

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// an init script that returns a Map allows explicit setting of global bindings.
21+
def globals = [:]
22+
23+
// Generates the modern graph into an "empty" TinkerGraph via LifeCycleHook.
24+
// Note that the name of the key in the "global" map is unimportant.
25+
globals << [hook : [
26+
onStartUp: { ctx ->
27+
ctx.logger.info("Loading 'modern' graph data.")
28+
TinkerFactory.generateModern(graph)
29+
}
30+
] as LifeCycleHook]
31+
32+
// define the default TraversalSource to bind queries to - this one will be named "g".
33+
globals << [g : graph.traversal()]

scripts/load-sample.groovy

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
// Functions defined here will go into global cache and will not be removed from there
21+
// unless there is a reset of the ScriptEngine.
22+
def addItUp(x, y) { x + y }
23+
24+
// an init script that returns a Map allows explicit setting of global bindings.
25+
def globals = [:]
26+
27+
// defines a sample LifeCycleHook that prints some output to the Gremlin Server console.
28+
// note that the name of the key in the "global" map is unimportant.
29+
globals << [hook : [
30+
onStartUp: { ctx ->
31+
ctx.logger.info("Loading graph data from data/sample.kryo.")
32+
33+
// An example of an initialization script that can be configured to run in Gremlin Server.
34+
graph.io(GryoIo.build()).readGraph('data/sample.kryo')
35+
}
36+
] as LifeCycleHook]
37+
38+
// define the default TraversalSource to bind queries to - this one will be named "g".
39+
globals << [g : graph.traversal()]

0 commit comments

Comments
 (0)