public void clopen(Object... settings) { config = getConfiguration(); if (mgmt != null && mgmt.isOpen()) mgmt.rollback(); if (null != tx && tx.isOpen()) tx.commit(); if (settings != null && settings.length > 0) { Map<TestConfigOption, Object> options = validateConfigOptions(settings); TitanManagement gconf = null; ModifiableConfiguration lconf = new ModifiableConfiguration( GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.LOCAL); for (Map.Entry<TestConfigOption, Object> option : options.entrySet()) { if (option.getKey().option.isLocal()) { lconf.set(option.getKey().option, option.getValue(), option.getKey().umbrella); } else { if (gconf == null) gconf = graph.openManagement(); gconf.set( ConfigElement.getPath(option.getKey().option, option.getKey().umbrella), option.getValue()); } } if (gconf != null) gconf.commit(); lconf.close(); } if (null != graph && graph.isOpen()) graph.close(); Preconditions.checkNotNull(config); open(config); }
public void open(WriteConfiguration config) { graph = (StandardTitanGraph) TitanFactory.open(config); features = graph.getConfiguration().getStoreFeatures(); tx = graph.newTransaction(); mgmt = graph.openManagement(); }
public void finishSchema() { if (mgmt != null && mgmt.isOpen()) mgmt.commit(); mgmt = graph.openManagement(); newTx(); graph.tx().commit(); }