本文整理汇总了Java中com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java StandardTitanGraph.getConfiguration方法的具体用法?Java StandardTitanGraph.getConfiguration怎么用?Java StandardTitanGraph.getConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thinkaurelius.titan.graphdb.database.StandardTitanGraph
的用法示例。
在下文中一共展示了StandardTitanGraph.getConfiguration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clear
import com.thinkaurelius.titan.graphdb.database.StandardTitanGraph; //导入方法依赖的package包/类
/**
* Clears out the entire graph. This will delete ALL of the data stored in this graph and the data will NOT be
* recoverable. This method is intended only for development and testing use.
*
* @param graph
* @throws IllegalArgumentException if the graph has not been shut down
* @throws com.thinkaurelius.titan.core.TitanException if clearing the storage is unsuccessful
*/
public static final void clear(TitanGraph graph) {
Preconditions.checkNotNull(graph);
Preconditions.checkArgument(graph instanceof StandardTitanGraph,"Invalid graph instance detected: %s",graph.getClass());
StandardTitanGraph g = (StandardTitanGraph)graph;
Preconditions.checkArgument(!g.isOpen(),"Graph needs to be shut down before it can be cleared.");
final GraphDatabaseConfiguration config = g.getConfiguration();
BackendOperation.execute(new Callable<Boolean>(){
@Override
public Boolean call() throws Exception {
config.getBackend().clearStorage();
return true;
}
@Override
public String toString() { return "ClearBackend"; }
}, Duration.ofSeconds(20));
}
示例2: clear
import com.thinkaurelius.titan.graphdb.database.StandardTitanGraph; //导入方法依赖的package包/类
/**
* Clears out the entire graph. This will delete ALL of the data stored in this graph and the data will NOT be
* recoverable. This method is intended only for development and testing use.
*
* @param graph
* @throws IllegalArgumentException if the graph has not been shut down
* @throws com.thinkaurelius.titan.core.TitanException if clearing the storage is unsuccessful
*/
public static final void clear(TitanGraph graph) {
Preconditions.checkNotNull(graph);
Preconditions.checkArgument(graph instanceof StandardTitanGraph,"Invalid graph instance detected: %s",graph.getClass());
StandardTitanGraph g = (StandardTitanGraph)graph;
Preconditions.checkArgument(!g.isOpen(),"Graph needs to be shut down before it can be cleared.");
final GraphDatabaseConfiguration config = g.getConfiguration();
BackendOperation.execute(new Callable<Boolean>(){
@Override
public Boolean call() throws Exception {
config.getBackend().clearStorage();
return true;
}
@Override
public String toString() { return "ClearBackend"; }
},new StandardDuration(20, TimeUnit.SECONDS));
}