예제 #1
0
  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)
예제 #2
0
    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)
예제 #3
0
 def makeDB(self):
   schema = DBSchema('employee', [('id', 'int'), ('age', 'int')])
   bp = BufferPool()
   fm = FileManager(bufferPool=bp)
   bp.setFileManager(fm)
   return (bp, fm, schema)
예제 #4
0
def makeDB():
    bp = BufferPool()
    fm = FileManager(bufferPool=bp)
    bp.setFileManager(fm)
    return (bp, fm)