core/src/main/java/com/orientechnologies/orient/core/storage/cluster/v0/OClusterPositionMapV0.java
long getNextPosition(final OAtomicOperation atomicOperation) throws IOException {
    final long filledUpTo = getFilledUpTo(atomicOperation, fileId);

    final long pageIndex = filledUpTo - 1;
    final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false, 1);
    try {
      final OClusterPositionMapBucket bucket = new OClusterPositionMapBucket(cacheEntry, false);
      final int bucketSize = bucket.getSize();
      return pageIndex * OClusterPositionMapBucket.MAX_ENTRIES + bucketSize;
    } finally {
      releasePageFromRead(atomicOperation, cacheEntry);
    }
  }
long getNextPosition(final OAtomicOperation atomicOperation) throws IOException {
    final long filledUpTo = getFilledUpTo(atomicOperation, fileId);

    final long pageIndex = filledUpTo - 1;
    final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false, 1);
    try {
      final OClusterPositionMapBucket bucket = new OClusterPositionMapBucket(cacheEntry, false);
      final int bucketSize = bucket.getSize();
      return pageIndex * OClusterPositionMapBucket.MAX_ENTRIES + bucketSize;
    } finally {
      releasePageFromRead(atomicOperation, cacheEntry);
    }
  }
Returns the next position available.