本文整理了Java中com.tinkerpop.blueprints.Graph.getFeatures()
方法的一些代码示例,展示了Graph.getFeatures()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getFeatures()
方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Graph
类名称:Graph
方法名:getFeatures
[英]Get the particular features of the graph implementation. Not all graph implementations are identical nor perfectly implement the Blueprints API. The Features object returned contains meta-data about numerous potential divergences between implementations.
[中]获取图形实现的特定功能。并非所有的图形实现都相同,也不是完全实现Blueprints API。返回的Features对象包含关于实现之间许多潜在差异的元数据。
代码示例来源:origin: com.tinkerpop.rexster/rexster-core
/**
* Helper method that will attempt to get a transactional graph instance if the graph can be cast to such.
*
* @return the transactional graph or null if it is not transactional
*/
public TransactionalGraph tryGetTransactionalGraph() {
TransactionalGraph transactionalGraph = null;
if (this.graph.getFeatures().supportsTransactions
&& this.graph instanceof TransactionalGraph) {
transactionalGraph = (TransactionalGraph) graph;
}
return transactionalGraph;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public ReadOnlyGraph(final T baseGraph) {
this.baseGraph = baseGraph;
this.features = this.baseGraph.getFeatures().copyFeatures();
this.features.isWrapper = true;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public WrappedGraph(final T baseGraph) {
this.baseGraph = baseGraph;
this.features = this.baseGraph.getFeatures().copyFeatures();
this.features.isWrapper = true;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
/**
* @return The features of the underlying graph but with transactions supported.
*/
@Override
public Features getFeatures() {
Features f = graph.getFeatures().copyFeatures();
f.isWrapper = true;
f.supportsTransactions = true;
return f;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public PartitionGraph(final T baseGraph, final String partitionKey, final String writePartition, final Set<String> readPartitions) {
this.baseGraph = baseGraph;
this.partitionKey = partitionKey;
this.writePartition = writePartition;
this.readPartitions.addAll(readPartitions);
this.features = this.baseGraph.getFeatures().copyFeatures();
this.features.isWrapper = true;
}
代码示例来源:origin: com.tinkerpop.blueprints/blueprints-core
public EventGraph(final T baseGraph) {
this.baseGraph = baseGraph;
this.features = this.baseGraph.getFeatures().copyFeatures();
this.features.isWrapper = true;
this.trigger = new EventTrigger(this, false);
}
代码示例来源:origin: com.tinkerpop/frames
public Features getFeatures() {
Features features = config.getConfiguredGraph().getFeatures().copyFeatures();
features.isWrapper = true;
return features;
}
代码示例来源:origin: org.jboss.windup.graph.frames/windup-frames
public Features getFeatures() {
Features features = config.getConfiguredGraph().getFeatures().copyFeatures();
features.isWrapper = true;
return features;
}
代码示例来源:origin: atlanmod/NeoEMF
/**
* Retrieves the base graph of the {@code graph}.
*
* @param graph the graph from which to retrieve the base graph
*
* @return the base graph of the {@code graph}, or {@code graph} is it is not a wrapper.
*
* @see com.tinkerpop.blueprints.Features#isWrapper
* @see WrapperGraph
*/
@Nonnull
private static Graph getOrigin(Graph graph) {
Graph origin;
if (graph.getFeatures().isWrapper) {
final WrapperGraph<?> wrapperGraph = (WrapperGraph) graph;
origin = getOrigin(wrapperGraph.getBaseGraph());
}
else {
origin = graph;
}
return origin;
}
代码示例来源:origin: tinkerpop/furnace
public void execute() {
Preconditions.checkArgument(this.graph.getFeatures().supportsVertexIteration);
final long time = System.currentTimeMillis();
this.vertexMemory.setComputeKeys(this.vertexProgram.getComputeKeys());
this.vertexProgram.setup(this.graphMemory);
boolean done = false;
while (!done) {
final ExecutorService executor = Executors.newFixedThreadPool(this.threads);
final Iterator<Vertex> vertices = this.graph.getVertices().iterator();
while (vertices.hasNext()) {
final Runnable worker = new VertexThread(vertices);
executor.execute(worker);
}
executor.shutdown();
while (!executor.isTerminated()) {
}
this.vertexMemory.completeIteration();
this.graphMemory.incrIteration();
done = this.vertexProgram.terminate(this.graphMemory);
}
this.graphMemory.setRuntime(System.currentTimeMillis() - time);
}
代码示例来源:origin: atlanmod/NeoEMF
@Nonnull
@Override
protected Backend createLocalBackend(Path directory, BaseBlueprintsConfig<?> config) {
config.setLocation(directory);
Graph graph = GraphFactory.open(config.getOptions(s -> s.startsWith(BaseBlueprintsConfig.BLUEPRINTS_PREFIX)));
checkArgument(graph.getFeatures().supportsKeyIndices, "%s does not support key indices", graph.getClass().getSimpleName());
if (config.isReadOnly()) {
graph = new ReadOnlyKeyIndexableGraph<>((KeyIndexableGraph) graph);
}
return createMapper(config.getMapping(), graph);
}
}
代码示例来源:origin: iTransformers/netTransformer
if (graph.getFeatures().supportsVertexIndex && graph instanceof KeyIndexableGraph) {
((KeyIndexableGraph) graph).createKeyIndex("name", Vertex.class);
代码示例来源:origin: tinkerpop/furnace
public void execute() {
final long time = System.currentTimeMillis();
this.vertexMemory.setComputeKeys(this.vertexProgram.getComputeKeys());
this.vertexProgram.setup(this.graphMemory);
final CoreShellVertex coreShellVertex = new CoreShellVertex(this.vertexMemory);
Preconditions.checkArgument(this.graph.getFeatures().supportsVertexIteration);
boolean done = false;
while (!done) {
for (final Vertex vertex : this.graph.getVertices()) {
coreShellVertex.setBaseVertex(vertex);
this.vertexProgram.execute(coreShellVertex, this.graphMemory);
}
this.vertexMemory.completeIteration();
this.graphMemory.incrIteration();
done = this.vertexProgram.terminate(this.graphMemory);
}
this.graphMemory.setRuntime(System.currentTimeMillis() - time);
}
}
内容来源于网络,如有侵权,请联系作者删除!