@ 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 .