use of org.janusgraph.graphdb.management.ConfigurationManagementGraph in project janusgraph by JanusGraph.
the class ConfiguredGraphFactory method updateTemplateConfiguration.
/**
* Update template configuration by updating supplied existing properties and adding new ones to the
* {@link Configuration}; your updated Configuration may not contain the property "graph.graphname";
* NOTE: Any graph using a configuration that was created using the template configuration must--
* 1) be closed and reopened on every JanusGraph Node 2) have its corresponding Configuration removed
* and 3) recreate the graph-- before the update is guaranteed to take effect.
*/
public static void updateTemplateConfiguration(final Configuration config) {
final ConfigurationManagementGraph configManagementGraph = getConfigGraphManagementInstance();
configManagementGraph.updateTemplateConfiguration(config);
}
use of org.janusgraph.graphdb.management.ConfigurationManagementGraph in project janusgraph by JanusGraph.
the class ConfiguredGraphFactory method removeTemplateConfiguration.
/**
* Remove template configuration
*/
public static void removeTemplateConfiguration() {
final ConfigurationManagementGraph configManagementGraph = getConfigGraphManagementInstance();
configManagementGraph.removeTemplateConfiguration();
}
use of org.janusgraph.graphdb.management.ConfigurationManagementGraph in project janusgraph by JanusGraph.
the class ConfiguredGraphFactory method getGraphNames.
/**
* Get a Set of the graphNames that exist in your configuration management graph
*/
public static Set<String> getGraphNames() {
final ConfigurationManagementGraph configManagementGraph = getConfigGraphManagementInstance();
final List<Map<String, Object>> configurations = configManagementGraph.getConfigurations();
return configurations.stream().map(elem -> (String) elem.getOrDefault(ConfigurationManagementGraph.PROPERTY_GRAPH_NAME, null)).filter(Objects::nonNull).collect(Collectors.toSet());
}
use of org.janusgraph.graphdb.management.ConfigurationManagementGraph in project janusgraph by JanusGraph.
the class ConfiguredGraphFactory method createConfiguration.
/**
* Create a configuration according to the supplied {@link Configuration}; you must include
* the property "graph.graphname" with a value in the configuration; you can then
* open your graph using graph.graphname without having to supply the
* Configuration or File each time using the {@link org.janusgraph.core.ConfiguredGraphFactory}.
*/
public static void createConfiguration(final Configuration config) {
final ConfigurationManagementGraph configManagementGraph = getConfigGraphManagementInstance();
configManagementGraph.createConfiguration(config);
}
use of org.janusgraph.graphdb.management.ConfigurationManagementGraph in project janusgraph by JanusGraph.
the class ConfiguredGraphFactory method removeConfiguration.
/**
* Remove Configuration according to graphName
*/
public static void removeConfiguration(final String graphName) {
final ConfigurationManagementGraph configManagementGraph = getConfigGraphManagementInstance();
try {
final JanusGraph graph = open(graphName);
removeGraphFromCache(graph);
} catch (Exception e) {
// cannot open graph, do nothing
log.error(String.format("Failed to open graph %s with the following error:\n %s.\n" + "Thus, it and its traversal will not be bound on this server.", graphName, e.toString()));
}
configManagementGraph.removeConfiguration(graphName);
}
Aggregations