Search in sources :

Example 36 with OAbstractPaginatedStorage

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"));
}
Also used : OCommandSQL(com.orientechnologies.orient.core.sql.OCommandSQL) OSchema(com.orientechnologies.orient.core.metadata.schema.OSchema) OWriteCache(com.orientechnologies.orient.core.storage.cache.OWriteCache) OClass(com.orientechnologies.orient.core.metadata.schema.OClass) OAbstractPaginatedStorage(com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage) ODocument(com.orientechnologies.orient.core.record.impl.ODocument)

Example 37 with OAbstractPaginatedStorage

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();
}
Also used : TimerTask(java.util.TimerTask) OAbstractPaginatedStorage(com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)

Example 38 with OAbstractPaginatedStorage

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"));
}
Also used : ORecordBytes(com.orientechnologies.orient.core.record.impl.ORecordBytes) OStorage(com.orientechnologies.orient.core.storage.OStorage) OAbstractPaginatedStorage(com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage) OSessionStoragePerformanceStatistic(com.orientechnologies.orient.core.storage.impl.local.statistic.OSessionStoragePerformanceStatistic) OrientMonoThreadTest(com.orientechnologies.orient.test.database.base.OrientMonoThreadTest) Test(org.testng.annotations.Test)

Aggregations

OAbstractPaginatedStorage (com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage)38 OStorage (com.orientechnologies.orient.core.storage.OStorage)12 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)9 OWriteCache (com.orientechnologies.orient.core.storage.cache.OWriteCache)7 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)5 Test (org.testng.annotations.Test)5 OClass (com.orientechnologies.orient.core.metadata.schema.OClass)4 OSchema (com.orientechnologies.orient.core.metadata.schema.OSchema)4 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)4 OLocalPaginatedStorage (com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage)4 File (java.io.File)4 BeforeClass (org.testng.annotations.BeforeClass)4 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)3 ORecordId (com.orientechnologies.orient.core.id.ORecordId)3 IOException (java.io.IOException)3 OLockException (com.orientechnologies.common.concur.lock.OLockException)2 OException (com.orientechnologies.common.exception.OException)2 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)2 ORID (com.orientechnologies.orient.core.id.ORID)2 ORemoteIndexEngine (com.orientechnologies.orient.core.index.engine.ORemoteIndexEngine)2