Class Settings
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.server.Settings
 
- 
 public class Settings extends Object Server settings as configured by a YAML file.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSettings.AuthenticationSettingsSettings for theAuthenticatorimplementation.static classSettings.AuthorizationSettingsSettings for theAuthenticatorimplementation.static classSettings.BaseMetricsstatic classSettings.ConsoleReporterMetricsSettings for aMetricsreporter that writes to the console.static classSettings.CsvReporterMetricsSettings for aMetricsreporter that writes to a CSV file.static classSettings.GangliaReporterMetricsSettings for aMetricsreporter that writes to Ganglia.static classSettings.GraphiteReporterMetricsSettings for aMetricsreporter that writes to Graphite.static classSettings.HostPortIntervalMetricsstatic classSettings.IntervalMetricsstatic classSettings.JmxReporterMetricsSettings for aMetricsreporter that writes to JMX.static classSettings.ProcessorSettingsCustom configurations for anyOpProcessorimplementations.static classSettings.ScriptEngineSettingsSettings for theScriptEngine.static classSettings.SerializerSettingsSettings for theMessageSerializerimplementations.static classSettings.ServerMetricsSettings forMetricsrecorded by Gremlin Server.static classSettings.Slf4jReporterMetricsSettings for aMetricsreporter that writes to the SL4J output.static classSettings.SslSettingsSettings to configure SSL support.
 - 
