use of com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage in project orientdb by orientechnologies.
the class IndexTest method testValuesContainerIsRemovedIfIndexIsRemoved.
public void testValuesContainerIsRemovedIfIndexIsRemoved() {
if (database.getURL().startsWith("remote:"))
return;
final OSchema schema = database.getMetadata().getSchema();
OClass clazz = schema.createClass("ValuesContainerIsRemovedIfIndexIsRemovedClass", 1, null);
clazz.createProperty("val", OType.STRING);
database.command(new OCommandSQL("create index ValuesContainerIsRemovedIfIndexIsRemovedIndex on ValuesContainerIsRemovedIfIndexIsRemovedClass (val) notunique")).execute();
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 100; j++) {
ODocument document = new ODocument("ValuesContainerIsRemovedIfIndexIsRemovedClass");
document.field("val", "value" + i);
document.save();
}
}
final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage();
final OWriteCache writeCache = storageLocalAbstract.getWriteCache();
Assert.assertTrue(writeCache.exists("ValuesContainerIsRemovedIfIndexIsRemovedIndex.irs"));
database.command(new OCommandSQL("drop index ValuesContainerIsRemovedIfIndexIsRemovedIndex")).execute();
Assert.assertTrue(!writeCache.exists("ValuesContainerIsRemovedIfIndexIsRemovedIndex.irs"));
}
use of com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage in project orientdb by orientechnologies.
the class BrowseSpeedTest method testIterationSpeed.
public void testIterationSpeed() throws IOException {
Orient.instance().scheduleTask(new TimerTask() {
@Override
public void run() {
final OAbstractPaginatedStorage stg = (OAbstractPaginatedStorage) Orient.instance().getStorages().iterator().next();
System.out.println("DiskCache used: " + stg.getReadCache().getUsedMemory());
}
}, 1000, 1000);
browseStorageClusters();
System.out.println("2nd lap...");
browseStorageClusters();
System.out.println("3rd lap...");
browseStorageClusters();
System.out.println("4th lap...");
browseStorageClusters();
// browseClusters();
// browseClusters();
// loadAllRecordsOneByOne();
// loadAllRecordsOneByOne();
}
use of com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage in project orientdb by orientechnologies.
the class LocalCreateBinaryDocumentSpeedTest method cycle.
@Override
@Test(enabled = false)
public void cycle() {
final OStorage storage = database.getStorage();
((OAbstractPaginatedStorage) storage).startGatheringPerformanceStatisticForCurrentThread();
record = new ORecordBytes(database, payload);
record.save();
if (data.getCyclesDone() == data.getCycles() - 1)
database.commit();
OSessionStoragePerformanceStatistic sessionStoragePerformanceStatistic = ((OAbstractPaginatedStorage) storage).completeGatheringPerformanceStatisticForCurrentThread();
System.out.println(sessionStoragePerformanceStatistic.toDocument().toJSON("prettyPrint"));
}
Aggregations