Merge pull request #6740 from sfc-gh-ajbeamon/docs-tenant-open-note

Add a note that opening a tenant does not check whether that tenant exists in the cluster
This commit is contained in:
A.J. Beamon 2022-03-31 13:35:04 -07:00 committed by GitHub
commit b6a0eeda11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -42,7 +42,10 @@ import com.apple.foundationdb.tuple.Tuple;
*/
public interface Database extends AutoCloseable, TransactionContext {
/**
* Opens an existing tenant to be used for running transactions.
* Opens an existing tenant to be used for running transactions.<br>
* <br>
* <b>Note:</b> opening a tenant does not check its existence in the cluster. If the tenant does not exist,
* attempts to read or write data with it will fail.
*
* @param tenantName The name of the tenant to open.
* @return a {@link Tenant} that can be used to create transactions that will operate in the tenant's key-space.
@ -53,7 +56,10 @@ public interface Database extends AutoCloseable, TransactionContext {
/**
* Opens an existing tenant to be used for running transactions. This is a convenience method that generates the
* tenant name by packing a {@code Tuple}.
* tenant name by packing a {@code Tuple}.<br>
* <br>
* <b>Note:</b> opening a tenant does not check its existence in the cluster. If the tenant does not exist,
* attempts to read or write data with it will fail.
*
* @param tenantName The name of the tenant to open, as a Tuple.
* @return a {@link Tenant} that can be used to create transactions that will operate in the tenant's key-space.

View File

@ -322,6 +322,8 @@ A |database-blurb1| |database-blurb2|
The tenant name can be either a byte string or a tuple. If a tuple is provided, the tuple will be packed using the tuple layer to generate the byte string tenant name.
.. note :: Opening a tenant does not check its existence in the cluster. If the tenant does not exist, attempts to read or write data with it will fail.
.. |sync-read| replace:: This read is fully synchronous.
.. |sync-write| replace:: This change will be committed immediately, and is fully synchronous.