public class DatastoreResourceManager
extends java.lang.Object
implements org.apache.beam.it.common.ResourceManager
Modifier and Type | Class and Description |
---|---|
static class |
DatastoreResourceManager.Builder |
Constructor and Description |
---|
DatastoreResourceManager(DatastoreResourceManager.Builder builder) |
Modifier and Type | Method and Description |
---|---|
static DatastoreResourceManager.Builder |
builder(java.lang.String project,
java.lang.String namespace,
com.google.auth.Credentials credentials) |
void |
cleanupAll()
Deletes all created entities and cleans up the Datastore client.
|
java.util.List<com.google.cloud.datastore.Entity> |
insert(java.lang.String kind,
java.util.Map<java.lang.Long,com.google.cloud.datastore.FullEntity<?>> entities)
Insert entities to Datastore.
|
java.util.List<com.google.cloud.datastore.Entity> |
query(java.lang.String gqlQuery)
Run a Gql Query and return the results in entity format.
|
public DatastoreResourceManager(DatastoreResourceManager.Builder builder)
public java.util.List<com.google.cloud.datastore.Entity> insert(java.lang.String kind, java.util.Map<java.lang.Long,com.google.cloud.datastore.FullEntity<?>> entities)
kind
- Kind of document to insert.entities
- Entities to insert to Datastore.public java.util.List<com.google.cloud.datastore.Entity> query(java.lang.String gqlQuery)
gqlQuery
- Gql Query to run.public void cleanupAll() throws DatastoreResourceManagerException
cleanupAll
in interface org.apache.beam.it.common.ResourceManager
DatastoreResourceManagerException
- if there is an error deleting the entities in
Datastore.public static DatastoreResourceManager.Builder builder(java.lang.String project, java.lang.String namespace, com.google.auth.Credentials credentials)