use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.
the class LocalPaginatedStorageRestoreFromWAL method testSimpleRestore.
public void testSimpleRestore() throws Exception {
List<Future<Void>> futures = new ArrayList<Future<Void>>();
baseDocumentTx.declareIntent(new OIntentMassiveInsert());
for (int i = 0; i < 8; i++) futures.add(executorService.submit(new DataPropagationTask()));
for (Future<Void> future : futures) future.get();
Thread.sleep(1500);
copyDataFromTestWithoutClose();
OStorage baseStorage = baseDocumentTx.getStorage();
baseDocumentTx.close();
baseStorage.close();
testDocumentTx = new ODatabaseDocumentTx("plocal:" + buildDir.getAbsolutePath() + "/testLocalPaginatedStorageRestoreFromWAL");
testDocumentTx.open("admin", "admin");
testDocumentTx.close();
ODatabaseCompare databaseCompare = new ODatabaseCompare(testDocumentTx.getURL(), baseDocumentTx.getURL(), "admin", "admin", new OCommandOutputListener() {
@Override
public void onMessage(String text) {
System.out.println(text);
}
});
databaseCompare.setCompareIndexMetadata(true);
Assert.assertTrue(databaseCompare.compare());
}
use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.
the class LocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords method testRestoreAndAddNewItems.
public void testRestoreAndAddNewItems() throws Exception {
List<Future<Void>> futures = new ArrayList<Future<Void>>();
baseDocumentTx.declareIntent(new OIntentMassiveInsert());
Random random = new Random();
long[] seeds = new long[5];
for (int i = 0; i < 5; i++) {
seeds[i] = random.nextLong();
System.out.println("Seed [" + i + "] = " + seeds[i]);
}
for (long seed : seeds) futures.add(executorService.submit(new DataPropagationTask(seed)));
for (Future<Void> future : futures) future.get();
futures.clear();
Thread.sleep(1500);
copyDataFromTestWithoutClose();
OStorage storage = baseDocumentTx.getStorage();
baseDocumentTx.close();
storage.close();
testDocumentTx = new ODatabaseDocumentTx("plocal:" + buildDir.getAbsolutePath() + "/testLocalPaginatedStorageRestoreFromWALAndAddAdditionalRecords");
testDocumentTx.open("admin", "admin");
testDocumentTx.close();
long dataAddSeed = random.nextLong();
System.out.println("Data add seed = " + dataAddSeed);
for (int i = 0; i < 1; i++) futures.add(executorService.submit(new DataPropagationTask(dataAddSeed)));
for (Future<Void> future : futures) future.get();
ODatabaseCompare databaseCompare = new ODatabaseCompare(testDocumentTx.getURL(), baseDocumentTx.getURL(), "admin", "admin", new OCommandOutputListener() {
@Override
public void onMessage(String text) {
System.out.println(text);
}
});
databaseCompare.setCompareIndexMetadata(true);
Assert.assertTrue(databaseCompare.compare());
}
use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.
the class OOrientDBLoader method beginLoader.
public void beginLoader(OETLPipeline pipeline) {
synchronized (this) {
ODatabaseDocument documentDatabase = null;
OrientBaseGraph graphDatabase = null;
final OrientGraphFactory factory = new OrientGraphFactory(dbURL, dbUser, dbPassword);
graphDatabase = tx ? factory.getTx() : factory.getNoTx();
graphDatabase.setUseLightweightEdges(useLightweightEdges);
graphDatabase.setStandardElementConstraints(standardElementConstraints);
documentDatabase = graphDatabase.getRawGraph();
pipeline.setDocumentDatabase(documentDatabase);
pipeline.setGraphDatabase(graphDatabase);
createSchema(pipeline, documentDatabase);
documentDatabase.getMetadata().getSchema().reload();
documentDatabase.declareIntent(new OIntentMassiveInsert());
}
}
use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.
the class LocalCreateIndexedDocumentSpeedTest method init.
@Override
public void init() {
Orient.instance().getProfiler().startRecording();
database = new ODatabaseDocumentTx(System.getProperty("url")).open("admin", "admin");
record = database.newInstance();
// REMOVE THE INDEX
System.out.println("Remove index...");
database.getMetadata().getSchema().getClass("Profile").getProperty("nick").dropIndexes();
System.out.println("Ok");
database.declareIntent(new OIntentMassiveInsert());
database.begin(TXTYPE.NOTX);
}
use of com.orientechnologies.orient.core.intent.OIntentMassiveInsert in project orientdb by orientechnologies.
the class LocalCreateObjectSpeedTest method init.
@Override
public void init() {
Orient.instance().getProfiler().startRecording();
database = new OObjectDatabaseTx(System.getProperty("url")).open("admin", "admin");
database.getEntityManager().registerEntityClass(Account.class);
database.declareIntent(new OIntentMassiveInsert());
database.begin(TXTYPE.NOTX);
}
Aggregations