Package com.orientechnologies.orient.core.storage.impl.local

Examples of com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage


    this.durableNonTxMode = durableNonTxMode;
  }

  private long resolveFileIdByName(String fileName) {
    final OAbstractPaginatedStorage storage = (OAbstractPaginatedStorage) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage()
        .getUnderlying();
    try {
      return storage.getDiskCache().openFile(fileName);
    } catch (IOException e) {
      throw new OSBTreeException("Error creation of sbtree with name" + fileName, e);
    }
  }
View Full Code Here


  }

  public OIndexRIDContainerSBTree(String file, OBonsaiBucketPointer rootPointer, boolean durableMode) {
    tree = new OSBTreeBonsaiLocal<OIdentifiable, Boolean>(INDEX_FILE_EXTENSION, durableMode);

    final OAbstractPaginatedStorage storage = (OAbstractPaginatedStorage) ODatabaseRecordThreadLocal.INSTANCE.get().getStorage()
        .getUnderlying();
    final long fileId;
    try {
      fileId = storage.getDiskCache().openFile(file + INDEX_FILE_EXTENSION);
    } catch (IOException e) {
      throw new OSBTreeException("Exception during loading of sbtree " + file, e);
    }
    tree.load(fileId, rootPointer, storage);
  }
View Full Code Here

      final int keySize = determineKeySize(indexDefinition);

      final ORecordBytes identityRecord = new ORecordBytes();
      ODatabaseRecordInternal database = getDatabase();

      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      database.save(identityRecord, clusterIndexName);
      identity = identityRecord.getIdentity();

      sbTree.create(indexName, keySerializer, (OBinarySerializer<V>) valueSerializer,
View Full Code Here

  @Override
  public void deleteWithoutLoad(String indexName) {
    acquireExclusiveLock();
    try {
      final ODatabaseRecordInternal database = getDatabase();
      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      sbTree.deleteWithoutLoad(indexName, storageLocalAbstract);
    } finally {
      releaseExclusiveLock();
    }
View Full Code Here

  public void load(ORID indexRid, String indexName, OIndexDefinition indexDefinition, OStreamSerializer valueSerializer,
      boolean isAutomatic) {
    acquireExclusiveLock();
    try {
      ODatabaseRecordInternal database = getDatabase();
      final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage().getUnderlying();

      sbTree.load(indexName, determineKeySerializer(indexDefinition), valueSerializer,
          indexDefinition != null ? indexDefinition.getTypes() : null, storageLocalAbstract, determineKeySize(indexDefinition),
          indexDefinition != null && indexDefinition.isNullValuesIgnored());
    } finally {
View Full Code Here

    } else
      keySerializer = new OSimpleKeySerializer();

    final ODatabaseRecordInternal database = getDatabase();
    final ORecordBytes identityRecord = new ORecordBytes();
    final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage();

    database.save(identityRecord, clusterIndexName);
    identity = identityRecord.getIdentity();

    hashFunction.setValueSerializer(keySerializer);
View Full Code Here

    Assert.assertNull(queryShortName());

    final OStorage storage = db.getStorage();

    if (storage instanceof OAbstractPaginatedStorage) {
      final OAbstractPaginatedStorage paginatedStorage = (OAbstractPaginatedStorage) storage;
      final ODiskCache diskCache = paginatedStorage.getDiskCache();

      Assert.assertTrue(diskCache.exists(SHORTNAME_CLASS_NAME.toLowerCase() + OPaginatedCluster.DEF_EXTENSION));
    }

    String shortName = "shortname";
View Full Code Here

  public void testRename() {
    OSchema schema = db.getMetadata().getSchema();
    OClass oClass = schema.createClass("ClassName");

    final OStorage storage = db.getStorage();
    final OAbstractPaginatedStorage paginatedStorage = (OAbstractPaginatedStorage) storage;
    final ODiskCache diskCache = paginatedStorage.getDiskCache();

    Assert.assertTrue(diskCache.exists("classname" + OPaginatedCluster.DEF_EXTENSION));

    oClass.setName("ClassNameNew");
View Full Code Here

    Assert.assertEquals(db.countClass("ClassOne"), 1);

    classOne.setName("ClassThree");

    final OStorage storage = db.getStorage();
    final OAbstractPaginatedStorage paginatedStorage = (OAbstractPaginatedStorage) storage;
    final ODiskCache diskCache = paginatedStorage.getDiskCache();

    Assert.assertTrue(diskCache.exists("classone" + OPaginatedCluster.DEF_EXTENSION));

    Assert.assertEquals(db.countClass("ClassTwo"), 2);
    Assert.assertEquals(db.countClass("ClassThree"), 1);
View Full Code Here

        document.field("val", "value" + i);
        document.save();
      }
    }

    final OAbstractPaginatedStorage storageLocalAbstract = (OAbstractPaginatedStorage) database.getStorage();
    final ODiskCache diskCache = storageLocalAbstract.getDiskCache();

    Assert.assertTrue(diskCache.exists("ValuesContainerIsRemovedIfIndexIsRemovedIndex.irs"));

    database.command(new OCommandSQL("drop index ValuesContainerIsRemovedIfIndexIsRemovedIndex")).execute();
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.