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)
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)
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
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
def decodeKVP(r): return (PKey.fromBinary(r[0]),LogRecord.from_binary(r[1]))
def decodeKVP(r): return (PKey.fromBinary(r[0]), LogRecord.from_binary(r[1]))