@Override public WriteConfiguration copy() { BaseConfiguration copy = new BaseConfiguration(); copy.copy(config); return new CommonsConfiguration(copy); }
@Override public WriteConfiguration copy() { BaseConfiguration copy = new BaseConfiguration(); copy.copy(config); return new CommonsConfiguration(copy); }
protected Neo4jGraph(final Configuration configuration) { this.configuration.copy(configuration); final String directory = this.configuration.getString(CONFIG_DIRECTORY); final Map neo4jSpecificConfig = ConfigurationConverter.getMap(this.configuration.subset(CONFIG_CONF)); this.baseGraph = Neo4jFactory.Builder.open(directory, neo4jSpecificConfig); this.initialize(this.baseGraph, configuration); }
private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) { this.configuration.copy(configuration); this.baseGraph = baseGraph; this.neo4jGraphVariables = new Neo4jGraphVariables(this); this.tx().readWrite(); final Optional<Boolean> hasMultiProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES)); final Optional<Boolean> hasMetaProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_META_PROPERTIES)); boolean supportsMetaProperties = hasMetaProperties.orElse(this.configuration.getBoolean(CONFIG_META_PROPERTIES, false)); boolean supportsMultiProperties = hasMultiProperties.orElse(this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false)); if (supportsMultiProperties != supportsMetaProperties) throw new IllegalArgumentException(this.getClass().getSimpleName() + " currently supports either both meta-properties and multi-properties or neither"); if (!hasMultiProperties.isPresent()) this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES), supportsMultiProperties); if (!hasMetaProperties.isPresent()) this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_META_PROPERTIES), supportsMetaProperties); this.trait = supportsMultiProperties ? MultiMetaNeo4jTrait.instance() : NoMultiNoMetaNeo4jTrait.instance(); if (supportsMultiProperties) LOGGER.warn(this.getClass().getSimpleName() + " multi/meta-properties feature is considered experimental and should not be used in a production setting until this warning is removed"); this.tx().commit(); }
public static HadoopGraph getOutputGraph(final Configuration configuration, final GraphComputer.ResultGraph resultGraph, final GraphComputer.Persist persist) { final HadoopConfiguration hadoopConfiguration = new HadoopConfiguration(configuration); final BaseConfiguration newConfiguration = new BaseConfiguration(); newConfiguration.copy(org.apache.tinkerpop.gremlin.hadoop.structure.io.InputOutputHelper.getOutputGraph(configuration, resultGraph, persist).configuration()); if (resultGraph.equals(GraphComputer.ResultGraph.NEW) && hadoopConfiguration.containsKey(Constants.GREMLIN_HADOOP_GRAPH_WRITER)) { if (null != InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter())) newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter()).getCanonicalName()); } return HadoopGraph.open(newConfiguration); } }
public static HadoopGraph getOutputGraph(final Configuration configuration, final GraphComputer.ResultGraph resultGraph, final GraphComputer.Persist persist) { final HadoopConfiguration hadoopConfiguration = new HadoopConfiguration(configuration); final BaseConfiguration newConfiguration = new BaseConfiguration(); newConfiguration.copy(hadoopConfiguration); if (resultGraph.equals(GraphComputer.ResultGraph.NEW)) { newConfiguration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, hadoopConfiguration.getOutputLocation()); if (hadoopConfiguration.containsKey(Constants.GREMLIN_HADOOP_GRAPH_WRITER)) if (null != InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter())) newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter()).getCanonicalName()); newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER_HAS_EDGES, persist.equals(GraphComputer.Persist.EDGES)); } newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopConfiguration.getOutputLocation() + "_"); return HadoopGraph.open(newConfiguration); } }
protected DuctileGraph(DuctileDBGraph baseGraph, Configuration configuration) { this.configuration.copy(configuration); this.baseGraph = baseGraph; this.ductileTransaction = new DuctileTransaction(this); }
@Override public WriteConfiguration copy() { BaseConfiguration copy = new BaseConfiguration(); copy.copy(config); return new CommonsConfiguration(copy); }
@Override public WriteConfiguration copy() { BaseConfiguration copy = new BaseConfiguration(); copy.copy(config); return new CommonsConfiguration(copy); }
protected DuctileGraph(File hbaseSiteFile, Configuration configuration) throws IOException, ServiceException { this.configuration.copy(configuration); this.baseGraph = DuctileDBGraphFactory.createGraph(hbaseSiteFile); this.ductileTransaction = new DuctileTransaction(this); }
public void clopen(Map<String, ? extends Object> settings) { super.close(); BaseConfiguration newConfig = new BaseConfiguration(); newConfig.copy(config); for (Map.Entry<String,? extends Object> entry : settings.entrySet()) newConfig.addProperty(entry.getKey(),entry.getValue()); graph = (StandardTitanGraph) TitanFactory.open(newConfig); tx = graph.newTransaction(); }
public ConfigurationData<M> loadConfiguration(Configuration fileConfiguration) { BaseConfiguration configuration = new BaseConfiguration(); configuration.copy(fileConfiguration); // Remove module data from config Iterator<String> moduleKeys = configuration.getKeys("modules."); while (moduleKeys.hasNext()) { configuration.clearProperty(moduleKeys.next()); } List<M> modules = Lists.newArrayList(); Set<String> moduleIds = Sets.newLinkedHashSet(); for (String moduleKey : Iterators.toArray(fileConfiguration.getKeys(MODULES_KEY), String.class)) { Matcher matcher = MODULE_ID_MATCHER.matcher(moduleKey); if (!matcher.matches()) { throw new PrideException("Invalid module setting: " + moduleKey); } String moduleId = matcher.group(1); moduleIds.add(moduleId); } for (String moduleId : moduleIds) { String prefix = MODULES_KEY + "." + moduleId; M module = loadModule(fileConfiguration, prefix); modules.add(module); } return new ConfigurationData<M>(configuration, modules); }
private void initialize(final Neo4jGraphAPI baseGraph, final Configuration configuration) { this.configuration.copy(configuration); this.baseGraph = baseGraph; this.neo4jGraphVariables = new Neo4jGraphVariables(this); this.tx().readWrite(); final Optional<Boolean> hasMultiProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES)); final Optional<Boolean> hasMetaProperties = this.neo4jGraphVariables.get(Graph.Hidden.hide(CONFIG_META_PROPERTIES)); boolean supportsMetaProperties = hasMetaProperties.orElse(this.configuration.getBoolean(CONFIG_META_PROPERTIES, false)); boolean supportsMultiProperties = hasMultiProperties.orElse(this.configuration.getBoolean(CONFIG_MULTI_PROPERTIES, false)); if (supportsMultiProperties != supportsMetaProperties) throw new IllegalArgumentException(this.getClass().getSimpleName() + " currently supports either both meta-properties and multi-properties or neither"); if (!hasMultiProperties.isPresent()) this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_MULTI_PROPERTIES), supportsMultiProperties); if (!hasMetaProperties.isPresent()) this.neo4jGraphVariables.set(Graph.Hidden.hide(CONFIG_META_PROPERTIES), supportsMetaProperties); this.trait = supportsMultiProperties ? MultiMetaNeo4jTrait.instance() : NoMultiNoMetaNeo4jTrait.instance(); if (supportsMultiProperties) LOGGER.warn(this.getClass().getSimpleName() + " multi/meta-properties feature is considered experimental and should not be used in a production setting until this warning is removed"); this.tx().commit(); }
protected Neo4jGraph(final Configuration configuration) { this.configuration.copy(configuration); final String directory = this.configuration.getString(CONFIG_DIRECTORY); final Map neo4jSpecificConfig = ConfigurationConverter.getMap(this.configuration.subset(CONFIG_CONF)); this.baseGraph = Neo4jFactory.Builder.open(directory, neo4jSpecificConfig); this.initialize(this.baseGraph, configuration); }
public void open() throws StorageException { manager = new KeyColumnValueStoreManager[CONCURRENCY]; idAuthorities = new IDAuthority[CONCURRENCY]; for (int i = 0; i < CONCURRENCY; i++) { manager[i] = openStorageManager(i); StoreFeatures storeFeatures = manager[i].getFeatures(); BaseConfiguration sc = new BaseConfiguration(); sc.copy(baseStoreConfiguration); sc.addProperty(GraphDatabaseConfiguration.INSTANCE_RID_SHORT_KEY, (short) i); KeyColumnValueStore idStore = manager[i].openDatabase("ids"); if (storeFeatures.supportsTransactions()) idAuthorities[i] = new TransactionalIDManager(idStore, manager[i], sc); else if (storeFeatures.supportsConsistentKeyOperations()) idAuthorities[i] = new ConsistentKeyIDManager(idStore, manager[i], sc); else throw new IllegalArgumentException("Cannot open id store"); } }
public static HadoopGraph getOutputGraph(final Configuration configuration, final GraphComputer.ResultGraph resultGraph, final GraphComputer.Persist persist) { final HadoopConfiguration hadoopConfiguration = new HadoopConfiguration(configuration); final BaseConfiguration newConfiguration = new BaseConfiguration(); newConfiguration.copy(org.apache.tinkerpop.gremlin.hadoop.structure.io.InputOutputHelper.getOutputGraph(configuration, resultGraph, persist).configuration()); if (resultGraph.equals(GraphComputer.ResultGraph.NEW) && hadoopConfiguration.containsKey(Constants.GREMLIN_HADOOP_GRAPH_WRITER)) { if (null != InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter())) newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter()).getCanonicalName()); } return HadoopGraph.open(newConfiguration); } }
public static HadoopGraph getOutputGraph(final Configuration configuration, final GraphComputer.ResultGraph resultGraph, final GraphComputer.Persist persist) { final HadoopConfiguration hadoopConfiguration = new HadoopConfiguration(configuration); final BaseConfiguration newConfiguration = new BaseConfiguration(); newConfiguration.copy(hadoopConfiguration); if (resultGraph.equals(GraphComputer.ResultGraph.NEW)) { newConfiguration.setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, hadoopConfiguration.getOutputLocation()); if (hadoopConfiguration.containsKey(Constants.GREMLIN_HADOOP_GRAPH_WRITER)) if (null != InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter())) newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, InputOutputHelper.getInputFormat(hadoopConfiguration.getGraphWriter()).getCanonicalName()); newConfiguration.setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER_HAS_EDGES, persist.equals(GraphComputer.Persist.EDGES)); } newConfiguration.setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, hadoopConfiguration.getOutputLocation() + "_"); return HadoopGraph.open(newConfiguration); } }