Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Java 17 is now generally available.

Interface AsyncDatastoreService (2.0.0)

Stay organized with collections Save and categorize content based on your preferences.
public interface AsyncDatastoreService extends BaseDatastoreService

An asynchronous version of DatastoreService. All methods return immediately and provide Futures as their return values.

The key difference between implementations of AsyncDatastoreService and implementations of DatastoreService is that async implementations do not perform implicit transaction management. The reason is that implicit transaction management requires automatic commits of some transactions, and without some sort of callback mechanism there is no way to determine that a put/get/delete that has been implicitly enrolled in a transaction is complete and therefore ready to be committed. See ImplicitTransactionManagementPolicy for more information.

Methods

allocateIds(@Nullable Key parent, String kind, long num)

public abstract Future<KeyRange> allocateIds(@Nullable Key parent, String kind, long num)
Parameters
NameDescription
parent@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Key
kindString
numlong
Returns
TypeDescription
Future<KeyRange>

allocateIds(String kind, long num)

public abstract Future<KeyRange> allocateIds(String kind, long num)
Parameters
NameDescription
kindString
numlong
Returns
TypeDescription
Future<KeyRange>

beginTransaction()

public abstract Future<Transaction> beginTransaction()
Returns
TypeDescription
Future<Transaction>

beginTransaction(TransactionOptions options)

public abstract Future<Transaction> beginTransaction(TransactionOptions options)
Parameter
NameDescription
optionsTransactionOptions
Returns
TypeDescription
Future<Transaction>

delete(@Nullable Transaction txn, Key[] keys)

public abstract Future<Void> delete(@Nullable Transaction txn, Key[] keys)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
keysKey[]
Returns
TypeDescription
Future<Void>

delete(@Nullable Transaction txn, Iterable<Key> keys)

public abstract Future<Void> delete(@Nullable Transaction txn, Iterable<Key> keys)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
keysIterable<Key>
Returns
TypeDescription
Future<Void>

delete(Key[] keys)

public abstract Future<Void> delete(Key[] keys)
Parameter
NameDescription
keysKey[]
Returns
TypeDescription
Future<Void>

delete(Iterable<Key> keys)

public abstract Future<Void> delete(Iterable<Key> keys)
Parameter
NameDescription
keysIterable<Key>
Returns
TypeDescription
Future<Void>

get(@Nullable Transaction txn, Key key)

public abstract Future<Entity> get(@Nullable Transaction txn, Key key)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
keyKey
Returns
TypeDescription
Future<Entity>

get(@Nullable Transaction txn, Iterable<Key> keys)

public abstract Future<Map<Key,Entity>> get(@Nullable Transaction txn, Iterable<Key> keys)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
keysIterable<Key>
Returns
TypeDescription
Future<Map<Key,Entity>>

get(Key key)

public abstract Future<Entity> get(Key key)
Parameter
NameDescription
keyKey
Returns
TypeDescription
Future<Entity>

get(Iterable<Key> keys)

public abstract Future<Map<Key,Entity>> get(Iterable<Key> keys)
Parameter
NameDescription
keysIterable<Key>
Returns
TypeDescription
Future<Map<Key,Entity>>

getDatastoreAttributes()

public abstract Future<DatastoreAttributes> getDatastoreAttributes()
Returns
TypeDescription
Future<DatastoreAttributes>

getIndexes()

public abstract Future<Map<Index,Index.IndexState>> getIndexes()
Returns
TypeDescription
Future<Map<Index,IndexState>>

put(@Nullable Transaction txn, Entity entity)

public abstract Future<Key> put(@Nullable Transaction txn, Entity entity)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
entityEntity
Returns
TypeDescription
Future<Key>

put(@Nullable Transaction txn, Iterable<Entity> entities)

public abstract Future<List<Key>> put(@Nullable Transaction txn, Iterable<Entity> entities)
Parameters
NameDescription
txn@org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Transaction
entitiesIterable<Entity>
Returns
TypeDescription
Future<List<Key>>

put(Entity entity)

public abstract Future<Key> put(Entity entity)
Parameter
NameDescription
entityEntity
Returns
TypeDescription
Future<Key>

put(Iterable<Entity> entities)

public abstract Future<List<Key>> put(Iterable<Entity> entities)
Parameter
NameDescription
entitiesIterable<Entity>
Returns
TypeDescription
Future<List<Key>>