public class LocalityUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.CompletableFuture<java.lang.String[]> |
getAddressesForKey(Transaction tr,
byte[] key)
Returns a list of public network addresses as strings, one for each of
the storage servers responsible for storing
key and its associated
value. |
static CloseableAsyncIterator<byte[]> |
getBoundaryKeys(Database db,
byte[] begin,
byte[] end)
Returns 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.This method is not transactional. |
static CloseableAsyncIterator<byte[]> |
getBoundaryKeys(Transaction tr,
byte[] begin,
byte[] end)
Returns 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.This method is not transactional. |
public static CloseableAsyncIterator<byte[]> getBoundaryKeys(Database db, byte[] begin, byte[] end)
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.db
- the database to querybegin
- the inclusive start of the rangeend
- the exclusive end of the rangepublic static CloseableAsyncIterator<byte[]> getBoundaryKeys(Transaction tr, byte[] begin, byte[] end)
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.Transaction
is not used
for reads directly, instead it is used to get access to associated
Database
. As a result, options (such as retry limit) set on the
passed Transaction
will not be applied. If, however, the passed
Transaction
has already gotten a read version there is some
latency advantage to using this form of the method. Also, if the database
is unavailable prior to the function call, any timeout set on the
passed Transaction
will still trigger.tr
- the transaction on which to base the querybegin
- the inclusive start of the rangeend
- the exclusive end of the rangepublic static java.util.concurrent.CompletableFuture<java.lang.String[]> getAddressesForKey(Transaction tr, byte[] key)
key
and its associated
value.
If locality information is not available, the returned future will carry a
FDBException
locality_information_unavailable.tr
- the transaction in which to gather location informationkey
- the key for which to gather location information