Java Code Examples for com.thinkaurelius.titan.core.TitanFactory#Builder
The following examples show how to use
com.thinkaurelius.titan.core.TitanFactory#Builder .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElasticSearchConfigTest.java From titan1withtp3.1 with Apache License 2.0 | 6 votes |
@Test public void testTitanFactoryBuilder() { String baseDir = Joiner.on(File.separator).join("target", "es", "titanfactory_jvmlocal_ext"); TitanFactory.Builder builder = TitanFactory.build(); builder.set("storage.backend", "inmemory"); builder.set("index." + INDEX_NAME + ".elasticsearch.interface", "NODE"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.node.data", "true"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.node.client", "false"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.node.local", "true"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.path.data", baseDir + File.separator + "data"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.path.work", baseDir + File.separator + "work"); builder.set("index." + INDEX_NAME + ".elasticsearch.ext.path.logs", baseDir + File.separator + "logs"); TitanGraph graph = builder.open(); // Must not throw an exception assertTrue(graph.isOpen()); graph.close(); }
Example 2
Source File: TinkerpopFeaturesTest.java From titan1withtp3.1 with Apache License 2.0 | 5 votes |
public TitanGraph open(boolean useVertexIdSetting) { TitanFactory.Builder builder = TitanFactory.build(); builder.set("storage.backend", "inmemory"); builder.set("graph.set-vertex-id", useVertexIdSetting); return builder.open(); }
Example 3
Source File: GraphOfTheGodsFactory.java From titan1withtp3.1 with Apache License 2.0 | 5 votes |
public static TitanGraph create(final String directory) { TitanFactory.Builder config = TitanFactory.build(); config.set("storage.backend", "berkeleyje"); config.set("storage.directory", directory); config.set("index." + INDEX_NAME + ".backend", "elasticsearch"); config.set("index." + INDEX_NAME + ".directory", directory + File.separator + "es"); config.set("index." + INDEX_NAME + ".elasticsearch.local-mode", true); config.set("index." + INDEX_NAME + ".elasticsearch.client-only", false); TitanGraph graph = config.open(); GraphOfTheGodsFactory.load(graph); return graph; }