public class LocalDatastoreHelper extends BaseEmulatorHelper<DatastoreOptions>
BaseEmulatorHelper.DownloadableEmulatorRunner, BaseEmulatorHelper.EmulatorRunner, BaseEmulatorHelper.GcloudEmulatorRunnerDEFAULT_HOST, DEFAULT_PORT, PROJECT_ID_PREFIX| Modifier and Type | Method and Description |
|---|---|
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.
|
double |
getConsistency()
Returns the consistency setting for the local Datastore emulator.
|
protected List<BaseEmulatorHelper.EmulatorRunner> |
getEmulatorRunners() |
protected Logger |
getLogger() |
DatastoreOptions |
getOptions()
Returns a
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. |
DatastoreOptions |
getOptions(String namespace)
Returns a
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. |
void |
reset()
Reset the internal state of the Datastore emulator.
|
void |
start()
Starts the local Datastore emulator through
gcloud, downloads and caches the zip file
if user does not have gcloud or a compatible emulator version installed. |
void |
stop(org.joda.time.Duration timeout)
Stops the Datastore emulator.
|
findAvailablePort, getPort, getProjectId, isWindows, sendPostRequest, startProcess, waitForProcessprotected List<BaseEmulatorHelper.EmulatorRunner> getEmulatorRunners()
getEmulatorRunners in class BaseEmulatorHelper<DatastoreOptions>protected Logger getLogger()
getLogger in class BaseEmulatorHelper<DatastoreOptions>public DatastoreOptions getOptions()
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost.getOptions in class BaseEmulatorHelper<DatastoreOptions>public DatastoreOptions getOptions(String namespace)
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. The default namespace is set to namespace.public double getConsistency()
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
gcloud, downloads and caches the zip file
if user does not have gcloud or a compatible emulator version installed.start in class BaseEmulatorHelper<DatastoreOptions>IOExceptionInterruptedExceptionpublic void reset()
throws IOException
reset in class BaseEmulatorHelper<DatastoreOptions>IOExceptionpublic void stop(org.joda.time.Duration timeout)
throws IOException,
InterruptedException,
TimeoutException
stop in class BaseEmulatorHelper<DatastoreOptions>IOExceptionInterruptedExceptionTimeoutExceptionCopyright © 2017 Google. All rights reserved.