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


Java JanusGraph.close方法代码示例

本文整理汇总了Java中org.janusgraph.core.JanusGraph.close方法的典型用法代码示例。如果您正苦于以下问题:Java JanusGraph.close方法的具体用法?Java JanusGraph.close怎么用?Java JanusGraph.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.janusgraph.core.JanusGraph的用法示例。


在下文中一共展示了JanusGraph.close方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String[] args) {

        if (null == args || args.length < 2) {
            System.err.println("Usage: SchemaLoader <janusgraph-config-file> <schema-file>");
            System.exit(1);
        }

        String configFile = args[0];
        String schemaFile = args[1];

        // use custom or default config file to get JanusGraph
        JanusGraph g = JanusGraphFactory.open(configFile);

        try {
            new SchemaLoader().loadSchema(g, schemaFile);
        } catch (Exception e) {
            System.out.println("Failed to import schema due to " + e.getMessage());
        } finally {
            g.close();
        }

    }
 
开发者ID:IBM,项目名称:janusgraph-utils,代码行数:23,代码来源:SchemaLoader.java

示例2: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {

        if (null == args || args.length < 4) {
            System.err.println(
                    "Usage: BatchImport <janusgraph-config-file> <data-files-directory> <schema.json> <data-mapping.json> [skipSchema]");
            System.exit(1);
        }

        JanusGraph graph = JanusGraphFactory.open(args[0]);
        if (!(args.length > 4 && args[4].equals("skipSchema")))
            new SchemaLoader().loadSchema(graph, args[2]);
        new DataLoader(graph).loadVertex(args[1], args[3]);
        new DataLoader(graph).loadEdges(args[1], args[3]);
        graph.close();
    }
 
开发者ID:IBM,项目名称:janusgraph-utils,代码行数:16,代码来源:BatchImport.java

示例3: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {

        if (null == args || args.length < 4) {
            System.err.println("Usage: BatchImport <janusgraph-config-file> <data-files-directory> <schema.json> <data-mapping.json>");
            System.exit(1);
        }

        JanusGraph graph = JanusGraphFactory.open(args[0]);
        new SchemaLoader(graph).loadFile(args[2]);
        new DataLoader(graph).loadVertex(args[1], args[3]);
        new DataLoader(graph).loadEdges(args[1], args[3]);
        graph.close();
    }
 
开发者ID:tedhtchang,项目名称:JanusGraphBench,代码行数:14,代码来源:BatchImport.java

示例4: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String argv[]) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  HadoopQueryRunner q = new HadoopQueryRunner(graph.traversal(), "testUser1");
  int runs = 10;

  for(int i =0; i < runs; i++) {
    LOGGER.info("New timeline (run {} of {})", i+1, runs);
    q.printTimeline(q.getTimeline3(10));
  }
  q.close();
  graph.close();
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:13,代码来源:NewTimeline.java

示例5: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
public static void main(String argv[]) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  HadoopQueryRunner q = new HadoopQueryRunner(graph.traversal(), "testUser1");
  int runs = 10;

  for(int i =0; i < runs; i++) {
    LOGGER.info("Previous timeline (run {} of {})", i+1, runs);
    q.printTimeline(q.getTimeline2(10));
  }
  q.close();
  graph.close();
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:13,代码来源:OldTimeline.java

示例6: main

import org.janusgraph.core.JanusGraph; //导入方法依赖的package包/类
/**
 * Run every example query, outputting results via @LOGGER
 *
 * @param argv
 * @throws Exception
 */
public static void main(String[] argv) throws Exception {
  JanusGraph graph = JanusGraphFactory.open(Schema.CONFIG_FILE);
  GraphTraversalSource graphTraversalSource = graph.traversal();

  QueryRunner queryRunner = new QueryRunner(graphTraversalSource, "testUser0");

  LOGGER.info("Initialized the builtin query executor");

  queryRunner.runQueries();

  queryRunner.close();

  graph.close();

  System.exit(0);
}
 
开发者ID:marcelocf,项目名称:janusgraph_tutorial,代码行数:23,代码来源:BuiltinQueries.java


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