本文整理了Java中org.apache.tinkerpop.gremlin.structure.Graph.configuration()
方法的一些代码示例,展示了Graph.configuration()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.configuration()
方法的具体详情如下:
包路径:org.apache.tinkerpop.gremlin.structure.Graph
类名称:Graph
方法名:configuration
[英]Get the org.apache.commons.configuration.Configuration associated with the construction of this graph. Whatever configuration was passed to GraphFactory#open(org.apache.commons.configuration.Configuration)is what should be returned by this method.
[中]获取组织。阿帕奇。平民配置与此图的构造关联的配置。传递给GraphFactory#open(org.apache.commons.configuration.configuration)的任何配置都是此方法应该返回的。
代码示例来源:origin: apache/tinkerpop
/**
* Overwrites all configurations from values passed using {@link GraphTraversal#with(String, Object)}.
*/
private void addParametersToConfiguration(final Graph graph) {
parameters.getRaw(IO.writer, IO.writer, IO.registry).entrySet().forEach(kv -> {
if (kv.getValue().size() == 1)
graph.configuration().setProperty(kv.getKey().toString(), kv.getValue().get(0));
else {
// reset the default configuration with the first option then add to that for List options
for (int ix = 0; ix < kv.getValue().size(); ix++) {
if (ix == 0)
graph.configuration().setProperty(kv.getKey().toString(), kv.getValue().get(ix));
else
graph.configuration().addProperty(kv.getKey().toString(), kv.getValue().get(ix));
}
}
});
}
代码示例来源:origin: apache/tinkerpop
private void configureForRead(final Graph graph) {
final String inputFormatClassNameOrKeyword = parameters.get(IO.reader, this::detectReader).get(0);
String inputFormatClassName;
if (inputFormatClassNameOrKeyword.equals(IO.graphson))
inputFormatClassName = GraphSONInputFormat.class.getName();
else if (inputFormatClassNameOrKeyword.equals(IO.gryo))
inputFormatClassName = GryoInputFormat.class.getName();
else if (inputFormatClassNameOrKeyword.equals(IO.graphml))
throw new IllegalStateException("GraphML is not a supported file format for OLAP");
else
inputFormatClassName = inputFormatClassNameOrKeyword;
graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_READER, inputFormatClassName);
graph.configuration().setProperty(Constants.GREMLIN_HADOOP_INPUT_LOCATION, file);
addParametersToConfiguration(graph);
}
代码示例来源:origin: apache/tinkerpop
private void configureForWrite(final Graph graph) {
final String outputFormatClassNameOrKeyword = parameters.get(IO.writer, this::detectWriter).get(0);
String outputFormatClassName;
if (outputFormatClassNameOrKeyword.equals(IO.graphson))
outputFormatClassName = GraphSONOutputFormat.class.getName();
else if (outputFormatClassNameOrKeyword.equals(IO.gryo))
outputFormatClassName = GryoOutputFormat.class.getName();
else if (outputFormatClassNameOrKeyword.equals(IO.graphml))
throw new IllegalStateException("GraphML is not a supported file format for OLAP");
else
outputFormatClassName = outputFormatClassNameOrKeyword;
graph.configuration().setProperty(Constants.GREMLIN_HADOOP_GRAPH_WRITER, outputFormatClassName);
graph.configuration().setProperty(Constants.GREMLIN_HADOOP_OUTPUT_LOCATION, file);
addParametersToConfiguration(graph);
}
代码示例来源:origin: apache/tinkerpop
@SuppressWarnings("unchecked")
@Override
public VertexProgramQ create(final Graph graph) {
if (graph != null) {
ConfigurationUtils.append(graph.configuration().subset(VERTEX_PROGRAM_Q_CFG_PREFIX), configuration);
}
return (VertexProgramQ) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: apache/tinkerpop
@SuppressWarnings("unchecked")
@Override
public BulkLoaderVertexProgram create(final Graph graph) {
ConfigurationUtils.append(graph.configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration);
return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: apache/tinkerpop
@SuppressWarnings("unchecked")
@Override
public VertexProgramR create(final Graph graph) {
if (graph != null) {
ConfigurationUtils.append(graph.configuration().subset(SIMPLE_VERTEX_PROGRAM_CFG_PREFIX), configuration);
}
return (VertexProgramR) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: apache/tinkerpop
/**
* A {@link Graph} should maintain the original {@code Configuration} object passed to it via {@link GraphFactory}.
*/
@Test
public void shouldMaintainOriginalConfigurationObjectGivenToFactory() throws Exception {
final Configuration originalConfig = graphProvider.newGraphConfiguration("temp2", this.getClass(), name.getMethodName(), null);
final Graph createdGraph = GraphFactory.open(originalConfig);
final Configuration configInGraph = createdGraph.configuration();
final AtomicInteger keyCount = new AtomicInteger(0);
originalConfig.getKeys().forEachRemaining(k -> {
assertTrue(configInGraph.containsKey(k));
keyCount.incrementAndGet();
});
// need some keys in the originalConfig for this test to be meaningful
assertTrue(keyCount.get() > 0);
assertEquals(keyCount.get(), IteratorUtils.count(configInGraph.getKeys()));
graphProvider.clear(createdGraph, originalConfig);
}
}
代码示例来源:origin: com.blackducksoftware.bdio/bdio-tinkerpop
/**
* Check to allow if provider specific implementations should be allowed. Generally the only time this is not true
* is while we are running tests.
*/
private boolean allowProviderImplementation(Graph graph) {
return graph.configuration().subset("bdio").getBoolean("allowProviderImplementation", true);
}
代码示例来源:origin: com.blackducksoftware.bdio/bdio-tinkerpop
private BlackDuckIo(Builder builder) {
graph = Objects.requireNonNull(builder.graph);
version = Objects.requireNonNull(builder.version);
onMapper = Optional.ofNullable(builder.onMapper);
mapperConfiguration = Objects.requireNonNull(builder.mapperConfiguration);
options = Optional.ofNullable(builder.options)
.orElseGet(() -> BlackDuckIoOptions.create(graph.configuration().subset("bdio")));
}
代码示例来源:origin: org.apache.tinkerpop/gremlin-core
@SuppressWarnings("unchecked")
@Override
public BulkLoaderVertexProgram create(final Graph graph) {
ConfigurationUtils.append(graph.configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration);
return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-graph
private void doClose() {
try {
g.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + g.configuration(), e);
} finally {
g = null;
}
}
}
代码示例来源:origin: dstl/baleen
private void doClose() {
try {
g.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + g.configuration(), e);
} finally {
g = null;
}
}
}
代码示例来源:origin: org.apache.tinkerpop/gremlin-test
@SuppressWarnings("unchecked")
@Override
public VertexProgramR create(final Graph graph) {
if (graph != null) {
ConfigurationUtils.append(graph.configuration().subset(SIMPLE_VERTEX_PROGRAM_CFG_PREFIX), configuration);
}
return (VertexProgramR) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: org.apache.tinkerpop/gremlin-test
@SuppressWarnings("unchecked")
@Override
public VertexProgramQ create(final Graph graph) {
if (graph != null) {
ConfigurationUtils.append(graph.configuration().subset(VERTEX_PROGRAM_Q_CFG_PREFIX), configuration);
}
return (VertexProgramQ) VertexProgram.createVertexProgram(graph, configuration);
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-graph
private void doClose() {
try {
g.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + g.configuration(), e);
} finally {
g = null;
}
}
}
代码示例来源:origin: dstl/baleen
private void doClose() {
try {
g.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + g.configuration(), e);
} finally {
g = null;
}
}
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-graph-neo4j
@Override
protected void doDestroy() {
try {
driver.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + createGraph().configuration(), e);
}
super.doDestroy();
}
}
代码示例来源:origin: dstl/baleen
@Override
protected void doDestroy() {
try {
driver.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + createGraph().configuration(), e);
}
super.doDestroy();
}
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-graph-neo4j
@Override
protected void doDestroy() {
try {
driver.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + createGraph().configuration(), e);
}
super.doDestroy();
}
}
代码示例来源:origin: dstl/baleen
@Override
protected void doDestroy() {
try {
driver.close();
} catch (Exception e) {
getMonitor().warn("Error closing graph " + createGraph().configuration(), e);
}
super.doDestroy();
}
}
内容来源于网络,如有侵权,请联系作者删除!