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. GivenSettingsand optionally other arguments, this class will construct aGremlinExecutorto be used by Gremlin Server. A typical usage would be to instantiate theGremlinServerand 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 theChannelizergets access to those.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
Fields Modifier and Type Field Description com.codahale.metrics.GaugechannelsPausedGaugeThe total number of paused channels.com.codahale.metrics.GaugechannelsTotalGaugeThe total number of channels.
-
Constructor Summary
Constructors Constructor Description ServerGremlinExecutor(Settings settings, ExecutorService gremlinExecutorService, ScheduledExecutorService scheduledExecutorService)Create a new object fromSettingswhere thread pools are externally assigned.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHostOption(String key, Object value)voidclearHostOptions()longgetChannelCount()Gets the number of open channels.io.netty.channel.group.DefaultChannelGroupgetChannels()Gets all open channels (excluding theServerSocketChannel).GraphManagergetGraphManager()GremlinExecutorgetGremlinExecutor()ExecutorServicegetGremlinExecutorService()List<LifeCycleHook>getHooks()Map<String,Object>getHostOptions()longgetPausedChannelCount()Gets the number of open channels currently in a paused state that are not writeable.ScheduledExecutorServicegetScheduledExecutorService()SettingsgetSettings()ObjectremoveHostOption(String key)
-
-
-
Constructor Detail
-
ServerGremlinExecutor
public ServerGremlinExecutor(Settings settings, ExecutorService gremlinExecutorService, ScheduledExecutorService scheduledExecutorService)
Create a new object fromSettingswhere thread pools are externally assigned. Note that if thescheduleExecutorServiceClassis set tonullit will be created viaExecutors.newScheduledThreadPool(int, ThreadFactory). If either of theExecutorServiceinstances are supplied, theSettings.gremlinPoolvalue 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.
-
-