Class LocalDatastoreService
java.lang.Object
com.google.appengine.api.datastore.dev.LocalDatastoreService
- Direct Known Subclasses:
LocalDatastoreV3Service
A local implementation of the Datastore.
This is a memory-based implementation which can persist itself to disk through a batch operation.
This class is no longer a LocalRpcService,
however it is still called a service for backwards compatibility.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe set of supported values for autoIdAllocationPolicy, which controls how auto IDs are assigned by put(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringWhere to read/store the datastore from/to.static final StringTrue to emulate Datastore vnext features.static final StringIf this property exists we consider the datastore to be high replication independent of the high rep job policy.static final StringThe fully-qualifed name of a class that implementsHighRepJobPolicyand has a no-arg constructor.static final Stringstatic final intThe maximum number of entity groups in a transaction.static final StringHow long a query can stay "live" before we expire it.static final intstatic final StringHow long a transaction can stay "live" before we expire it.static final StringTrue to prevent the datastore from writingIndexesXmlReader.GENERATED_INDEX_FILENAME.static final StringTrue to put the datastore into "memory-only" mode.static final StringThe package name for this service.static final StringHow long to wait before updating the persistent store in milliseconds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.apphosting.base.protos.api.ApiBasePb.VoidProtoaddActions(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddRequest request) com.google.apphosting.datastore.DatastoreV3Pb.AllocateIdsResponseallocateIds(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.AllocateIdsRequest req) com.google.apphosting.datastore.DatastoreV3Pb.TransactionbeginTransaction(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.BeginTransactionRequest req) voidClear out the in-memory datastore.voidClear out the query history that we use for generating indexes.com.google.apphosting.datastore.DatastoreV3Pb.CommitResponsecommit(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Transaction req) com.google.apphosting.base.protos.api.ApiBasePb.Integer64ProtocreateIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req) com.google.apphosting.datastore.DatastoreV3Pb.DeleteResponsedelete(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.DeleteRequest request) com.google.apphosting.base.protos.api.ApiBasePb.VoidProtodeleteCursor(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Cursor request) com.google.apphosting.datastore.DatastoreV3Pb.DeleteResponsedeleteImpl(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.DeleteRequest request) com.google.apphosting.base.protos.api.ApiBasePb.VoidProtodeleteIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req) voidenableScatterProperty(boolean enable) com.google.apphosting.datastore.DatastoreV3Pb.GetResponseget(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.GetRequest request) getDefaultDeadline(boolean isOfflineRequest) com.google.apphosting.datastore.DatastoreV3Pb.CompositeIndicesgetIndices(LocalRpcService.Status status, com.google.apphosting.base.protos.api.ApiBasePb.StringProto req) getMaximumDeadline(boolean isOfflineRequest) voidinit(LocalServiceContext context, Map<String, String> properties) voidinit(File appDirectory, com.google.appengine.tools.development.Clock clock, Map<String, String> properties) com.google.apphosting.datastore.DatastoreV3Pb.QueryResultnext(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.NextRequest request) com.google.apphosting.datastore.DatastoreV3Pb.PutResponseput(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.PutRequest request) com.google.apphosting.datastore.DatastoreV3Pb.PutResponseputImpl(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.PutRequest request) com.google.apphosting.base.protos.api.ApiBasePb.VoidProtorollback(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Transaction req) com.google.apphosting.datastore.DatastoreV3Pb.QueryResultrunQuery(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Query query) voidsetBackingStore(String backingStore) voidsetMaxQueryLifetime(int milliseconds) voidsetMaxTransactionLifetime(int milliseconds) voidsetNoStorage(boolean noStorage) voidsetStoreDelay(int delayMs) voidstart()voidstop()com.google.apphosting.base.protos.api.ApiBasePb.VoidProtoupdateIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req)
-
Field Details
-
MAX_QUERY_RESULTS
public static final int MAX_QUERY_RESULTS- See Also:
-
PACKAGE
The package name for this service.- See Also:
-
MAX_QUERY_LIFETIME_PROPERTY
How long a query can stay "live" before we expire it.- See Also:
-
MAX_TRANSACTION_LIFETIME_PROPERTY
How long a transaction can stay "live" before we expire it.- See Also:
-
STORE_DELAY_PROPERTY
How long to wait before updating the persistent store in milliseconds.- See Also:
-
MAX_EG_PER_TXN
public static final int MAX_EG_PER_TXNThe maximum number of entity groups in a transaction.- See Also:
-
BACKING_STORE_PROPERTY
Where to read/store the datastore from/to.- See Also:
-
EMULATE_VNEXT_FEATURES
True to emulate Datastore vnext features. These features mandate strong consistency everywhere, so customHighRepJobPolicypolicies are disallowed while this flag is true.- See Also:
-
NO_INDEX_AUTO_GEN_PROP
True to prevent the datastore from writingIndexesXmlReader.GENERATED_INDEX_FILENAME.- See Also:
-
NO_STORAGE_PROPERTY
True to put the datastore into "memory-only" mode.- See Also:
-
HIGH_REP_JOB_POLICY_CLASS_PROPERTY
The fully-qualifed name of a class that implementsHighRepJobPolicyand has a no-arg constructor. If not provided we use aDefaultHighRepJobPolicy. See the javadoc for this class for information on its configurable properties.- See Also:
-
FORCE_IS_HIGH_REP_PROPERTY
If this property exists we consider the datastore to be high replication independent of the high rep job policy.- See Also:
-
INDEX_CONFIGURATION_FORMAT_PROPERTY
- See Also:
-
AUTO_ID_ALLOCATION_POLICY_PROPERTY
- See Also:
-
-
Constructor Details
-
LocalDatastoreService
public LocalDatastoreService()
-
-
Method Details
-
clearProfiles
public void clearProfiles()Clear out the in-memory datastore. Note that this does not clear out any data that has been persisted on disk. -
clearQueryHistory
public void clearQueryHistory()Clear out the query history that we use for generating indexes. -
init
-
init
-
start
public void start() -
stop
public void stop() -
setMaxQueryLifetime
public void setMaxQueryLifetime(int milliseconds) -
setMaxTransactionLifetime
public void setMaxTransactionLifetime(int milliseconds) -
setBackingStore
-
setStoreDelay
public void setStoreDelay(int delayMs) -
setNoStorage
public void setNoStorage(boolean noStorage) -
enableScatterProperty
public void enableScatterProperty(boolean enable) -
getPackage
-
get
public com.google.apphosting.datastore.DatastoreV3Pb.GetResponse get(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.GetRequest request) -
put
public com.google.apphosting.datastore.DatastoreV3Pb.PutResponse put(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.PutRequest request) -
putImpl
public com.google.apphosting.datastore.DatastoreV3Pb.PutResponse putImpl(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.PutRequest request) -
delete
public com.google.apphosting.datastore.DatastoreV3Pb.DeleteResponse delete(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.DeleteRequest request) -
addActions
public com.google.apphosting.base.protos.api.ApiBasePb.VoidProto addActions(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddRequest request) -
deleteImpl
public com.google.apphosting.datastore.DatastoreV3Pb.DeleteResponse deleteImpl(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.DeleteRequest request) -
runQuery
public com.google.apphosting.datastore.DatastoreV3Pb.QueryResult runQuery(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Query query) -
next
public com.google.apphosting.datastore.DatastoreV3Pb.QueryResult next(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.NextRequest request) -
deleteCursor
public com.google.apphosting.base.protos.api.ApiBasePb.VoidProto deleteCursor(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Cursor request) -
beginTransaction
public com.google.apphosting.datastore.DatastoreV3Pb.Transaction beginTransaction(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.BeginTransactionRequest req) -
commit
public com.google.apphosting.datastore.DatastoreV3Pb.CommitResponse commit(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Transaction req) -
rollback
public com.google.apphosting.base.protos.api.ApiBasePb.VoidProto rollback(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.Transaction req) -
createIndex
public com.google.apphosting.base.protos.api.ApiBasePb.Integer64Proto createIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req) -
updateIndex
public com.google.apphosting.base.protos.api.ApiBasePb.VoidProto updateIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req) -
getIndices
public com.google.apphosting.datastore.DatastoreV3Pb.CompositeIndices getIndices(LocalRpcService.Status status, com.google.apphosting.base.protos.api.ApiBasePb.StringProto req) -
deleteIndex
public com.google.apphosting.base.protos.api.ApiBasePb.VoidProto deleteIndex(LocalRpcService.Status status, com.google.storage.onestore.v3.OnestoreEntity.CompositeIndex req) -
allocateIds
public com.google.apphosting.datastore.DatastoreV3Pb.AllocateIdsResponse allocateIds(LocalRpcService.Status status, com.google.apphosting.datastore.DatastoreV3Pb.AllocateIdsRequest req) -
getDefaultDeadline
-
getMaximumDeadline
-