我试图覆盖Titan 1.0.0中的graph.set-vertex-id配置
从xml文件加载配置:
cache.db-cache-time = 180000
cache.db-cache-size = 0.25
graph.set-vertex-id=true
storage.batch-loading=true
....
我收到错误:
Local setting graph.set-vertex-id=true (Type: FIXED) is overridden by globally managed value (false). Use the ManagementSystem interface instead of the local configuration to control this setting.
我也试过
BaseConfiguration configuration = new BaseConfiguration();
configuration.setProperty("storage.hostname", "any_hostname");
configuration.setProperty("storage.backend", "thrift");
configuration.setProperty("graph.set-vertex-id", Boolean.TRUE);
titanGraph = TitanFactory.open(configuration);
但是通过使用TitanManagement检查配置
titanGraph.openManagement().get("graph.set-vertex-id");
我可以看到它仍然是“假”。
有没有人试图在此版本的Titan中分配自定义顶点ID?在升级之前,我们使用了Titan 0.4.2,它运行得很好。
文档(http://s3.thinkaurelius.com/docs/titan/1.0.0/configuration.html)说明
GLOBAL: These options are always read from the cluster configuration and cannot be overwritten on an instance basis.
FIXED: Like GLOBAL, but the value cannot be changed once the Titan cluster is initialized.
When the first Titan instance in a cluster is started, the global configuration options are initialized from the provided local configuration file. Subsequently changing global configuration options is done through Titan’s management API.
To access the management API, call g.getManagementSystem() on an open Titan instance handle g. For example, to change the default caching behavior on a Titan cluster:
mgmt = graph.openManagement()
mgmt.get('cache.db-cache')
// Prints the current config setting
mgmt.set('cache.db-cache', true)
// Changes option
mgmt.get('cache.db-cache')
// Prints 'true'
mgmt.commit()
// Changes take effect
首先,Titan 1.0.0中的图表上没有getManagementSystem()。其次,覆盖" graph.set-vertex-id"像这样的配置会抛出另一个错误,因为此时图已经初始化了:
Cannot change the fixed configuration option: root.graph.set-vertex-id
谢谢!