core/src/main/java/com/orientechnologies/orient/core/storage/index/sbtreebonsai/local/OSBTreeBonsaiLocal.java
@Override
  public void delete() throws IOException {
    boolean rollback = false;
    final OAtomicOperation atomicOperation = startAtomicOperation(false);
    try {
      final Lock lock = FILE_LOCK_MANAGER.acquireExclusiveLock(fileId);
      try {
        final Queue<OBonsaiBucketPointer> subTreesToDelete = new LinkedList<>();
        subTreesToDelete.add(rootBucketPointer);
        recycleSubTrees(subTreesToDelete, atomicOperation);
      } finally {
        lock.unlock();
      }
    } catch (final Exception e) {
      rollback = true;
      throw e;
    } finally {
      endAtomicOperation(rollback);
    }
  }
@Override
  public void delete() throws IOException {
    boolean rollback = false;
    final OAtomicOperation atomicOperation = startAtomicOperation(false);
    try {
      final Lock lock = FILE_LOCK_MANAGER.acquireExclusiveLock(fileId);
      try {
        final Queue<OBonsaiBucketPointer> subTreesToDelete = new LinkedList<>();
        subTreesToDelete.add(rootBucketPointer);
        recycleSubTrees(subTreesToDelete, atomicOperation);
      } finally {
        lock.unlock();
      }
    } catch (final Exception e) {
      rollback = true;
      throw e;
    } finally {
      endAtomicOperation(rollback);
    }
  }
@ Override public void delete ( ) throws IOException { boolean rollback = false ; final OAtomicOperation atomicOperation = startAtomicOperation ( false ) ; try { final Lock lock = FILE_LOCK_MANAGER . acquireExclusiveLock ( fileId ) ; try { final Queue < OBonsaiBucketPointer > subTreesToDelete = new LinkedList <> ( ) ; subTreesToDelete . add ( rootBucketPointer ) ; recycleSubTrees ( subTreesToDelete , atomicOperation ) ; } finally { lock . unlock ( ) ; } } catch ( final Exception e ) { rollback = true ; throw e ; } finally { endAtomicOperation ( rollback ) ; } }
Deletes a whole tree. Puts all its pages to free list for further reusage.
Deletes a whole tree . Puts all its pages to free list for further reusage .