MCPcopy Create free account
hub / github.com/wal-e/wal-e / next_larger

Method next_larger

wal_e/storage/base.py:87–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 assert False
86
87 def next_larger(self):
88 int_seg = int(self.seg, 16)
89 assert int_seg <= 0xFF
90
91 if int_seg == 0xFF:
92 # Seg is at the maximum value, carry the increment into
93 # 'log'.
94 #
95 # NB: older versions of Postgres won't generate a seg
96 # value of 0xFF, so a gap has to be treated
97 # conservatively.
98 int_log = int(self.log, 16)
99
100 # Blow up if int_log would otherwise overflow. Almost
101 # certainly a bug...or Postgres is going to exhaust its
102 # XLog addressing, too.
103 assert int_log < 0xFFFFFFFF
104
105 l_log = SegmentNumber._integer_to_name(int_log + 1)
106 l_seg = SegmentNumber._integer_to_name(0)
107
108 return self.__class__(l_log, l_seg)
109 else:
110 l_log = self.log
111 l_seg = SegmentNumber._integer_to_name(int_seg + 1)
112
113 return self.__class__(l_log, l_seg)
114
115 assert False
116
117
118OBSOLETE_VERSIONS = frozenset(('004', '003', '002', '001', '000'))

Callers 1

future_segment_streamMethod · 0.80

Calls 1

_integer_to_nameMethod · 0.80

Tested by

no test coverage detected