本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}