本文整理汇总了Java中com.thinkaurelius.titan.core.schema.TitanManagement.set方法的典型用法代码示例。如果您正苦于以下问题:Java TitanManagement.set方法的具体用法?Java TitanManagement.set怎么用?Java TitanManagement.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thinkaurelius.titan.core.schema.TitanManagement
的用法示例。
在下文中一共展示了TitanManagement.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clopen
import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
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);
}
示例2: clopen
import com.thinkaurelius.titan.core.schema.TitanManagement; //导入方法依赖的package包/类
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) {
//Parse settings
Preconditions.checkArgument(settings.length%2==0,"Expected even number of settings: %s",settings);
Map<TestConfigOption,Object> options = Maps.newHashMap();
for (int i=0;i<settings.length;i=i+2) {
Preconditions.checkArgument(settings[i] instanceof TestConfigOption,"Expected configuration option but got: %s",settings[i]);
Preconditions.checkNotNull(settings[i+1],"Null setting at position [%s]",i+1);
options.put((TestConfigOption)settings[i],settings[i+1]);
}
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.getManagementSystem();
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.shutdown();
Preconditions.checkNotNull(config);
open(config);
}