public class FDBLocalityUtil extends Object implements FDBLocalityProvider
FDBLocalityProvider
interface that uses foundationDB's LocalityUtil
API to
discover the storage locations of keys within a cluster.Modifier and Type | Method and Description |
---|---|
CloseableAsyncIterator<byte[]> |
getBoundaryKeys(Transaction tr,
byte[] begin,
byte[] end)
Return an estimate of the keys boundaries within the given range.
|
static FDBLocalityUtil |
instance()
Get the single instance of this utility class.
|
@Nonnull public static FDBLocalityUtil instance()
@Nonnull public CloseableAsyncIterator<byte[]> getBoundaryKeys(@Nonnull Transaction tr, @Nonnull byte[] begin, @Nonnull byte[] end)
The method results in a CloseableAsyncIterator
of keys k
such that
begin <= k < end
and k
is located at the start of a contiguous range stored on a single server.
getBoundaryKeys
in interface FDBLocalityProvider
tr
- the transaction on which to base the querybegin
- the inclusive start of the rangeend
- the exclusive end of the rangeLocalityUtil.getBoundaryKeys(Transaction, byte[], byte[])