public boolean load(final OBonsaiBucketPointer rootBucketPointer) {
final Lock lock = FILE_LOCK_MANAGER.acquireExclusiveLock(fileId);
try {
this.rootBucketPointer = rootBucketPointer;
final OAtomicOperation atomicOperation = OAtomicOperationsManager.getCurrentOperation();
this.fileId = openFile(atomicOperation, getFullName());
final OCacheEntry rootCacheEntry = loadPageForRead(atomicOperation, this.fileId, this.rootBucketPointer.getPageIndex(),
false);
try {
final OSBTreeBonsaiBucket<K, V> rootBucket = new OSBTreeBonsaiBucket<>(rootCacheEntry,
this.rootBucketPointer.getPageOffset(),
keySerializer, valueSerializer, this);
keySerializer = (OBinarySerializer<K>) storage.getComponentsFactory().binarySerializerFactory
.getObjectSerializer(rootBucket.getKeySerializerId());
valueSerializer = (OBinarySerializer<V>) storage.getComponentsFactory().binarySerializerFactory
.getObjectSerializer(rootBucket.getValueSerializerId());
return !rootBucket.isDeleted();
} finally {
releasePageFromRead(atomicOperation, rootCacheEntry);
}
} catch (final IOException e) {
throw OException.wrapException(new OSBTreeBonsaiLocalException("Exception during loading of sbtree " + fileId, this), e);
} finally {
lock.unlock();
}
}