Class ServerGremlinExecutor
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor
-
public class ServerGremlinExecutor extends Object
The core of script execution in Gremlin Server. GivenSettings
and optionally other arguments, this class will construct aGremlinExecutor
to be used by Gremlin Server. A typical usage would be to instantiate theGremlinServer
and then immediately callGremlinServer.getServerGremlinExecutor()
which would allow the opportunity to assign "host options" which could be used by a customChannelizer
. Add these options before callingGremlinServer.start()
to be sure theChannelizer
gets access to those.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
Fields Modifier and Type Field Description com.codahale.metrics.Gauge
channelsPausedGauge
The total number of paused channels.com.codahale.metrics.Gauge
channelsTotalGauge
The total number of channels.
-
Constructor Summary
Constructors Constructor Description ServerGremlinExecutor(Settings settings, ExecutorService gremlinExecutorService, ScheduledExecutorService scheduledExecutorService)
Create a new object fromSettings
where thread pools are externally assigned.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHostOption(String key, Object value)
void
clearHostOptions()
long
getChannelCount()
Gets the number of open channels.io.netty.channel.group.DefaultChannelGroup
getChannels()
Gets all open channels (excluding theServerSocketChannel
).GraphManager
getGraphManager()
GremlinExecutor
getGremlinExecutor()
ExecutorService
getGremlinExecutorService()
List<LifeCycleHook>
getHooks()
Map<String,Object>
getHostOptions()
long
getPausedChannelCount()
Gets the number of open channels currently in a paused state that are not writeable.ScheduledExecutorService
getScheduledExecutorService()
Settings
getSettings()
Object
removeHostOption(String key)
-
-
-
Constructor Detail
-
ServerGremlinExecutor
public ServerGremlinExecutor(Settings settings, ExecutorService gremlinExecutorService, ScheduledExecutorService scheduledExecutorService)
Create a new object fromSettings
where thread pools are externally assigned. Note that if thescheduleExecutorServiceClass
is set tonull
it will be created viaExecutors.newScheduledThreadPool(int, ThreadFactory)
. If either of theExecutorService
instances are supplied, theSettings.gremlinPool
value will be ignored for the pool size.
-
-
Method Detail
-
clearHostOptions
public void clearHostOptions()
-
getScheduledExecutorService
public ScheduledExecutorService getScheduledExecutorService()
-
getGremlinExecutor
public GremlinExecutor getGremlinExecutor()
-
getGremlinExecutorService
public ExecutorService getGremlinExecutorService()
-
getGraphManager
public GraphManager getGraphManager()
-
getSettings
public Settings getSettings()
-
getHooks
public List<LifeCycleHook> getHooks()
-
getChannels
public io.netty.channel.group.DefaultChannelGroup getChannels()
Gets all open channels (excluding theServerSocketChannel
).
-
getPausedChannelCount
public long getPausedChannelCount()
Gets the number of open channels currently in a paused state that are not writeable.
-
getChannelCount
public long getChannelCount()
Gets the number of open channels.
-
-