Field SummaryFields Modifier and Type Field Description Settings.AuthenticationSettingsauthenticationSettings.AuthorizationSettingsauthorizationStringchannelizerThe full class name of theChannelizerto use in Gremlin Server.BooleanenableAuditLogEnable audit logging of authenticated users and gremlin evaluation requests.longevaluationTimeoutTime in milliseconds to wait for a request (script or bytecode) to complete execution.StringgraphManagerThe full class name of theGraphManagerto use in Gremlin Server.Map<String,String>graphsintgremlinPoolSize of the Gremlin thread pool.StringhostHost to bind the server to.longidleConnectionTimeoutTime in milliseconds that the server will allow a channel to not receive requests from a client before it automatically closes.longkeepAliveIntervalTime 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.intmaxAccumulationBufferComponentsMaximum number of request components that can be aggregated for a message.intmaxChunkSizeThe maximum length of the content or each chunk.intmaxContentLengthThe maximum length of the aggregated content for a message.intmaxHeaderSizeThe maximum length of all headers.intmaxInitialLineLengthThe maximum length of the initial line (e.g.intmaxParametersMaximum number of parameters that can be passed on a request.intmaxSessionTaskQueueSizeMaximum size that an individualSessioncan queue requests before starting to reject them.intmaxWorkQueueSizeMaximum size the general processing queue can grow before starting to reject requests.Settings.ServerMetricsmetricsConfigured metrics for Gremlin Server.intportPort to bind the server to.List<Settings.ProcessorSettings>processorsCustom settings forOpProcessorimplementations.intresultIterationBatchSizeNumber of items in a particular resultset to iterate and serialize prior to pushing the data down the wire to the client.Map<String,Settings.ScriptEngineSettings>scriptEnginesMapof settings forScriptEnginesetting objects keyed by the name of theScriptEngineimplementation.List<Settings.SerializerSettings>serializersList ofMessageSerializerto configure.longsessionLifetimeTimeoutThe time in milliseconds that aUnifiedChannelizersession can exist.Settings.SslSettingssslConfigures settings for SSL.booleanstrictTransactionManagementIf set totruethealiasesoption is required on requests and Gremlin Server will use that information to control whichGraphinstances are transaction managed for that request.intthreadPoolBossSize of the boss thread pool.intthreadPoolWorkerSize of the worker thread pool.booleanuseCommonEngineForSessionsWhentrueand using theUnifiedChannelizerthe same engine that will be used to server sessionless requests will also be use to serve sessions.booleanuseEpollEventLoopdetect if the OS is linux, then use epoll instead of NIO which causes less GCbooleanuseGlobalFunctionCacheForSessionsEnable the global function cache for sessions when using theUnifiedChannelizer.intwriteBufferHighWaterMarkIf 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.intwriteBufferLowWaterMarkOnce 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 SummaryConstructors Constructor Description Settings()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.yaml.snakeyaml.constructor.ConstructorcreateDefaultYamlConstructor()CreatesConstructorwhich contains all configurations to parse a Gremlin Server YAML configuration file using SnakeYAML.longgetEvaluationTimeout()Optional<Settings.ServerMetrics>optionalMetrics()Optional<Settings.ProcessorSettings>optionalProcessor(Class<? extends OpProcessor> clazz)Find theSettings.ProcessorSettingsrelated to the specified class.Optional<Settings.SslSettings>optionalSsl()static Settingsread(InputStream stream)Read configuration from a file into a newSettingsobject.static Settingsread(String file)Read configuration from a file into a newSettingsobject.
 
- 
- 
- 
Field Detail- 
hostpublic String host Host to bind the server to. Defaults to localhost.
 - 
portpublic int port Port to bind the server to. Defaults to 8182.
 - 
threadPoolWorkerpublic int threadPoolWorker Size 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.
 - 
useEpollEventLooppublic boolean useEpollEventLoop detect if the OS is linux, then use epoll instead of NIO which causes less GC
 - 
gremlinPoolpublic int gremlinPool Size 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().
 - 
threadPoolBosspublic int threadPoolBoss Size 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.
 - 
evaluationTimeoutpublic long evaluationTimeout Time in milliseconds to wait for a request (script or bytecode) to complete execution. Defaults to 30000.
 - 
resultIterationBatchSizepublic int resultIterationBatchSize Number of items in a particular resultset to iterate and serialize prior to pushing the data down the wire to the client.
 - 
maxInitialLineLengthpublic int maxInitialLineLength The 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.
 - 
maxHeaderSizepublic int maxHeaderSize The maximum length of all headers. This setting ties to the NettyHttpRequestDecoder
 - 
maxChunkSizepublic int maxChunkSize The 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.
 - 
maxContentLengthpublic int maxContentLength The maximum length of the aggregated content for a 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. A response exceeding this size will raise an internal exception.
 - 
maxAccumulationBufferComponentspublic int maxAccumulationBufferComponents Maximum number of request components that can be aggregated for a message.
 - 
writeBufferHighWaterMarkpublic int writeBufferHighWaterMark If 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.
 - 
writeBufferLowWaterMarkpublic int writeBufferLowWaterMark Once 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.
 - 
idleConnectionTimeoutpublic long idleConnectionTimeout Time 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 tokeepAliveInterval. 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.
 - 
keepAliveIntervalpublic long keepAliveInterval Time 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 theidleConnectionTimeoutand keep the channel open. If enabled, this number should be smaller than the value provided to theidleConnectionTimeout. 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.
 - 
strictTransactionManagementpublic boolean strictTransactionManagement If 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.
 - 
channelizerpublic String channelizer The full class name of theChannelizerto use in Gremlin Server.
 - 
graphManagerpublic String graphManager The full class name of theGraphManagerto use in Gremlin Server.
 - 
maxWorkQueueSizepublic int maxWorkQueueSize Maximum 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. This value should be taken in account with themaxSessionTaskQueueSizewhich is related in some respects. A request that starts a newSessionis handled by this queue, but additional requests to a createdSessionwill queue separately given that setting per session. By default this value is set to 8192.
 - 
maxSessionTaskQueueSizepublic int maxSessionTaskQueueSize Maximum size that an individualSessioncan queue requests before starting to reject them. Note that this configuration only applies to theUnifiedChannelizer. By default this value is set to 4096.- See Also:
- maxWorkQueueSize
 
 - 
maxParameterspublic int maxParameters Maximum 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 theUnifiedChannelizer.
 - 
sessionLifetimeTimeoutpublic long sessionLifetimeTimeout The time in milliseconds that aUnifiedChannelizersession can exist. This value cannot be extended beyond this value irrespective of the number of requests and their individual timeouts. Requests must complete within this time frame. If this timeout is reached while there is a running evaluation, there will be an attempt to interrupt it which will result in a timeout error to the client. If there are existing requests enqueued for the session when this timeout is reached, those requests will not be executed and will be closed with server errors. Open transactions will be issued a rollback. The default is 10 minutes.
 - 
useGlobalFunctionCacheForSessionspublic boolean useGlobalFunctionCacheForSessions Enable the global function cache for sessions when using theUnifiedChannelizer. This setting is only relevant whenuseGlobalFunctionCacheForSessionsisfalse. When {@link true} it means that functions created in one request to a session remain available on the next request to that session.
 - 
useCommonEngineForSessionspublic boolean useCommonEngineForSessions Whentrueand using theUnifiedChannelizerthe same engine that will be used to server sessionless requests will also be use to serve sessions. The default value oftrueis recommended as it reduces the amount of object creation required for each session and should generally lead to better performance especially if the expectation is that there will be many sessions being created and destroyed rapidly. Setting this value tofalseis mostly present to support specific use cases that may require each session having its own engine or to match previous functionality provided by the older channelizers produced prior to 3.5.0.
 - 
metricspublic Settings.ServerMetrics metrics Configured metrics for Gremlin Server.
 - 
scriptEnginespublic Map<String,Settings.ScriptEngineSettings> scriptEngines Mapof settings forScriptEnginesetting objects keyed by the name of theScriptEngineimplementation.
 - 
serializerspublic List<Settings.SerializerSettings> 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.
 - 
sslpublic Settings.SslSettings ssl Configures settings for SSL.
 - 
authenticationpublic Settings.AuthenticationSettings authentication 
 - 
authorizationpublic Settings.AuthorizationSettings authorization 
 - 
enableAuditLogpublic Boolean enableAuditLog Enable audit logging of authenticated users and gremlin evaluation requests.
 - 
processorspublic List<Settings.ProcessorSettings> processors Custom settings forOpProcessorimplementations. Implementations are loaded viaServiceLoaderbut custom configurations can be supplied through this configuration.
 
- 
 - 
Method Detail- 
optionalProcessorpublic Optional<Settings.ProcessorSettings> optionalProcessor(Class<? extends OpProcessor> clazz) Find theSettings.ProcessorSettingsrelated to the specified class. If there are multiple entries then only the first is returned.
 - 
optionalMetricspublic Optional<Settings.ServerMetrics> optionalMetrics() 
 - 
optionalSslpublic Optional<Settings.SslSettings> optionalSsl() 
 - 
getEvaluationTimeoutpublic long getEvaluationTimeout() 
 - 
readpublic static Settings read(String file) throws Exception Read configuration from a file into a newSettingsobject.
 - 
createDefaultYamlConstructorprotected 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
 
 - 
readpublic static Settings read(InputStream stream) Read configuration from a file into a newSettingsobject.
 
- 
 
-