Search in sources :

Example 71 with OrientGraphNoTx

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

the class SuperNodeInsertSpeedTest method deinit.

@Override
public void deinit() {
    final OrientGraphNoTx graph = factory.getNoTx();
    try {
        final long total = graph.countVertices("Client");
        System.out.println("\nTotal objects in Client cluster after the test: " + total);
        System.out.println("Created " + (total));
        Assert.assertEquals(total, threadCycles);
    // final long indexedItems = graph.getRawGraph().getMetadata().getIndexManager().getIndex("Client.uid").getSize();
    // System.out.println("\nTotal indexed objects after the test: " + indexedItems);
    } finally {
        graph.shutdown();
    }
}
Also used : OrientGraphNoTx(com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx)

Example 72 with OrientGraphNoTx

use of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx 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

OrientGraphNoTx (com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx)72 OrientVertex (com.tinkerpop.blueprints.impls.orient.OrientVertex)28 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)23 Test (org.junit.Test)22 OrientGraphFactory (com.tinkerpop.blueprints.impls.orient.OrientGraphFactory)20 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)17 OrientVertexType (com.tinkerpop.blueprints.impls.orient.OrientVertexType)17 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)16 OrientBaseGraph (com.tinkerpop.blueprints.impls.orient.OrientBaseGraph)15 OSQLSynchQuery (com.orientechnologies.orient.core.sql.query.OSQLSynchQuery)7 Vertex (com.tinkerpop.blueprints.Vertex)6 OrientGraph (com.tinkerpop.blueprints.impls.orient.OrientGraph)6 OClass (com.orientechnologies.orient.core.metadata.schema.OClass)5 OGraphMLReader (com.orientechnologies.orient.graph.graphml.OGraphMLReader)5 OGraphRepair (com.tinkerpop.blueprints.impls.orient.OGraphRepair)5 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)4 Edge (com.tinkerpop.blueprints.Edge)4 OSchema (com.orientechnologies.orient.core.metadata.schema.OSchema)3 OrientEdge (com.tinkerpop.blueprints.impls.orient.OrientEdge)3 File (java.io.File)3