public enum ElasticSearchSetup extends Enum<ElasticSearchSetup>
TransportClient or
Node from a Titan
Configuration.
TransportClient assumes that an ES cluster is already running. It does not attempt
to start an embedded ES instance. It just connects to whatever hosts are given in
GraphDatabaseConfiguration.INDEX_HOSTS.
Node can be configured to either behave strictly as a client or as both a client and ES data node. The latter is essentially a fully-fledged ES cluster node embedded in Titan. Node can also be configured to use either network or JVM local transport. In practice, JVM local transport is usually only useful for testing. Most deployments will use the network transport.
Setting arbitrary ES options is supported with both TransportClient and Node
via GraphDatabaseConfiguration.INDEX_CONF_FILE.
When this is set, it will be opened as an ordinary file and the contents will be
parsed as Elasticsearch settings. These settings override Titan's defaults but
options explicitly provided in Titan's config file (e.g. setting an explicit value for
ElasticSearchIndex.CLIENT_ONLY in
Titan's properties will override any value that might be in the ES settings file).
After loading the index conf file (when provided), any key-value pairs under the
ElasticSearchIndex.ES_EXTRAS_NS namespace
are copied into the Elasticsearch settings builder. This allows overridding arbitrary
ES settings from within the Titan properties file. Settings in the ext namespace take
precedence over those in the index conf file.
After loading the index conf file and any key-value pairs under the ext namespace,
Titan checks for ConfigOptions defined in
ElasticSearchIndex
that correspond directly to ES settings and copies them into the ES settings builder.
| Modifier and Type | Class and Description |
|---|---|
static class |
ElasticSearchSetup.Connection |
| Enum Constant and Description |
|---|
NODE
Start an ES
Node and use its attached Client. |
TRANSPORT_CLIENT
Start an ES TransportClient connected to
GraphDatabaseConfiguration.INDEX_HOSTS. |
| Modifier and Type | Method and Description |
|---|---|
abstract ElasticSearchSetup.Connection |
connect(Configuration config) |
static ElasticSearchSetup |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ElasticSearchSetup[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ElasticSearchSetup TRANSPORT_CLIENT
GraphDatabaseConfiguration.INDEX_HOSTS.public static final ElasticSearchSetup NODE
Node and use its attached Client.public static ElasticSearchSetup[] values()
for (ElasticSearchSetup c : ElasticSearchSetup.values()) System.out.println(c);
public static ElasticSearchSetup valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract ElasticSearchSetup.Connection connect(Configuration config) throws IOException
IOExceptionCopyright © 2012–2016. All rights reserved.