class BufferMgr {

	public DataBuffer createBuffer() throws IOException {
		synchronized (snapshotLock) {
			synchronized (this) {

				if (corruptedState) {
					throw new IOException("Corrupted BufferMgr state");
				}

				int id = indexProvider.allocateIndex();
				DataBuffer buf = null;
				BufferNode node = getCachedBufferNode(id);
				if (node != null) {
					buf = node.buffer;
					node.locked = true;
					removeFromCache(node);
				}

				buf = buf != null ? buf : getCacheBuffer();
				buf.setId(id);
				buf.setDirty(true);
				buf.setEmpty(false);

				++lockCount;
				return buf;
			}
		}
	}

	public  BufferMgr();
	public  BufferMgr(int requestedBufferSize, long approxCacheSize, int maxUndos);
	public  BufferMgr(BufferFile sourceFile);
	public  BufferMgr(BufferFile sourceFile, long approxCacheSize, int maxUndos);
	private  BufferMgr(BufferFile sourceFile, int requestedbufferSize, long approxCacheSize,
			int maxUndos);

}