public class LocalDatastoreHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
double |
consistency()
Returns the consistency setting for the local Datastore emulator.
|
static LocalDatastoreHelper |
create()
Creates a local Datastore helper with a placeholder project ID and the default consistency
setting of 0.9.
|
static LocalDatastoreHelper |
create(double consistency)
Creates a local Datastore helper with the specified settings for project ID and consistency.
|
DatastoreOptions |
options()
Returns a
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. |
DatastoreOptions |
options(String namespace)
Returns a
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. |
String |
projectId()
Returns the project ID associated with this local Datastore emulator.
|
static boolean |
sendQuitRequest(int port) |
void |
start()
Starts the local Datastore emulator.
|
void |
stop() |
public static boolean sendQuitRequest(int port)
public void stop()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic DatastoreOptions options()
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost.public DatastoreOptions options(String namespace)
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. The default namespace is set to namespace.public String projectId()
public double consistency()
public static LocalDatastoreHelper create(double consistency)
consistency - the fraction of Datastore writes that are immediately visible to global
queries, with 0.0 meaning no writes are immediately visible and 1.0 meaning all writes
are immediately visible. Note that setting this to 1.0 may mask incorrect assumptions
about the consistency of non-ancestor queries; non-ancestor queries are eventually
consistent.public static LocalDatastoreHelper create()
public void start()
throws IOException,
InterruptedException
InterruptedException - if emulator-related tasks are interruptedIOException - if there are socket exceptions or issues creating/deleting the temporary
data folderCopyright © 2016 Google. All rights reserved.