public abstract class BaseDatastoreBatchWriter extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
BaseDatastoreBatchWriter(String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
active()
Deprecated.
|
List<Entity> |
add(FullEntity<?>... entities)
Datastore add operation: inserts the provided entities.
|
Entity |
add(FullEntity<?> entity)
Datastore add operation: inserts the provided entity.
|
void |
addWithDeferredIdAllocation(FullEntity<?>... entities)
Datastore add operation.
|
protected abstract Datastore |
datastore()
Deprecated.
|
protected void |
deactivate() |
void |
delete(Key... keys)
A datastore delete operation.
|
protected abstract Datastore |
getDatastore() |
protected String |
getName() |
boolean |
isActive()
Returns
true if still active (write operations were not sent to the Datastore). |
protected DatastoreException |
newInvalidRequest(String msg,
Object... params) |
List<Entity> |
put(FullEntity<?>... entities)
A Datastore put (a.k.a upsert) operation: creates an entity if it does not exist, updates it
otherwise.
|
Entity |
put(FullEntity<?> entity)
A Datastore put (a.k.a upsert) operation: inserts an entity if it does not exist, updates it
otherwise.
|
void |
putWithDeferredIdAllocation(FullEntity<?>... entities)
Datastore put operation.
|
protected Map<Key,FullEntity<Key>> |
toAdd() |
protected List<FullEntity<IncompleteKey>> |
toAddAutoId() |
protected Set<Key> |
toDelete() |
protected List<com.google.datastore.v1.Mutation> |
toMutationPbList() |
protected Map<Key,FullEntity<Key>> |
toPut() |
protected Map<Key,FullEntity<Key>> |
toUpdate() |
void |
update(Entity... entities)
A Datastore update operation.
|
protected void |
validateActive() |
protected BaseDatastoreBatchWriter(String name)
public final void addWithDeferredIdAllocation(FullEntity<?>... entities)
add(FullEntity) and add(FullEntity...), this method will
defer any necessary id allocation to submit time.public final Entity add(FullEntity<?> entity)
entity has a complete key and was already marked for deletion in this writer, the
operation will be changed to put(com.google.cloud.datastore.FullEntity<?>).entity - the entity to addEntity with the same properties and a key that is either newly allocated
or the same one if key is already completepublic final List<Entity> add(FullEntity<?>... entities)
put(com.google.cloud.datastore.FullEntity<?>).Entity ordered by input with the same properties and a key that
is either newly allocated or the same one if was already completeDatastoreWriter.add(FullEntity)@SafeVarargs public final void update(Entity... entities)
put(com.google.cloud.datastore.FullEntity<?>) operation for entities that were already
added or put in this writer.public final Entity put(FullEntity<?> entity)
entity - the entity to putEntity with the same properties and a key that is either newly allocated
or the same one if key is already completepublic final void putWithDeferredIdAllocation(FullEntity<?>... entities)
put(FullEntity) and put(FullEntity...), this method will
defer any necessary id allocation to submit time.public final List<Entity> put(FullEntity<?>... entities)
Entity, ordered by input. Returned keys are
either newly allocated or the same one if was already complete.public final void delete(Key... keys)
@Deprecated public boolean active()
true if still active (write operations were not sent to the Datastore).public boolean isActive()
true if still active (write operations were not sent to the Datastore).protected String getName()
protected Map<Key,FullEntity<Key>> toAdd()
protected List<FullEntity<IncompleteKey>> toAddAutoId()
protected Map<Key,FullEntity<Key>> toUpdate()
protected Map<Key,FullEntity<Key>> toPut()
protected void deactivate()
protected void validateActive()
protected DatastoreException newInvalidRequest(String msg, Object... params)
protected List<com.google.datastore.v1.Mutation> toMutationPbList()
@Deprecated protected abstract Datastore datastore()
protected abstract Datastore getDatastore()
Copyright © 2017 Google. All rights reserved.