Exemple #1
0
    def final_conditions(self,system_range):
        """Return the final conditions for a range of systems that
        is the largest time for which the system has a valid entry
        right now we don't support going through all systems
        but that should not be difficult to add
        """
        c = self.system_idx.cursor()

        if system_range.isUniversal() :
            s0 = 0
            s1 = sys.maxint
            c.first()
        else:
            s0, s1 = system_range.ulPair()
            k = PKey.packSys(s0)
            c.set_range(k) 

        sysid = s0-1
        while sysid < s1  and  c.next() != None :
            if c.get(DB_NEXT_NODUP) == None :
                ks, l = c.last()
            else:
                ks, l = c.prev()
                
            sysid = PKey.unpackSys(ks)
            yield sysid, LogRecord.from_binary(l)
Exemple #2
0
    def final_conditions(self, system_range):
        """Return the final conditions for a range of systems that
        is the largest time for which the system has a valid entry
        right now we don't support going through all systems
        but that should not be difficult to add
        """
        c = self.system_idx.cursor()

        if system_range.isUniversal():
            s0 = 0
            s1 = sys.maxint
            c.first()
        else:
            s0, s1 = system_range.ulPair()
            k = PKey.packSys(s0)
            c.set_range(k)

        sysid = s0 - 1
        while sysid < s1 and c.next() != None:
            if c.get(DB_NEXT_NODUP) == None:
                ks, l = c.last()
            else:
                ks, l = c.prev()

            sysid = PKey.unpackSys(ks)
            yield sysid, LogRecord.from_binary(l)
Exemple #3
0
    def initial_conditions(self, system_range):
        """Return initial coniditions for the system range"""
        c = self.system_idx.cursor()

        if system_range.isUniversal() :
            s0 = 0
            s1 = sys.maxint
            c.first()
        else:
            s0, s1 = system_range.ulPair()
            k = PKey.packSys(s0)
            c.set_range(k) 

        sysid = s0
        while sysid < s1 :
            r = c.get(DB_NEXT_NODUP)
            if r : 
                ks, l = r
                sysid = PKey.unpackSys(ks)
                yield sysid, LogRecord.from_binary(l)
            else:
                break
Exemple #4
0
    def initial_conditions(self, system_range):
        """Return initial coniditions for the system range"""
        c = self.system_idx.cursor()

        if system_range.isUniversal():
            s0 = 0
            s1 = sys.maxint
            c.first()
        else:
            s0, s1 = system_range.ulPair()
            k = PKey.packSys(s0)
            c.set_range(k)

        sysid = s0
        while sysid < s1:
            r = c.get(DB_NEXT_NODUP)
            if r:
                ks, l = r
                sysid = PKey.unpackSys(ks)
                yield sysid, LogRecord.from_binary(l)
            else:
                break
Exemple #5
0
 def decodeKVP(r):
     return (PKey.fromBinary(r[0]),LogRecord.from_binary(r[1]))
Exemple #6
0
 def decodeKVP(r):
     return (PKey.fromBinary(r[0]), LogRecord.from_binary(r[1]))