def clear_cache(self): """ Clears the caches used (flushing any data not yet written). """ if self.caching: #self.flush() Tools.method_mapply(self.caches, 'clear', ())
def clear_cache(self): """ Clears the caches used (flushing any data not yet written). """ if self.caching: #self.flush() Tools.method_mapply(self.caches,'clear',())
def free(self, position, OLD=OLD, HOT=HOT): """ Deletes an already written record by marking it OLD. The next garbage collection will make the change permanent and free the occupied space. """ if self.state != HOT: self.mark(HOT) file = self.file file.seek(position + 5) file.write(OLD) if self.caching: Tools.method_mapply(self.caches, 'delete', (position, ))
def free(self,position, OLD=OLD,HOT=HOT): """ Deletes an already written record by marking it OLD. The next garbage collection will make the change permanent and free the occupied space. """ if self.state != HOT: self.mark(HOT) file = self.file file.seek(position + 5) file.write(OLD) if self.caching: Tools.method_mapply(self.caches,'delete',(position,))