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());
}
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);
}
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()));
}
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);
}
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();
}
}
Aggregations