Package com.orientechnologies.orient.core.index.hashindex.local.cache

Examples of com.orientechnologies.orient.core.index.hashindex.local.cache.OCacheEntry.acquireExclusiveLock()


        updatedBucketIndex = diskCache.getFilledUpTo(metadataPage.getFileId(newFileLevel));

      final long newBucketIndex = updatedBucketIndex + 1;

      final OCacheEntry updatedBucketCacheEntry = loadPageEntry(updatedBucketIndex, newFileLevel);
      updatedBucketCacheEntry.acquireExclusiveLock();
      try {
        final OCacheEntry newBucketCacheEntry = loadPageEntry(newBucketIndex, newFileLevel);

        newBucketCacheEntry.acquireExclusiveLock();
        try {
View Full Code Here


      final OCacheEntry updatedBucketCacheEntry = loadPageEntry(updatedBucketIndex, newFileLevel);
      updatedBucketCacheEntry.acquireExclusiveLock();
      try {
        final OCacheEntry newBucketCacheEntry = loadPageEntry(newBucketIndex, newFileLevel);

        newBucketCacheEntry.acquireExclusiveLock();
        try {
          final OHashIndexBucket<K, V> updatedBucket = new OHashIndexBucket<K, V>(newBucketDepth, updatedBucketCacheEntry,
              keySerializer, valueSerializer, keyTypes, getTrackMode());
          final OHashIndexBucket<K, V> newBucket = new OHashIndexBucket<K, V>(newBucketDepth, newBucketCacheEntry, keySerializer,
              valueSerializer, keyTypes, getTrackMode());
View Full Code Here

  }

  private void initHashTreeState() throws IOException {
    for (long pageIndex = 0; pageIndex < MAX_LEVEL_SIZE; pageIndex++) {
      final OCacheEntry cacheEntry = loadPageEntry(pageIndex, 0);
      cacheEntry.acquireExclusiveLock();
      try {
        final OHashIndexBucket<K, V> emptyBucket = new OHashIndexBucket<K, V>(MAX_LEVEL_DEPTH, cacheEntry, keySerializer,
            valueSerializer, keyTypes, getTrackMode());
        cacheEntry.markDirty();
View Full Code Here

        lastPage = 0;
        isNewPage = true;
      }

      OCacheEntry cacheEntry = diskCache.load(fileId, lastPage, false);
      cacheEntry.acquireExclusiveLock();
      try {
        startAtomicOperation();

        final ODurablePage.TrackMode trackMode = getTrackMode();
View Full Code Here

          diskCache.release(cacheEntry);

          isNewPage = true;
          cacheEntry = diskCache.allocateNewPage(fileId);

          cacheEntry.acquireExclusiveLock();
          bucket = new OClusterPositionMapBucket(cacheEntry, trackMode);
        }

        final long index = bucket.add(pageIndex, recordPosition);
        final OClusterPosition result = OClusterPositionFactory.INSTANCE.valueOf(index + cacheEntry.getPageIndex()
View Full Code Here

      long pageIndex = position / OClusterPositionMapBucket.MAX_ENTRIES;
      int index = (int) (position % OClusterPositionMapBucket.MAX_ENTRIES);

      final OCacheEntry cacheEntry = diskCache.load(fileId, pageIndex, false);
      cacheEntry.acquireExclusiveLock();
      try {
        startAtomicOperation();
        final ODurablePage.TrackMode trackMode = getTrackMode();
        final OClusterPositionMapBucket bucket = new OClusterPositionMapBucket(cacheEntry, trackMode);
View Full Code Here

          if (!expectedDiskCache.isOpen(fileId))
            expectedDiskCache.openFile(fileId);

          final OCacheEntry cacheEntry = expectedDiskCache.load(fileId, pageIndex, true);
          cacheEntry.acquireExclusiveLock();
          try {
            ODurablePage durablePage = new ODurablePage(cacheEntry, ODurablePage.TrackMode.NONE);
            durablePage.restoreChanges(updatePageRecord.getChanges());
            durablePage.setLsn(updatePageRecord.getLsn());
View Full Code Here

        final long pageIndex = getPageIndex(bucketPointer);
        final int fileLevel = getFileLevel(bucketPointer);
        final V removed;

        final OCacheEntry cacheEntry = loadPageEntry(pageIndex, fileLevel);
        cacheEntry.acquireExclusiveLock();
        try {
          final OHashIndexBucket<K, V> bucket = new OHashIndexBucket<K, V>(cacheEntry, keySerializer, valueSerializer, keyTypes,
              getTrackMode());
          final int positionIndex = bucket.getIndex(hashCode, key);
          if (positionIndex < 0) {
View Full Code Here

          return null;

        V removed = null;

        OCacheEntry cacheEntry = diskCache.load(nullBucketFileId, 0, false);
        cacheEntry.acquireExclusiveLock();
        try {
          final ONullBucket<V> nullBucket = new ONullBucket<V>(cacheEntry, getTrackMode(), valueSerializer, false);

          removed = nullBucket.getValue();
          if (removed != null) {
View Full Code Here

      buddyLevel = getFileLevel(buddyPointer);
      buddyIndex = getPageIndex(buddyPointer);
    }

    OCacheEntry buddyCacheEntry = loadPageEntry(buddyIndex, buddyLevel);
    buddyCacheEntry.acquireExclusiveLock();
    try {
      diskCache.loadPinnedPage(hashStateEntry);
      hashStateEntry.acquireExclusiveLock();
      try {
        buddyBucket = new OHashIndexBucket<K, V>(buddyCacheEntry, keySerializer, valueSerializer, keyTypes, getTrackMode());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.