public class DatastoreMutationPool extends Object
class Example extends Mapper<...> {
...
private transient DatastoreMutationPool pool;
...
public void beginSlice() {
pool = DatastoreMutationPool.create();
}
public void endSlice() {
pool.flush();
}
public void map(... value) {
...
Entity entity = ...
pool.put(entity);
...
}
}
Modifier and Type | Class and Description |
---|---|
static class |
DatastoreMutationPool.Params
DatastoreMutationPool params.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BYTES_LIMIT |
static int |
DEFAULT_COUNT_LIMIT |
static DatastoreMutationPool.Params |
DEFAULT_PARAMS |
Modifier and Type | Method and Description |
---|---|
static DatastoreMutationPool |
create() |
static DatastoreMutationPool |
create(com.google.appengine.api.datastore.DatastoreService ds,
DatastoreMutationPool.Params params) |
void |
delete(com.google.appengine.api.datastore.Key key)
Adds a mutation to put the given entity to the datastore.
|
void |
flush()
Performs all pending mutations.
|
void |
put(com.google.appengine.api.datastore.Entity entity)
Adds a mutation deleting the entity with the given key.
|
public static final int DEFAULT_COUNT_LIMIT
public static final int DEFAULT_BYTES_LIMIT
public static final DatastoreMutationPool.Params DEFAULT_PARAMS
public static DatastoreMutationPool create(com.google.appengine.api.datastore.DatastoreService ds, DatastoreMutationPool.Params params)
public static DatastoreMutationPool create()
public void delete(com.google.appengine.api.datastore.Key key)
public void put(com.google.appengine.api.datastore.Entity entity)
public void flush()
Copyright © 2015 Google. All rights reserved.