Search in sources :

Example 1 with ORecordSerializerBinary

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary in project orientdb by orientechnologies.

the class ORecordSerializerBinaryDebugTest method before.

@BeforeMethod
public void before() {
    previous = ODatabaseDocumentTx.getDefaultSerializer();
    ODatabaseDocumentTx.setDefaultSerializer(new ORecordSerializerBinary());
}
Also used : ORecordSerializerBinary(com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with ORecordSerializerBinary

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary in project orientdb by orientechnologies.

the class LocalCreateDocumentMultiThreadSpeedTest method init.

@Override
public void init() {
    mainDatabase = new ODatabaseDocumentTx(System.getProperty("url"));
    mainDatabase.setSerializer(new ORecordSerializerBinary());
    if (mainDatabase.exists()) {
        mainDatabase.open("admin", "admin");
        // else
        mainDatabase.drop();
    }
    mainDatabase.create();
    mainDatabase.set(ODatabase.ATTRIBUTES.MINIMUMCLUSTERS, 8);
    mainDatabase.getMetadata().getSchema().createClass("Account");
    // database.countClusterElements("Account");
    foundObjects = 0;
    System.out.println("\nTotal objects in Animal cluster before the test: " + foundObjects);
}
Also used : ORecordSerializerBinary(com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)

Example 3 with ORecordSerializerBinary

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary in project orientdb by orientechnologies.

the class LocalMTCreateDocumentSpeedTest method init.

@BeforeClass
public void init() {
    OGlobalConfiguration.USE_WAL.setValue(false);
    database = new ODatabaseDocumentTx(System.getProperty("url"));
    database.setSerializer(new ORecordSerializerBinary());
    if (database.exists()) {
        database.open("admin", "admin");
        database.drop();
    }
    database.create();
    database.getMetadata().getSchema().createClass("Account");
    final OSecurity security = database.getMetadata().getSecurity();
    for (int i = 0; i < 100; i++) {
        users.add("user" + i);
        security.createUser("user" + i, "user" + i, "admin");
    }
    futures = new ArrayList<Future>();
    for (int i = 0; i < 1; i++) futures.add(executorService.submit(new Saver()));
}
Also used : ORecordSerializerBinary(com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary) OSecurity(com.orientechnologies.orient.core.metadata.security.OSecurity) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with ORecordSerializerBinary

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary in project orientdb by orientechnologies.

the class LocalCreateDocumentSpeedTest method init.

@Override
@Test(enabled = false)
public void init() {
    database = new ODatabaseDocumentTx(System.getProperty("url"));
    database.setSerializer(new ORecordSerializerBinary());
    if (database.exists()) {
        database.open("admin", "admin");
        database.drop();
    }
    database.create();
    OSchema schema = database.getMetadata().getSchema();
    schema.createClass("Account");
    record = database.newInstance();
    database.declareIntent(new OIntentMassiveInsert());
    database.begin(TXTYPE.NOTX);
}
Also used : ORecordSerializerBinary(com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary) OSchema(com.orientechnologies.orient.core.metadata.schema.OSchema) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) OIntentMassiveInsert(com.orientechnologies.orient.core.intent.OIntentMassiveInsert) OrientMonoThreadTest(com.orientechnologies.orient.test.database.base.OrientMonoThreadTest) Test(org.testng.annotations.Test)

Example 5 with ORecordSerializerBinary

use of com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary in project orientdb by orientechnologies.

the class SQLUpdateMapTest method testMapPut.

@Test
public void testMapPut() {
    ODatabaseDocument db = new ODatabaseDocumentTx("memory:" + SQLUpdateMapTest.class.getSimpleName());
    try {
        ((ODatabaseDocumentTx) db).setSerializer(new ORecordSerializerBinary());
        db.create();
        db.command(new OCommandSQL("create class vRecord")).execute();
        ODocument ret = db.command(new OCommandSQL("insert into vRecord (title) values('first record')")).execute();
        ODocument ret1 = db.command(new OCommandSQL("insert into vRecord (title) values('second record')")).execute();
        db.command(new OCommandSQL("update " + ret.getIdentity() + " put attrs = 'test1', " + ret1.getIdentity())).execute();
        db.close();
        db.open("admin", "admin");
        db.getLocalCache().clear();
        db.command(new OCommandSQL("update " + ret.getIdentity() + " put attrs = 'test', 'test value' ")).execute();
        ret.reload();
        assertEquals(2, ((Map) ret.field("attrs")).size());
        assertEquals("test value", ((Map) ret.field("attrs")).get("test"));
        assertEquals(ret1.getIdentity(), ((Map) ret.field("attrs")).get("test1"));
    } finally {
        db.drop();
    }
}
Also used : OCommandSQL(com.orientechnologies.orient.core.sql.OCommandSQL) ORecordSerializerBinary(com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary) ODatabaseDocument(com.orientechnologies.orient.core.db.document.ODatabaseDocument) ODatabaseDocumentTx(com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) Test(org.testng.annotations.Test)

Aggregations

ORecordSerializerBinary (com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary)6 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)5 Test (org.testng.annotations.Test)3 OIntentMassiveInsert (com.orientechnologies.orient.core.intent.OIntentMassiveInsert)2 OSchema (com.orientechnologies.orient.core.metadata.schema.OSchema)2 OrientMonoThreadTest (com.orientechnologies.orient.test.database.base.OrientMonoThreadTest)2 ODatabaseDocument (com.orientechnologies.orient.core.db.document.ODatabaseDocument)1 OSecurity (com.orientechnologies.orient.core.metadata.security.OSecurity)1 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)1 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)1 BeforeClass (org.testng.annotations.BeforeClass)1 BeforeMethod (org.testng.annotations.BeforeMethod)1