Class Settings
java.lang.Object
org.apache.tinkerpop.gremlin.server.Settings
Server settings as configured by a YAML file.
- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSettings for theAuthenticatorimplementation.static classSettings for theAuthenticatorimplementation.static classstatic classSettings for aMetricsreporter that writes to the console.static classSettings to configure CORS (Cross-Origin Resource Sharing) for the HTTP endpoint.static classSettings for aMetricsreporter that writes to a CSV file.static classSettings for aMetricsreporter that writes to Ganglia.static classSettings for aMetricsreporter that writes to Graphite.static classSettings for aGraphentry in the server YAML.static classstatic classstatic classSettings for aMetricsreporter that writes to JMX.static classSettings for a Java-basedLifeCycleHookconfigured in the server YAML.static classSettings for theScriptEngine.static classSettings for theMessageSerializerimplementations.static classSettings forMetricsrecorded by Gremlin Server.static classSettings for aMetricsreporter that writes to the SL4J output.static classSettings to configure SSL support.static classSettings for a declarativeTraversalSourceentry nested under a graph in the server YAML. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe full class name of theChannelizerto use in Gremlin Server.Configures CORS (Cross-Origin Resource Sharing) for the HTTP endpoint.Enable audit logging of authenticated users and gremlin evaluation requests.The full class name of theGraphManagerto use in Gremlin Server.intSize of the Gremlin thread pool.Host to bind the server to.longTime in milliseconds that the server will allow a channel to not receive requests from a client before it automatically closes.longTime in milliseconds that a transaction can remain idle (no operation running or queued) before it is automatically rolled back.longTime in milliseconds that the server will allow a channel to not send responses to a client before it sends a "ping" to see if it is still present.List ofLifeCycleHookimplementations to instantiate via reflection and execute during server initialization and shutdown.intMaximum number of request components that can be aggregated for a message.intThe maximum length of the content or each chunk.intMaximum number of concurrent transactions allowed on the server.intThe maximum length of all headers.intThe maximum length of the initial line (e.g.intMaximum number of parameters that can be passed on a request.intThe maximum length of the aggregated content for a request message.longAbsolute ceiling, in milliseconds, on the total age of a transaction regardless of activity.intMaximum size the general processing queue can grow before starting to reject requests.Configured metrics for Gremlin Server.longTime in milliseconds to wait for a transaction commit or rollback operation to complete.intPort to bind the server to.intNumber of items in a particular resultset to iterate and serialize prior to pushing the data down the wire to the client.Mapof settings forScriptEnginesetting objects keyed by the name of theScriptEngineimplementation.List ofMessageSerializerto configure.Configures settings for SSL.booleanIf set totruethealiasesoption is required on requests and Gremlin Server will use that information to control whichGraphinstances are transaction managed for that request.intSize of the boss thread pool.intSize of the worker thread pool.longThe maximum time in milliseconds that a request is allowed to execute on the server before it times out.booleandetect if the OS is linux, then use epoll instead of NIO which causes less GCintIf the number of bytes in the network send buffer exceeds this value then the channel is no longer writeable, accepting no additional writes until buffer is drained and thewriteBufferLowWaterMarkis met.intOnce the number of bytes queued in the network send buffer exceeds the high water mark, the channel will not become writeable again until the buffer is drained and it drops below this value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static org.yaml.snakeyaml.constructor.ConstructorCreatesConstructorwhich contains all configurations to parse a Gremlin Server YAML configuration file using SnakeYAML.getGraphSettings(String graphName) Returns theSettings.GraphSettingsfor the named graph, normalizing from the raw YAML value.longstatic Settingsread(InputStream stream) Read configuration from a file into a newSettingsobject.static SettingsRead configuration from a file into a newSettingsobject.
-
Field Details
-
host
Host to bind the server to. Defaults to localhost. -
port
public int portPort to bind the server to. Defaults to 8182. -
threadPoolWorker
public int threadPoolWorkerSize of the worker thread pool. Defaults to 1 and should generally not exceed 2 * number of cores. A worker thread performs non-blocking read and write for one or more Channels in a non-blocking mode. -
useEpollEventLoop
public boolean useEpollEventLoopdetect if the OS is linux, then use epoll instead of NIO which causes less GC -
gremlinPool
public int gremlinPoolSize of the Gremlin thread pool. This pool handles Gremlin script execution and other related "long-run" processing. Defaults to a setting of 0 which indicates the value should be set toRuntime#availableProcessors(). -
threadPoolBoss
public int threadPoolBossSize of the boss thread pool. Defaults to 1 and should likely stay at 1. The bossy thread accepts incoming connections on a port until it is unbound. Once a connection is accepted successfully, the boss thread passes processing to the worker threads. -
timeoutMillis
public long timeoutMillisThe maximum time in milliseconds that a request is allowed to execute on the server before it times out. Serves as the server-wide default which may be overridden on a per-request basis. Defaults to 30000. -
resultIterationBatchSize
public int resultIterationBatchSizeNumber of items in a particular resultset to iterate and serialize prior to pushing the data down the wire to the client. -
maxInitialLineLength
public int maxInitialLineLengthThe maximum length of the initial line (e.g."GET / HTTP/1.0") processed in a request, which essentially controls the maximum length of the submitted URI. This setting ties to the NettyHttpRequestDecoder. -
maxHeaderSize
public int maxHeaderSizeThe maximum length of all headers. This setting ties to the NettyHttpRequestDecoder -
maxChunkSize
public int maxChunkSizeThe maximum length of the content or each chunk. If the content length exceeds this value, the transfer encoding of the decoded request will be converted to 'chunked' and the content will be split into multipleHttpContents. If the transfer encoding of the HTTP request is 'chunked' already, each chunk will be split into smaller chunks if the length of the chunk exceeds this value. -
maxRequestContentLength
public int maxRequestContentLengthThe maximum length of the aggregated content for a request message. Works in concert withmaxChunkSizewhere chunked requests are accumulated back into a single message. A request exceeding this size will return a 413 - Request Entity Too Large status code. -
maxAccumulationBufferComponents
public int maxAccumulationBufferComponentsMaximum number of request components that can be aggregated for a message. -
writeBufferHighWaterMark
public int writeBufferHighWaterMarkIf the number of bytes in the network send buffer exceeds this value then the channel is no longer writeable, accepting no additional writes until buffer is drained and thewriteBufferLowWaterMarkis met. -
writeBufferLowWaterMark
public int writeBufferLowWaterMarkOnce the number of bytes queued in the network send buffer exceeds the high water mark, the channel will not become writeable again until the buffer is drained and it drops below this value. -
idleConnectionTimeoutMillis
public long idleConnectionTimeoutMillisTime in milliseconds that the server will allow a channel to not receive requests from a client before it automatically closes. If enabled, the value provided should typically exceed the amount of time given tokeepAliveIntervalMillis. Note that while this value is to be provided as milliseconds it will resolve to second precision. Set this value to 0 to disable this feature. -
keepAliveIntervalMillis
public long keepAliveIntervalMillisTime in milliseconds that the server will allow a channel to not send responses to a client before it sends a "ping" to see if it is still present. If it is present, the client should respond with a "pong" which will thus reset theidleConnectionTimeoutMillisand keep the channel open. If enabled, this number should be smaller than the value provided to theidleConnectionTimeoutMillis. Note that while this value is to be provided as milliseconds it will resolve to second precision. Set this value to 0 to disable this feature. -
strictTransactionManagement
public boolean strictTransactionManagementIf set totruethealiasesoption is required on requests and Gremlin Server will use that information to control whichGraphinstances are transaction managed for that request. If this setting is false (which is the default), specification ofaliasesis not required and Gremlin Server will simply apply a commit for all graphs. This setting only applies to sessionless requests. With either setting the user is responsible for their own transaction management for in-session requests. -
idleTransactionTimeoutMillis
public long idleTransactionTimeoutMillisTime in milliseconds that a transaction can remain idle (no operation running or queued) before it is automatically rolled back. This prevents resource leaks from abandoned transactions. The idle timer is suspended while an operation is in progress, so a long-running operation does not trip it (its duration is instead bounded bytimeoutMillis). Set to0to disable idle reclamation entirely. Default is 60000 (1 minute). -
perGraphCloseTimeoutMillis
public long perGraphCloseTimeoutMillisTime in milliseconds to wait for a transaction commit or rollback operation to complete. Default is 10000 (10 seconds). -
maxConcurrentTransactions
public int maxConcurrentTransactionsMaximum number of concurrent transactions allowed on the server. Default is 1000. -
maxTransactionLifetimeMillis
public long maxTransactionLifetimeMillisAbsolute ceiling, in milliseconds, on the total age of a transaction regardless of activity. UnlikeidleTransactionTimeoutMillis(which only reclaims idle transactions), this cap fires even while an operation is running, interrupting it and rolling the transaction back, so it bounds how long a single transaction can hold its dedicated worker thread and concurrency slot. The bound on transaction lifetime and slot occupancy is absolute; the bound on thread occupancy is best-effort in the same waytimeoutMillisis, since interrupting a running operation only takes effect when it reaches an interruptible point. Set to0to disable the cap. Default is 600000 (10 minutes). -
channelizer
The full class name of theChannelizerto use in Gremlin Server. -
graphManager
The full class name of theGraphManagerto use in Gremlin Server. -
maxWorkQueueSize
public int maxWorkQueueSizeMaximum size the general processing queue can grow before starting to reject requests. The general processing queue is managed by a thread pool that has its size determined bygremlinPool. All incoming requests will be processed by this thread pool. If the threads are exhausted, the requests will queue to the size specified by this value after which they will begin to reject the requests. By default this value is set to 8192. -
maxParameters
public int maxParametersMaximum 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 theHttpChannelizer. -
metrics
Configured metrics for Gremlin Server. -
graphs
MapofGraphconfigurations keyed by their binding name. Values may be either aString(path to a configuration file) or aSettings.GraphSettingsobject for graphs that need explicitTraversalSourceconfiguration. -
scriptEngines
Mapof settings forScriptEnginesetting objects keyed by the name of theScriptEngineimplementation. -
lifecycleHooks
List ofLifeCycleHookimplementations to instantiate via reflection and execute during server initialization and shutdown. -
serializers
List ofMessageSerializerto configure. If no serializers are specified then default serializers for the most current versions of "application/json" and "application/vnd.gremlin-v1.0+gryo" are applied. -
ssl
Configures settings for SSL. -
authentication
-
authorization
-
cors
Configures CORS (Cross-Origin Resource Sharing) for the HTTP endpoint. -
enableAuditLog
Enable audit logging of authenticated users and gremlin evaluation requests.
-
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
getGraphSettings
Returns theSettings.GraphSettingsfor the named graph, normalizing from the raw YAML value. Accepts aString(configuration path only), aSettings.GraphSettings, or a rawMapproduced by SnakeYAML for the structured form. -
optionalMetrics
-
optionalSsl
-
getTimeoutMillis
public long getTimeoutMillis() -
read
Read configuration from a file into a newSettingsobject. -
createDefaultYamlConstructor
protected static org.yaml.snakeyaml.constructor.Constructor createDefaultYamlConstructor()CreatesConstructorwhich contains all configurations to parse a Gremlin Server YAML configuration file using SnakeYAML.- Returns:
- a
Constructorto parse a Gremlin Server YAML
-
read
Read configuration from a file into a newSettingsobject.
-