Search in sources :

Example 1 with OETLBaseTest

use of com.orientechnologies.orient.etl.OETLBaseTest in project orientdb by orientechnologies.

the class OJsonRandomExtractorTest method testParallel.

@Test
public void testParallel() {
    final int TOTAL = 2000000;
    proc.getFactory().registerExtractor(OETLStubRandomExtractor.class);
    process("{extractor : { random: {items: " + TOTAL + ", fields: 10, delay: 0} }, " + "loader: { orientdb: { dbURL: 'plocal:./target/OETLBaseTest', dbType:'graph', class: 'Person', useLightweightEdges:false, " + "classes: [{name: 'Person', extends: 'V', clusters: 8 }] } } }", new OBasicCommandContext().setVariable("parallel", Boolean.TRUE).setVariable("dumpEveryMs", 1000));
    assertEquals(TOTAL, graph.countVertices("Person"));
    int i = 0;
    for (ODocument doc : graph.getRawGraph().browseClass("Person")) {
        assertEquals(10, doc.fields());
        i++;
    }
}
Also used : OBasicCommandContext(com.orientechnologies.orient.core.command.OBasicCommandContext) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) OETLBaseTest(com.orientechnologies.orient.etl.OETLBaseTest) Test(org.junit.Test)

Aggregations

OBasicCommandContext (com.orientechnologies.orient.core.command.OBasicCommandContext)1 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)1 OETLBaseTest (com.orientechnologies.orient.etl.OETLBaseTest)1 Test (org.junit.Test)1