本文整理汇总了Java中com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java OrientGraphNoTx.shutdown方法的具体用法?Java OrientGraphNoTx.shutdown怎么用?Java OrientGraphNoTx.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx
的用法示例。
在下文中一共展示了OrientGraphNoTx.shutdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSettings
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
private void setSettings() {
// settings
factory.setUseLightweightEdges( true );
factory.setUseClassForEdgeLabel( false );
factory.setUseVertexFieldsForEdgeLabels( false );
OrientGraphNoTx noTx = null;
try{
noTx = factory.getNoTx();
// TODO: add admin user for testing
createAdminUser();
}
finally {
if( noTx != null )
noTx.shutdown();
}
}
示例2: clear
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void clear() {
if (log.isDebugEnabled()) {
log.debug("Clearing graph");
}
OrientGraphNoTx tx2 = factory.getNoTx();
tx2.declareIntent(new OIntentNoCache());
try {
for (Vertex vertex : tx2.getVertices()) {
vertex.remove();
}
} finally {
tx2.declareIntent(null);
tx2.shutdown();
}
if (log.isDebugEnabled()) {
log.debug("Cleared graph");
}
}
示例3: execute
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void execute() throws Exception
{
OrientGraphNoTx graph = orientConnector.getNoTxGraphInstance();
VSA vsa = new VSA();
for (Function function : LookupOperations.getFunctions(graph))
{
try
{
logger.info(function.toString());
vsa.performIntraProceduralVSA(function);
} catch (Exception e)
{
logger.error("Error for function " + function + ": " + e.getMessage());
}
}
graph.shutdown();
}
示例4: OrientMassiveInsertion
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
public OrientMassiveInsertion(final String url)
{
super(GraphDatabaseType.ORIENT_DB, null /* resultsPath */);
OGlobalConfiguration.ENVIRONMENT_CONCURRENT.setValue(false);
OrientGraphNoTx transactionlessGraph = new OrientGraphNoTx(url);
for (int i = 0; i < NUMBER_OF_ORIENT_CLUSTERS; ++i)
{
transactionlessGraph.getVertexBaseType().addCluster("v_" + i);
transactionlessGraph.getEdgeBaseType().addCluster("e_" + i);
}
transactionlessGraph.shutdown();
graph = new OGraphBatchInsertBasic(url);
graph.setAverageEdgeNumberPerNode(AVERAGE_NUMBER_OF_EDGES_PER_NODE);
graph.setEstimatedEntries(ESTIMATED_ENTRIES);
graph.setIdPropertyName("nodeId");
graph.begin();
}
示例5: addCustomEdgeIndex
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void addCustomEdgeIndex(String label, String indexPostfix, String... fields) {
OrientGraphNoTx noTx = factory.getNoTx();
try {
OrientEdgeType e = noTx.getEdgeType(label);
if (e == null) {
throw new RuntimeException("Could not find edge type {" + label + "}. Create edge type before creating indices.");
}
for (String key : fields) {
if (e.getProperty(key) == null) {
OType type = OType.STRING;
if (key.equals("out") || key.equals("in")) {
type = OType.LINK;
}
e.createProperty(key, type);
}
}
String name = "e." + label + "_" + indexPostfix;
name = name.toLowerCase();
if (fields.length != 0 && e.getClassIndex(name) == null) {
e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, fields);
}
} finally {
noTx.shutdown();
}
}
示例6: addEdgeType
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void addEdgeType(String label, Class<?> superClazzOfEdge, String... stringPropertyKeys) {
if (log.isDebugEnabled()) {
log.debug("Adding edge type for label {" + label + "}");
}
OrientGraphNoTx noTx = factory.getNoTx();
try {
OrientEdgeType e = noTx.getEdgeType(label);
if (e == null) {
String superClazz = "E";
if (superClazzOfEdge != null) {
superClazz = superClazzOfEdge.getSimpleName();
}
e = noTx.createEdgeType(label, superClazz);
} else {
// Update the existing edge type and set the super class
if (superClazzOfEdge != null) {
OrientEdgeType superType = noTx.getEdgeType(superClazzOfEdge.getSimpleName());
if (superType == null) {
throw new RuntimeException("The supertype for edges with label {" + label + "} can't be set since the supertype {"
+ superClazzOfEdge.getSimpleName() + "} was not yet added to orientdb.");
}
e.setSuperClass(superType);
}
}
for (String key : stringPropertyKeys) {
if (e.getProperty(key) == null) {
e.createProperty(key, OType.STRING);
}
}
} finally {
noTx.shutdown();
}
}
示例7: addVertexType
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void addVertexType(Class<?> clazzOfVertex, Class<?> superClazzOfVertex) {
if (log.isDebugEnabled()) {
log.debug("Adding vertex type for class {" + clazzOfVertex.getName() + "}");
}
OrientGraphNoTx noTx = factory.getNoTx();
try {
OrientVertexType vertexType = noTx.getVertexType(clazzOfVertex.getSimpleName());
if (vertexType == null) {
String superClazz = "V";
if (superClazzOfVertex != null) {
superClazz = superClazzOfVertex.getSimpleName();
}
vertexType = noTx.createVertexType(clazzOfVertex.getSimpleName(), superClazz);
} else {
// Update the existing vertex type and set the super class
if (superClazzOfVertex != null) {
OrientVertexType superType = noTx.getVertexType(superClazzOfVertex.getSimpleName());
if (superType == null) {
throw new RuntimeException("The supertype for vertices of type {" + clazzOfVertex + "} can't be set since the supertype {"
+ superClazzOfVertex.getSimpleName() + "} was not yet added to orientdb.");
}
vertexType.setSuperClass(superType);
}
}
} finally {
noTx.shutdown();
}
}
示例8: removeEdgeType
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void removeEdgeType(String typeName) {
if (log.isDebugEnabled()) {
log.debug("Removing vertex type with name {" + typeName + "}");
}
OrientGraphNoTx noTx = factory.getNoTx();
try {
noTx.dropEdgeType(typeName);
} finally {
noTx.shutdown();
}
}
示例9: removeVertexType
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void removeVertexType(String typeName) {
if (log.isDebugEnabled()) {
log.debug("Removing vertex type with name {" + typeName + "}");
}
OrientGraphNoTx noTx = factory.getNoTx();
try {
OrientVertexType type = noTx.getVertexType(typeName);
if (type != null) {
noTx.dropVertexType(typeName);
}
} finally {
noTx.shutdown();
}
}
示例10: addVertexIndex
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void addVertexIndex(String indexName, Class<?> clazzOfVertices, boolean unique, String fieldKey, FieldType fieldType) {
if (log.isDebugEnabled()) {
log.debug("Adding vertex index for class {" + clazzOfVertices.getName() + "}");
}
OrientGraphNoTx noTx = factory.getNoTx();
try {
String name = clazzOfVertices.getSimpleName();
OrientVertexType v = noTx.getVertexType(name);
if (v == null) {
throw new RuntimeException("Vertex type {" + name + "} is unknown. Can't create index {" + indexName + "}");
}
if (v.getProperty(fieldKey) == null) {
OType type = convertType(fieldType);
OType subType = convertToSubType(fieldType);
if (subType != null) {
v.createProperty(fieldKey, type, subType);
} else {
v.createProperty(fieldKey, type);
}
}
if (v.getClassIndex(indexName) == null) {
v.createIndex(indexName, unique ? OClass.INDEX_TYPE.UNIQUE_HASH_INDEX.toString() : OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString(),
null, new ODocument().fields("ignoreNullValues", true), new String[] { fieldKey });
}
} finally {
noTx.shutdown();
}
}
示例11: collectResult
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
protected void collectResult(OrientGraphFactory factory, VertexAlgorithm algorithm) {
OrientGraphNoTx graph = factory.getNoTx();
graph.getVertices().forEach(v -> {
algorithm.collectResult(v);
});
graph.shutdown();
}
示例12: execute
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void execute() throws Exception
{
OrientGraphNoTx graph = orientConnector.getNoTxGraphInstance();
Iterable<Vertex> functions = LookupOperations.getAllFunctions(graph);
for (Vertex function : functions)
{
exportFunction(function);
}
graph.shutdown();
}
示例13: addEdgeIndex
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void addEdgeIndex(String label, boolean includeInOut, boolean includeIn, boolean includeOut, String... extraFields) {
OrientGraphNoTx noTx = factory.getNoTx();
try {
OrientEdgeType e = noTx.getEdgeType(label);
if (e == null) {
e = noTx.createEdgeType(label);
}
if ((includeIn || includeInOut) && e.getProperty("in") == null) {
e.createProperty("in", OType.LINK);
}
if ((includeOut || includeInOut) && e.getProperty("out") == null) {
e.createProperty("out", OType.LINK);
}
for (String key : extraFields) {
if (e.getProperty(key) == null) {
e.createProperty(key, OType.STRING);
}
}
String indexName = "e." + label.toLowerCase();
String name = indexName + "_inout";
if (includeInOut && e.getClassIndex(name) == null) {
e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE, new String[] { "in", "out" });
}
name = indexName + "_out";
if (includeOut && e.getClassIndex(name) == null) {
e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, new String[] { "out" });
}
name = indexName + "_in";
if (includeIn && e.getClassIndex(name) == null) {
e.createIndex(name, OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX, new String[] { "in" });
}
name = indexName + "_extra";
if (extraFields.length != 0 && e.getClassIndex(name) == null) {
e.createIndex(name, OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, extraFields);
}
} finally {
noTx.shutdown();
}
}
示例14: load
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
public void load(OrientGraphFactory factory, File nodes, File edges) throws IOException {
OrientGraphNoTx g = factory.getNoTx();
this.load(g, nodes, edges);
g.shutdown();
}
示例15: run
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; //导入方法依赖的package包/类
@Override
public void run() {
OrientGraphNoTx tx = factory.getNoTx();
this.f.apply(v);
tx.shutdown();
}