Class GremlinClusterBuilder
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.GremlinClusterBuilder
-
public class GremlinClusterBuilder extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GremlinClusterBuilderacquireConnectionBackoffMillis(int acquireConnectionBackoffMillis)Number of millis to wait between each attempt to acquire a connection.GremlinClusterBuilderaddContactPoint(String address)Adds the address of a Gremlin Server to the list of servers aClientwill try to contact to send requests to.GremlinClusterBuilderaddContactPoint(Endpoint endpoint)GremlinClusterBuilderaddContactPoints(String... addresses)Add one or more the addresses of a Gremlin Servers to the list of servers aClientwill try to contact to send requests to.GremlinClusterBuilderaddContactPoints(Collection<String> addresses)GremlinClusterBuilderaddContactPoints(EndpointCollection endpointCollection)GremlinClusterBuilderaddContactPointsMetadata(Collection<Endpoint> endpointCollection)GremlinClusterBuilderaddContactPointsMetadata(Endpoint... endpointCollection)GremlinClusterBuilderaddMetricsHandler(MetricsHandler handler)GremlinClusterBuilderauthProperties(org.apache.tinkerpop.gremlin.driver.AuthProperties authProps)Specifies parameters for authentication to Gremlin Server.static GremlinClusterBuilderbuild()GremlinClusterBuilderchannelizer(Class channelizerClass)Specify theChannelizerimplementation to use on the client when creating aConnection.GremlinClusterBuilderchannelizer(String channelizerClass)Specify theChannelizerimplementation to use on the client when creating aConnection.GremlinClustercreate()GremlinClusterBuildercredentials(String username, String password)Sets theAuthProperties.Property.USERNAMEandAuthProperties.Property.PASSWORDproperties for authentication to Gremlin Server.GremlinClusterBuildereagerRefreshBackoffMillis(int eagerRefreshBackoffMillis)Minimum number of millis to wait between invoking handler supplied inonEagerRefresh.GremlinClusterBuildereagerRefreshWaitTimeMillis(int eagerRefreshWaitTimeMillis)Number of millis to wait while trying to acquire connection before invoking handler supplied inonEagerRefresh.GremlinClusterBuilderenableMetrics(boolean enableMetrics)GremlinClusterBuilderenableSsl(boolean enable)Enables connectivity over SSL - note that the server should be configured with SSL turned on for this setting to work properly.GremlinClusterBuilderendpointFilter(EndpointFilter endpointFilter)Strategy for filtering and enriching available endpoints before creating clients.GremlinClusterBuilderhandshakeInterceptor(org.apache.tinkerpop.gremlin.driver.HandshakeInterceptor interceptor)Specifies anHandshakeInterceptorthat will allow manipulation of theFullHttpRequestprior to its being sent over the websocket.GremlinClusterBuilderjaasEntry(String jaasEntry)Sets theAuthProperties.Property.JAAS_ENTRYproperties for authentication to Gremlin Server.GremlinClusterBuilderkeepAliveInterval(long keepAliveInterval)Length of time in milliseconds to wait on an idle connection before sending a keep-alive request.GremlinClusterBuilderkeyCertChainFile(String keyCertChainFile)Deprecated.As of release 3.2.10, replaced bykeyStoreGremlinClusterBuilderkeyFile(String keyFile)Deprecated.As of release 3.2.10, replaced bykeyStoreGremlinClusterBuilderkeyPassword(String keyPassword)Deprecated.As of release 3.2.10, replaced bykeyStorePasswordGremlinClusterBuilderkeyStore(String keyStore)The file location of the private key in JKS or PKCS#12 format.GremlinClusterBuilderkeyStorePassword(String keyStorePassword)The password of thekeyStore, ornullif it's not password-protected.GremlinClusterBuilderkeyStoreType(String keyStoreType)GremlinClusterBuilderloadBalancingStrategy(Supplier<org.apache.tinkerpop.gremlin.driver.LoadBalancingStrategy> loadBalancingStrategy)Specifies the load balancing strategy to use on the client side.GremlinClusterBuildermaxConnectionPoolSize(int maxSize)The maximum size that theConnectionPoolcan grow.GremlinClusterBuildermaxContentLength(int maxContentLength)The maximum size in bytes of any request sent to the server.GremlinClusterBuildermaxInProcessPerConnection(int maxInProcessPerConnection)The maximum number of in-flight requests that can occur on aConnection.GremlinClusterBuildermaxSimultaneousUsagePerConnection(int maxSimultaneousUsagePerConnection)The maximum number of times that aConnectioncan be borrowed from the pool simultaneously.GremlinClusterBuildermaxWaitForClose(int maxWait)If the connection is using a "session" this setting represents the amount of time in milliseconds to wait for that session to close before timing out where the default value is 3000.GremlinClusterBuildermaxWaitForConnection(int maxWait)The maximum amount of time to wait for a connection to be borrowed from the connection pool.GremlinClusterBuilderminConnectionPoolSize(int minSize)The minimum size of theConnectionPool.GremlinClusterBuilderminInProcessPerConnection(int minInProcessPerConnection)The minimum number of in-flight requests that can occur on aConnectionbefore it is considered for closing on return to theConnectionPool.GremlinClusterBuilderminSimultaneousUsagePerConnection(int minSimultaneousUsagePerConnection)The minimum number of times that aConnectionshould be borrowed from the pool before it falls under consideration for closing.GremlinClusterBuildernioPoolSize(int nioPoolSize)Size of the pool for handling request/response operations.GremlinClusterBuilderonEagerRefresh(OnEagerRefresh eventHandler)Handler to be invoked aftereagerRefreshWaitTimeMillis.GremlinClusterBuilderpath(String path)The path to the Gremlin service on the host which is "/gremlin" by default.GremlinClusterBuilderport(int port)Sets the port that the Gremlin Servers will be listening on.GremlinClusterBuilderprotocol(String protocol)Sets theAuthProperties.Property.PROTOCOLproperties for authentication to Gremlin Server.GremlinClusterBuilderreconnectInterval(int interval)Time in milliseconds to wait between retries when attempting to reconnect to a dead host.GremlinClusterBuilderresultIterationBatchSize(int size)Override the server setting that determines how many results are returned per batch.GremlinClusterBuilderserializer(String mimeType)Set theMessageSerializerto use given the exact name of aSerializersenum.GremlinClusterBuilderserializer(org.apache.tinkerpop.gremlin.driver.MessageSerializer serializer)Sets theMessageSerializerto use.GremlinClusterBuilderserializer(org.apache.tinkerpop.gremlin.driver.ser.Serializers mimeType)Set theMessageSerializerto use via theSerializersenum.GremlinClusterBuildersslCipherSuites(List<String> sslCipherSuites)A list of cipher suites to enable.GremlinClusterBuildersslContext(io.netty.handler.ssl.SslContext sslContext)Explicitly set theSslContextfor when more flexibility is required in the configuration than is allowed by theGremlinClusterBuilder.GremlinClusterBuildersslEnabledProtocols(List<String> sslEnabledProtocols)A list of SSL protocols to enable.GremlinClusterBuildersslSkipCertValidation(boolean sslSkipCertValidation)If true, trust all certificates and do not perform any validation.GremlinClusterBuildertopologyAwareBuilderConfigurator(TopologyAwareBuilderConfigurator configurator)GremlinClusterBuildertrustCertificateChainFile(String certificateChainFile)Deprecated.As of release 3.2.10, replaced bytrustStoreGremlinClusterBuildertrustStore(String trustStore)The file location for a SSL Certificate Chain to use when SSL is enabled.GremlinClusterBuildertrustStorePassword(String trustStorePassword)The password of thetrustStore, ornullif it's not password-protected.GremlinClusterBuildervalidationRequest(String script)Specify a valid Gremlin script that can be used to test remote operations.GremlinClusterBuilderworkerPoolSize(int workerPoolSize)Size of the pool for handling background work.
-
-
-
Method Detail
-
build
public static GremlinClusterBuilder build()
-
topologyAwareBuilderConfigurator
public GremlinClusterBuilder topologyAwareBuilderConfigurator(TopologyAwareBuilderConfigurator configurator)
-
addMetricsHandler
public GremlinClusterBuilder addMetricsHandler(MetricsHandler handler)
-
enableMetrics
public GremlinClusterBuilder enableMetrics(boolean enableMetrics)
-
acquireConnectionBackoffMillis
public GremlinClusterBuilder acquireConnectionBackoffMillis(int acquireConnectionBackoffMillis)
Number of millis to wait between each attempt to acquire a connection.
-
eagerRefreshBackoffMillis
public GremlinClusterBuilder eagerRefreshBackoffMillis(int eagerRefreshBackoffMillis)
Minimum number of millis to wait between invoking handler supplied inonEagerRefresh.
-
eagerRefreshWaitTimeMillis
public GremlinClusterBuilder eagerRefreshWaitTimeMillis(int eagerRefreshWaitTimeMillis)
Number of millis to wait while trying to acquire connection before invoking handler supplied inonEagerRefresh.
-
onEagerRefresh
public GremlinClusterBuilder onEagerRefresh(OnEagerRefresh eventHandler)
Handler to be invoked aftereagerRefreshWaitTimeMillis. The handler should return aSupplier.
-
endpointFilter
public GremlinClusterBuilder endpointFilter(EndpointFilter endpointFilter)
Strategy for filtering and enriching available endpoints before creating clients.
-
nioPoolSize
public GremlinClusterBuilder nioPoolSize(int nioPoolSize)
Size of the pool for handling request/response operations. Defaults to the number of available processors.
-
workerPoolSize
public GremlinClusterBuilder workerPoolSize(int workerPoolSize)
Size of the pool for handling background work. Defaults to the number of available processors multiplied by 2
-
path
public GremlinClusterBuilder path(String path)
The path to the Gremlin service on the host which is "/gremlin" by default.
-
serializer
public GremlinClusterBuilder serializer(String mimeType)
Set theMessageSerializerto use given the exact name of aSerializersenum. Note that setting this value this way will not allow specific configuration of the serializer itself. If specific configuration is required * please useserializer(MessageSerializer).
-
serializer
public GremlinClusterBuilder serializer(org.apache.tinkerpop.gremlin.driver.ser.Serializers mimeType)
Set theMessageSerializerto use via theSerializersenum. If specific configuration is required please useserializer(MessageSerializer).
-
serializer
public GremlinClusterBuilder serializer(org.apache.tinkerpop.gremlin.driver.MessageSerializer serializer)
Sets theMessageSerializerto use.
-
enableSsl
public GremlinClusterBuilder enableSsl(boolean enable)
Enables connectivity over SSL - note that the server should be configured with SSL turned on for this setting to work properly.
-
sslContext
public GremlinClusterBuilder sslContext(io.netty.handler.ssl.SslContext sslContext)
Explicitly set theSslContextfor when more flexibility is required in the configuration than is allowed by theGremlinClusterBuilder. If this value is set to something other thannullthen all other related SSL settings are ignored. TheenableSslsetting should still be set totruefor this setting to take effect.
-
trustCertificateChainFile
@Deprecated public GremlinClusterBuilder trustCertificateChainFile(String certificateChainFile)
Deprecated.As of release 3.2.10, replaced bytrustStoreFile location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the defaultTrustManagerwill be used.
-
keepAliveInterval
public GremlinClusterBuilder keepAliveInterval(long keepAliveInterval)
Length of time in milliseconds to wait on an idle connection before sending a keep-alive request. This setting is only relevant toChannelizerimplementations that returntrueforChannelizer#supportsKeepAlive(). Set to zero to disable this feature.
-
keyCertChainFile
@Deprecated public GremlinClusterBuilder keyCertChainFile(String keyCertChainFile)
Deprecated.As of release 3.2.10, replaced bykeyStoreThe X.509 certificate chain file in PEM format.
-
keyFile
@Deprecated public GremlinClusterBuilder keyFile(String keyFile)
Deprecated.As of release 3.2.10, replaced bykeyStoreThe PKCS#8 private key file in PEM format.
-
keyPassword
@Deprecated public GremlinClusterBuilder keyPassword(String keyPassword)
Deprecated.As of release 3.2.10, replaced bykeyStorePasswordThe password of thekeyFile, ornullif it's not password-protected.
-
keyStore
public GremlinClusterBuilder keyStore(String keyStore)
The file location of the private key in JKS or PKCS#12 format.
-
keyStorePassword
public GremlinClusterBuilder keyStorePassword(String keyStorePassword)
The password of thekeyStore, ornullif it's not password-protected.
-
trustStore
public GremlinClusterBuilder trustStore(String trustStore)
The file location for a SSL Certificate Chain to use when SSL is enabled. If this value is not provided and SSL is enabled, the defaultTrustManagerwill be used.
-
trustStorePassword
public GremlinClusterBuilder trustStorePassword(String trustStorePassword)
The password of thetrustStore, ornullif it's not password-protected.
-
keyStoreType
public GremlinClusterBuilder keyStoreType(String keyStoreType)
-
sslEnabledProtocols
public GremlinClusterBuilder sslEnabledProtocols(List<String> sslEnabledProtocols)
A list of SSL protocols to enable. @see JSSE Protocols
-
sslCipherSuites
public GremlinClusterBuilder sslCipherSuites(List<String> sslCipherSuites)
A list of cipher suites to enable. @see Cipher Suites
-
sslSkipCertValidation
public GremlinClusterBuilder sslSkipCertValidation(boolean sslSkipCertValidation)
If true, trust all certificates and do not perform any validation.
-
minInProcessPerConnection
public GremlinClusterBuilder minInProcessPerConnection(int minInProcessPerConnection)
The minimum number of in-flight requests that can occur on aConnectionbefore it is considered for closing on return to theConnectionPool.
-
maxInProcessPerConnection
public GremlinClusterBuilder maxInProcessPerConnection(int maxInProcessPerConnection)
The maximum number of in-flight requests that can occur on aConnection. This represents an indication of how busy aConnectionis allowed to be. This number is linked to themaxSimultaneousUsagePerConnectionsetting, but is slightly different in that it refers to the total number of requests on aConnection. In other words, aConnectionmight be borrowed once to have multiple requests executed against it. This number controls the maximum number of requests whereasmaxInProcessPerConnectioncontrols the times borrowed.
-
maxSimultaneousUsagePerConnection
public GremlinClusterBuilder maxSimultaneousUsagePerConnection(int maxSimultaneousUsagePerConnection)
The maximum number of times that aConnectioncan be borrowed from the pool simultaneously. This represents an indication of how busy aConnectionis allowed to be. Set too large and theConnectionmay queue requests too quickly, rather than wait for an availableConnectionor create a fresh one. If set too small, theConnectionwill show as busy very quickly thus forcing waits for availableConnectioninstances in the pool when there is more capacity available.
-
minSimultaneousUsagePerConnection
public GremlinClusterBuilder minSimultaneousUsagePerConnection(int minSimultaneousUsagePerConnection)
The minimum number of times that aConnectionshould be borrowed from the pool before it falls under consideration for closing. If aConnectionis not busy and theminConnectionPoolSizeis exceeded, then there is no reason to keep that connection open. Set too large andConnectionthat isn't busy will continue to consume resources when it is not being used. Set too small andConnectioninstances will be destroyed when the driver might still be busy.
-
maxConnectionPoolSize
public GremlinClusterBuilder maxConnectionPoolSize(int maxSize)
The maximum size that theConnectionPoolcan grow.
-
minConnectionPoolSize
public GremlinClusterBuilder minConnectionPoolSize(int minSize)
The minimum size of theConnectionPool. When theClientis started,Connectionobjects will be initially constructed to this size.
-
resultIterationBatchSize
public GremlinClusterBuilder resultIterationBatchSize(int size)
Override the server setting that determines how many results are returned per batch.
-
maxWaitForConnection
public GremlinClusterBuilder maxWaitForConnection(int maxWait)
The maximum amount of time to wait for a connection to be borrowed from the connection pool.
-
maxWaitForClose
public GremlinClusterBuilder maxWaitForClose(int maxWait)
If the connection is using a "session" this setting represents the amount of time in milliseconds to wait for that session to close before timing out where the default value is 3000. Note that the server will eventually clean up dead sessions itself on expiration of the session or during shutdown.
-
maxContentLength
public GremlinClusterBuilder maxContentLength(int maxContentLength)
The maximum size in bytes of any request sent to the server. This number should not exceed the same setting defined on the server.
-
channelizer
public GremlinClusterBuilder channelizer(String channelizerClass)
Specify theChannelizerimplementation to use on the client when creating aConnection.
-
channelizer
public GremlinClusterBuilder channelizer(Class channelizerClass)
Specify theChannelizerimplementation to use on the client when creating aConnection.
-
validationRequest
public GremlinClusterBuilder validationRequest(String script)
Specify a valid Gremlin script that can be used to test remote operations. This script should be designed to return quickly with the least amount of overhead possible. By default, the script sends an empty string. If the graph does not support that sort of script because it requires all scripts to include a reference to a graph then a good option might beg.inject().
-
reconnectInterval
public GremlinClusterBuilder reconnectInterval(int interval)
Time in milliseconds to wait between retries when attempting to reconnect to a dead host.
-
loadBalancingStrategy
public GremlinClusterBuilder loadBalancingStrategy(Supplier<org.apache.tinkerpop.gremlin.driver.LoadBalancingStrategy> loadBalancingStrategy)
Specifies the load balancing strategy to use on the client side.
-
authProperties
public GremlinClusterBuilder authProperties(org.apache.tinkerpop.gremlin.driver.AuthProperties authProps)
Specifies parameters for authentication to Gremlin Server.
-
credentials
public GremlinClusterBuilder credentials(String username, String password)
Sets theAuthProperties.Property.USERNAMEandAuthProperties.Property.PASSWORDproperties for authentication to Gremlin Server.
-
protocol
public GremlinClusterBuilder protocol(String protocol)
Sets theAuthProperties.Property.PROTOCOLproperties for authentication to Gremlin Server.
-
jaasEntry
public GremlinClusterBuilder jaasEntry(String jaasEntry)
Sets theAuthProperties.Property.JAAS_ENTRYproperties for authentication to Gremlin Server.
-
addContactPoint
public GremlinClusterBuilder addContactPoint(String address)
Adds the address of a Gremlin Server to the list of servers aClientwill try to contact to send requests to. The address should be parseable byInetAddress.getByName(String). That's the only validation performed at this point. No connection to the host is attempted.
-
addContactPoints
public GremlinClusterBuilder addContactPoints(String... addresses)
Add one or more the addresses of a Gremlin Servers to the list of servers aClientwill try to contact to send requests to. The address should be parseable byInetAddress.getByName(String). That's the only validation performed at this point. No connection to the host is attempted.
-
addContactPoints
public GremlinClusterBuilder addContactPoints(Collection<String> addresses)
-
addContactPoint
public GremlinClusterBuilder addContactPoint(Endpoint endpoint)
-
addContactPoints
public GremlinClusterBuilder addContactPoints(EndpointCollection endpointCollection)
-
addContactPointsMetadata
public GremlinClusterBuilder addContactPointsMetadata(Endpoint... endpointCollection)
-
addContactPointsMetadata
public GremlinClusterBuilder addContactPointsMetadata(Collection<Endpoint> endpointCollection)
-
port
public GremlinClusterBuilder port(int port)
Sets the port that the Gremlin Servers will be listening on.
-
handshakeInterceptor
public GremlinClusterBuilder handshakeInterceptor(org.apache.tinkerpop.gremlin.driver.HandshakeInterceptor interceptor)
Specifies anHandshakeInterceptorthat will allow manipulation of theFullHttpRequestprior to its being sent over the websocket.
-
create
public GremlinCluster create()
-
-