org.sirix.cache.BufferManagerImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirix-core Show documentation
Show all versions of sirix-core Show documentation
SirixDB is a hybrid on-disk and in-memory document oriented, versioned database system. It has a lightweight buffer manager, stores everything in a huge persistent and durable tree and allows efficient reconstruction of every revision. Furthermore, SirixDB implements change tracking, diffing and supports time travel queries.
package org.sirix.cache;
import org.sirix.index.redblacktree.RBNode;
import org.sirix.page.PageReference;
import org.sirix.page.RevisionRootPage;
import org.sirix.page.interfaces.Page;
public final class BufferManagerImpl implements BufferManager {
private final PageCache pageCache;
private final RecordPageCache recordPageCache;
private final RevisionRootPageCache revisionRootPageCache;
private final RedBlackTreeNodeCache redBlackTreeNodeCache;
public BufferManagerImpl(final int maxPageCacheSize, final int maxRecordPageCacheSize,
final int maxRevisionRootPageCache, final int maxRBTreeNodeCache) {
pageCache = new PageCache(maxPageCacheSize);
recordPageCache = new RecordPageCache(maxRecordPageCacheSize);
revisionRootPageCache = new RevisionRootPageCache(maxRevisionRootPageCache);
redBlackTreeNodeCache = new RedBlackTreeNodeCache(maxRBTreeNodeCache);
}
@Override
public Cache getPageCache() {
return pageCache;
}
@Override
public Cache getRecordPageCache() {
return recordPageCache;
}
@Override
public Cache getRevisionRootPageCache() {
return revisionRootPageCache;
}
@Override
public Cache> getIndexCache() {
return redBlackTreeNodeCache;
}
@Override
public void close() {
pageCache.clear();
recordPageCache.clear();
revisionRootPageCache.clear();
redBlackTreeNodeCache.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy