Beispiel #1
0
def write_records(records, file):
    index = xlease.VolumeIndex()
    with utils.closing(index):
        index.load(file)
        for recnum, record in records:
            block = index.copy_record_block(recnum)
            with utils.closing(block):
                block.write_record(recnum, record)
                block.dump(file)
Beispiel #2
0
def write_records(records, lockspace, path):
    file = xlease.DirectFile(path)
    with utils.closing(file):
        index = xlease.VolumeIndex(file)
        with utils.closing(index):
            for recnum, record in records:
                block = index.copy_block(recnum)
                with utils.closing(block):
                    block.write_record(recnum, record)
                    block.dump(file)
Beispiel #3
0
 def write_records(self, *records):
     """
     Write records to volume index area.
     """
     index = xlease.VolumeIndex(self.block_size)
     with utils.closing(index):
         index.load(self.backend)
         for recnum, record in records:
             block = index.copy_record_block(recnum)
             with utils.closing(block):
                 block.write_record(recnum, record)
                 block.dump(self.backend)