Beispiel #1
0
 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', ())
Beispiel #2
0
    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',())
Beispiel #3
0
    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, ))
Beispiel #4
0
    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,))