public abstract class CachingAsyncDatastoreReaderWriter extends Object implements AsyncDatastoreReaderWriter
A write-through memcache for Entity objects that works for both transactional and nontransactional sessions.
Note: Until Google adds a hook that lets us wrap native Future> implementations,
you muse install the AsyncCacheFilter
to use this cache asynchronously. This
is not necessary for synchronous use of CachingDatastoreService
, but asynchronous
operation requires an extra hook for the end of a request when fired-and-forgotten put()s
and delete()s get processed. If you use this cache asynchronously, and you do not
use the AsyncCacheFilter
, your cache will go out of sync.
Constructor and Description |
---|
CachingAsyncDatastoreReaderWriter() |
Modifier and Type | Method and Description |
---|---|
Future<Void> |
delete(Iterable<com.google.cloud.datastore.Key> keys) |
protected abstract void |
empty(Iterable<com.google.cloud.datastore.Key> keys) |
Future<List<com.google.cloud.datastore.Key>> |
put(Iterable<? extends com.google.cloud.datastore.FullEntity<?>> entities) |
<T> com.google.cloud.datastore.QueryResults<T> |
run(com.google.cloud.datastore.Query<T> query) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, put
protected abstract void empty(Iterable<com.google.cloud.datastore.Key> keys)
public Future<Void> delete(Iterable<com.google.cloud.datastore.Key> keys)
delete
in interface AsyncDatastoreReaderWriter
public <T> com.google.cloud.datastore.QueryResults<T> run(com.google.cloud.datastore.Query<T> query)
run
in interface AsyncDatastoreReaderWriter
public Future<List<com.google.cloud.datastore.Key>> put(Iterable<? extends com.google.cloud.datastore.FullEntity<?>> entities)
put
in interface AsyncDatastoreReaderWriter
Copyright © 2018. All rights reserved.