public abstract class BaseDatastoreBatchWriter extends Object implements DatastoreBatchWriter
| 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.
|
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<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() |
public final void addWithDeferredIdAllocation(FullEntity<?>... entities)
DatastoreBatchWriterDatastoreBatchWriter.add(FullEntity) and DatastoreBatchWriter.add(FullEntity...), this method will
defer any necessary id allocation to submit time.addWithDeferredIdAllocation in interface DatastoreBatchWriterpublic final Entity add(FullEntity<?> entity)
DatastoreBatchWriterentity has a complete key and was already marked for deletion in this
writer, the operation will be changed to DatastoreBatchWriter.put(com.google.cloud.datastore.FullEntity<?>).add in interface DatastoreBatchWriteradd in interface DatastoreWriterentity - 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)
DatastoreBatchWriterDatastoreBatchWriter.put(com.google.cloud.datastore.FullEntity<?>).add in interface DatastoreBatchWriteradd in interface DatastoreWriterEntity 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)
DatastoreBatchWriterDatastoreBatchWriter.put(com.google.cloud.datastore.FullEntity<?>) operation for entities that were
already added or put in this writer.update in interface DatastoreBatchWriterupdate in interface DatastoreWriterpublic final Entity put(FullEntity<?> entity)
DatastoreBatchWriterput in interface DatastoreBatchWriterput in interface DatastoreWriterentity - 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)
DatastoreBatchWriterDatastoreBatchWriter.put(FullEntity) and DatastoreBatchWriter.put(FullEntity...), this method will
defer any necessary id allocation to submit time.putWithDeferredIdAllocation in interface DatastoreBatchWriterpublic final List<Entity> put(FullEntity<?>... entities)
DatastoreBatchWriterput in interface DatastoreBatchWriterput in interface DatastoreWriterEntity, ordered by input. Returned keys are
either newly allocated or the same one if was already complete.public final void delete(Key... keys)
DatastoreBatchWriterdelete in interface DatastoreBatchWriterdelete in interface DatastoreWriterpublic boolean isActive()
DatastoreBatchWritertrue if still active (write operations were not sent to the Datastore).isActive in interface DatastoreBatchWriterprotected 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 abstract Datastore getDatastore()
Copyright © 2019 Google LLC. All rights reserved.