MCPcopy Create free account
hub / github.com/apple/foundationdb / KeySelector

Class KeySelector

bindings/python/fdb/impl.py:1224–1253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222
1223
1224class KeySelector(object):
1225 def __init__(self, key, or_equal, offset):
1226 self.key = key
1227 self.or_equal = or_equal
1228 self.offset = offset
1229
1230 def __add__(self, offset):
1231 return KeySelector(self.key, self.or_equal, self.offset + offset)
1232
1233 def __sub__(self, offset):
1234 return KeySelector(self.key, self.or_equal, self.offset - offset)
1235
1236 @classmethod
1237 def last_less_than(cls, key):
1238 return cls(key, False, 0)
1239
1240 @classmethod
1241 def last_less_or_equal(cls, key):
1242 return cls(key, True, 0)
1243
1244 @classmethod
1245 def first_greater_than(cls, key):
1246 return cls(key, True, 1)
1247
1248 @classmethod
1249 def first_greater_or_equal(cls, key):
1250 return cls(key, False, 1)
1251
1252 def __repr__(self):
1253 return 'KeySelector(%r, %r, %r)' % (self.key, self.or_equal, self.offset)
1254
1255
1256class KVIter(object):

Callers 15

__add__Method · 0.70
__sub__Method · 0.70
runGetMappedRangeFunction · 0.50
fdbClientGetRangeFunction · 0.50
generateKeySelectorMethod · 0.50
streamingClientMethod · 0.50
getRangeMethod · 0.50

Calls

no outgoing calls

Tested by 3

callMethod · 0.40
getActorMethod · 0.40