public interface DatastoreBatchWriter extends DatastoreWriter
Modifier and Type | Method and Description |
---|---|
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.
|
void |
delete(Key... keys)
A datastore delete operation.
|
boolean |
isActive()
Returns
true if still active (write operations were not sent to the Datastore). |
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.
|
void |
update(Entity... entities)
A Datastore update operation.
|
void addWithDeferredIdAllocation(FullEntity<?>... entities)
add(FullEntity)
and add(FullEntity...)
, this method will
defer any necessary id allocation to submit time.IllegalArgumentException
- if any of the given entities is missing a keyDatastoreException
- if a given entity with a complete key was already added to this
writer or if not activeEntity 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<?>)
.add
in interface DatastoreWriter
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 completeDatastoreException
- if a given entity with the same complete key was already added to
this writer, if writer is not active or if id allocation for an entity with an incomplete
key failedList<Entity> add(FullEntity<?>... entities)
put(com.google.cloud.datastore.FullEntity<?>)
.add
in interface DatastoreWriter
Entity
ordered by input with the same properties and a key that is
either newly allocated or the same one if was already completeDatastoreException
- if a given entity with the same complete key was already added to
this writer, if writer is not active or if id allocation for an entity with an incomplete
key failedDatastoreWriter.add(FullEntity)
void update(Entity... entities)
put(com.google.cloud.datastore.FullEntity<?>)
operation for entities that were
already added or put in this writer.update
in interface DatastoreWriter
DatastoreException
- if an entity is marked for deletion in this writer or if not activevoid delete(Key... keys)
delete
in interface DatastoreWriter
DatastoreException
- if not activevoid putWithDeferredIdAllocation(FullEntity<?>... entities)
put(FullEntity)
and put(FullEntity...)
, this method will
defer any necessary id allocation to submit time.IllegalArgumentException
- if any of the given entities is missing a keyDatastoreException
- if not activeEntity put(FullEntity<?> entity)
put
in interface DatastoreWriter
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 completeDatastoreException
- if not active or if id allocation for an entity with an incomplete
key failedList<Entity> put(FullEntity<?>... entities)
put
in interface DatastoreWriter
Entity
, ordered by input. Returned keys are
either newly allocated or the same one if was already complete.DatastoreException
- if not active or if id allocation for an entity with an incomplete
key failedboolean isActive()
true
if still active (write operations were not sent to the Datastore).Copyright © 2019 Google LLC. All rights reserved.