Interface AsyncDatastoreService (2.0.0)

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
Name Description
parent @org.checkerframework.checker.nullness.qual.Nullable com.google.appengine.api.datastore.Key
kind String
num long
Returns
Type Description
Future<KeyRange>

allocateIds(String kind, long num)

public abstract Future<KeyRange> allocateIds(String kind, long num)
Parameters
Name Description
kind String
num long
Returns
Type Description
Future<KeyRange>

beginTransaction()

public abstract Future<Transaction> beginTransaction()
Returns
Type Description
Future<Transaction>

beginTransaction(TransactionOptions options)

public abstract Future<Transaction> beginTransaction(TransactionOptions options)
Parameter
Name Description
options TransactionOptions
Returns
Type Description
Future<Transaction>

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

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

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

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

delete(Key[] keys)

public abstract Future<Void> delete(Key[] keys)
Parameter
Name Description
keys Key[]
Returns
Type Description
Future<Void>

delete(Iterable<Key> keys)

public abstract Future<Void> delete(Iterable<Key> keys)
Parameter
Name Description
keys Iterable<Key>
Returns
Type Description
Future<Void>

get(@Nullable Transaction txn, Key key)

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

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

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

get(Key key)

public abstract Future<Entity> get(Key key)
Parameter
Name Description
key Key
Returns
Type Description
Future<Entity>

get(Iterable<Key> keys)

public abstract Future<Map<Key,Entity>> get(Iterable<Key> keys)
Parameter
Name Description
keys Iterable<Key>
Returns
Type Description
Future<Map<Key,Entity>>

getDatastoreAttributes()

public abstract Future<DatastoreAttributes> getDatastoreAttributes()
Returns
Type Description
Future<DatastoreAttributes>

getIndexes()

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

put(@Nullable Transaction txn, Entity entity)

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

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

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

put(Entity entity)

public abstract Future<Key> put(Entity entity)
Parameter
Name Description
entity Entity
Returns
Type Description
Future<Key>

put(Iterable<Entity> entities)

public abstract Future<List<Key>> put(Iterable<Entity> entities)
Parameter
Name Description
entities Iterable<Entity>
Returns
Type Description
Future<List<Key>>