Search in sources :

Example 31 with OrientVertexType

use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.

the class SuperNodeInsertSpeedTest method init.

@Override
public void init() {
    if (factory.exists())
        factory.drop();
    final OrientGraphNoTx graph = factory.getNoTx();
    try {
        if (graph.getVertexType("Client") == null) {
            final OrientVertexType clientType = graph.createVertexType("Client");
            final OrientVertexType.OrientVertexProperty property = clientType.createProperty("uid", OType.STRING);
            // CREATE ONE CLUSTER PER THREAD
            for (int i = 0; i < getThreads(); ++i) {
                System.out.println("Creating cluster: client_" + i + "...");
                clientType.addCluster("client_" + i);
            }
        }
        OrientVertex superNode = graph.addVertex("class:Client", "name", "superNode");
        final OrientVertex v = graph.addVertex("class:Client", "uid", counter.getAndIncrement());
        superNode.addEdge("test", v);
        superNodeRID = superNode.getIdentity();
    } finally {
        graph.shutdown();
    }
}
Also used : OrientGraphNoTx(com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx) OrientVertexType(com.tinkerpop.blueprints.impls.orient.OrientVertexType) OrientVertex(com.tinkerpop.blueprints.impls.orient.OrientVertex)

Aggregations

OrientVertexType (com.tinkerpop.blueprints.impls.orient.OrientVertexType)31 OrientGraphNoTx (com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx)17 OrientVertex (com.tinkerpop.blueprints.impls.orient.OrientVertex)13 OrientGraph (com.tinkerpop.blueprints.impls.orient.OrientGraph)12 Test (org.junit.Test)9 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)8 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)5 OrientEdgeType (com.tinkerpop.blueprints.impls.orient.OrientEdgeType)5 Vertex (com.tinkerpop.blueprints.Vertex)4 OrientGraphFactory (com.tinkerpop.blueprints.impls.orient.OrientGraphFactory)4 Before (org.junit.Before)4 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)3 OrientBaseGraph (com.tinkerpop.blueprints.impls.orient.OrientBaseGraph)3 OValidationException (com.orientechnologies.orient.core.exception.OValidationException)2 ORecordId (com.orientechnologies.orient.core.id.ORecordId)2 OClass (com.orientechnologies.orient.core.metadata.schema.OClass)2 OSchema (com.orientechnologies.orient.core.metadata.schema.OSchema)2 ONeedRetryException (com.orientechnologies.common.concur.ONeedRetryException)1 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)1 ORID (com.orientechnologies.orient.core.id.ORID)1