com.tinkerpop.blueprints.Graph.shutdown()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中com.tinkerpop.blueprints.Graph.shutdown()方法的一些代码示例,展示了Graph.shutdown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.shutdown()方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Graph
类名称:Graph
方法名:shutdown

Graph.shutdown介绍

[英]A shutdown function is required to properly close the graph. This is important for implementations that utilize disk-based serializations.
[中]

代码示例

代码示例来源:origin: BrynCooke/totorom

/**
 * Close the delegate graph.
 */
public void close() {
  delegate.shutdown();
}

代码示例来源:origin: fr.lirmm.graphik/graal-store-blueprints

@Override
public void close() {
  this.graph.shutdown();
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

@Override
public void shutdown() {
  graph.shutdown();
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public void shutdown() {
  this.baseGraph.shutdown();
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public void shutdown() {
  this.baseGraph.shutdown();
}

代码示例来源:origin: com.tinkerpop/frames

public void shutdown() {
  config.getConfiguredGraph().shutdown();
}

代码示例来源:origin: org.jboss.windup.graph.frames/windup-frames

public void shutdown() {
  config.getConfiguredGraph().shutdown();
}

代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core

public void shutdown() {
  try {
    this.baseGraph.shutdown();
    // TODO: hmmmmmm??
    this.trigger.fireEventQueue();
    this.trigger.resetEventQueue();
  } catch (Exception re) {
  }
}

代码示例来源:origin: com.tinkerpop.rexster/rexster-core

@Override
public void stop() {
  // need to shutdown all the graphs that were started with the web server
  for (RexsterApplicationGraph rag : this.graphs.values()) {
    final Graph graph = rag.getGraph();
    logger.info(String.format("Shutting down [%s] - [%s]", rag.getGraphName(), graph));
    // graph may not have been initialized properly if an exception gets tossed in
    // on graph creation
    if (graph != null) {
      // call shutdown on the unwrapped graph as some wrappers don't allow shutdown() to be called.
      final Graph shutdownGraph = rag.getUnwrappedGraph();
      shutdownGraph.shutdown();
    }
  }
}

代码示例来源:origin: thinkaurelius/faunus

@Override
public void cleanup(final Mapper<NullWritable, FaunusVertex, LongWritable, Holder<FaunusVertex>>.Context context) throws IOException, InterruptedException {
  if (this.graph instanceof TransactionalGraph) {
    try {
      ((TransactionalGraph) this.graph).commit();
      context.getCounter(Counters.SUCCESSFUL_TRANSACTIONS).increment(1l);
    } catch (Exception e) {
      LOGGER.error("Could not commit transaction during VertexMap.cleanup():", e);
      ((TransactionalGraph) this.graph).rollback();
      context.getCounter(Counters.FAILED_TRANSACTIONS).increment(1l);
      throw new IOException(e.getMessage(), e);
    }
  }
  this.graph.shutdown();
}

代码示例来源:origin: thinkaurelius/faunus

@Override
public void cleanup(final Mapper<NullWritable, FaunusVertex, NullWritable, FaunusVertex>.Context context) throws IOException, InterruptedException {
  if (this.graph instanceof TransactionalGraph) {
    try {
      ((TransactionalGraph) this.graph).commit();
      context.getCounter(Counters.SUCCESSFUL_TRANSACTIONS).increment(1l);
    } catch (Exception e) {
      LOGGER.error("Could not commit transaction during EdgeMap.cleanup():", e);
      ((TransactionalGraph) this.graph).rollback();
      context.getCounter(Counters.FAILED_TRANSACTIONS).increment(1l);
      throw new IOException(e.getMessage(), e);
    }
  }
  this.graph.shutdown();
}

代码示例来源:origin: TACIXAT/CFGScanDroid

graph.shutdown();

代码示例来源:origin: org.vertexium/vertexium-blueprints-test

public void testVertexEdgesWithNonVisibleVertexOnOtherEnd() {
    Graph graph = graphTest.generateGraph();

    if (!(graph instanceof VertexiumBlueprintsGraph)) {
      throw new RuntimeException("Invalid graph");
    }
    org.vertexium.Graph vertexiumGraph = ((VertexiumBlueprintsGraph) graph).getGraph();

    Authorizations aAuthorizations = vertexiumGraph.createAuthorizations("a");
    org.vertexium.Vertex v1 = vertexiumGraph.addVertex("v1", new Visibility(""), aAuthorizations);
    org.vertexium.Vertex v2 = vertexiumGraph.addVertex("v2", new Visibility("a"), aAuthorizations);
    org.vertexium.Vertex v3 = vertexiumGraph.addVertex("v3", new Visibility(""), aAuthorizations);
    vertexiumGraph.addEdge("e1to2", v1, v2, "label", new Visibility(""), aAuthorizations);
    vertexiumGraph.addEdge("e1to3", v1, v3, "label", new Visibility(""), aAuthorizations);
    vertexiumGraph.flush();

    Vertex blueV1 = graph.getVertex("v1");
    assertEquals(1, count(blueV1.getEdges(Direction.BOTH, "label")));
    assertEquals(1, count(blueV1.getVertices(Direction.BOTH, "label")));
    assertEquals(1, count((Iterable) blueV1.query().direction(Direction.BOTH).vertexIds()));

    graph.shutdown();
  }
}

相关文章