当前位置: 首页>>代码示例>>Java>>正文


Java StandardTitanGraph.getConfiguration方法代码示例

本文整理汇总了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));
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:25,代码来源:TitanCleanup.java

示例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));
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:25,代码来源:TitanCleanup.java


注:本文中的com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.getConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。