def __init__(self, **kwargs): other = kwargs.get("other", None) if other: self.fromOther(other) else: pageSize = kwargs.get("pageSize", io.DEFAULT_BUFFER_SIZE) self.bufferPool = BufferPool(pageSize=pageSize) self.fileMgr = FileManager(pageSize=pageSize, bufferPool=self.bufferPool) if self.fileMgr: self.bufferPool.setFileManager(self.fileMgr)
def __init__(self, **kwargs): other = kwargs.get("other", None) if other: self.fromOther(other) else: bpArgs = { k: v for (k, v) in kwargs.items() if k in ["pageSize", "poolSize"] } fmArgs = { k: v for (k, v) in kwargs.items() if k in ["pageSize", "dataDir", "indexDir"] } self.bufferPool = BufferPool(**bpArgs) self.fileMgr = FileManager(bufferPool=self.bufferPool, **fmArgs) if self.fileMgr: self.bufferPool.setFileManager(self.fileMgr)
def makeDB(self): schema = DBSchema('employee', [('id', 'int'), ('age', 'int')]) bp = BufferPool() fm = FileManager(bufferPool=bp) bp.setFileManager(fm) return (bp, fm, schema)
def makeDB(): bp = BufferPool() fm = FileManager(bufferPool=bp) bp.setFileManager(fm) return (bp, fm)