public class LocalDatastoreHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
double |
consistency()
Deprecated.
|
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.
|
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. |
String |
getProjectId()
Returns the project ID associated with this local Datastore emulator.
|
DatastoreOptions |
options()
Deprecated.
|
DatastoreOptions |
options(String namespace)
Deprecated.
|
String |
projectId()
Deprecated.
|
void |
reset()
Reset the internal state of the emulator.
|
String |
sendPostRequest(String request) |
static boolean |
sendQuitRequest(int port) |
void |
start()
Starts the local Datastore emulator.
|
void |
stop()
Quit the local emulator and related local service.
|
public static boolean sendQuitRequest(int port)
public String sendPostRequest(String request) throws IOException
IOExceptionpublic void stop()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void reset()
throws IOException
IOException@Deprecated public DatastoreOptions options()
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost.public DatastoreOptions getOptions()
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost.@Deprecated 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 DatastoreOptions getOptions(String namespace)
DatastoreOptions instance that sets the host to use the Datastore emulator on
localhost. The default namespace is set to namespace.@Deprecated public String projectId()
public String getProjectId()
@Deprecated public double consistency()
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
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.