Class LocalDatastoreService

java.lang.Object
com.google.appengine.api.datastore.dev.LocalDatastoreService
Direct Known Subclasses:
LocalDatastoreV3Service

public abstract class LocalDatastoreService extends Object
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.

  • Field Details

    • MAX_QUERY_RESULTS

      public static final int MAX_QUERY_RESULTS
      See Also:
    • PACKAGE

      public static final String PACKAGE
      The package name for this service.
      See Also:
    • MAX_QUERY_LIFETIME_PROPERTY

      public static final String MAX_QUERY_LIFETIME_PROPERTY
      How long a query can stay "live" before we expire it.
      See Also:
    • MAX_TRANSACTION_LIFETIME_PROPERTY

      public static final String MAX_TRANSACTION_LIFETIME_PROPERTY
      How long a transaction can stay "live" before we expire it.
      See Also:
    • STORE_DELAY_PROPERTY

      public static final String 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_TXN
      The maximum number of entity groups in a transaction.
      See Also:
    • BACKING_STORE_PROPERTY

      public static final String BACKING_STORE_PROPERTY
      Where to read/store the datastore from/to.
      See Also:
    • EMULATE_VNEXT_FEATURES

      public static final String EMULATE_VNEXT_FEATURES
      True to emulate Datastore vnext features. These features mandate strong consistency everywhere, so custom HighRepJobPolicy policies are disallowed while this flag is true.
      See Also:
    • NO_INDEX_AUTO_GEN_PROP

      public static final String NO_INDEX_AUTO_GEN_PROP
      True to prevent the datastore from writing IndexesXmlReader.GENERATED_INDEX_FILENAME.
      See Also:
    • NO_STORAGE_PROPERTY

      public static final String NO_STORAGE_PROPERTY
      True to put the datastore into "memory-only" mode.
      See Also:
    • HIGH_REP_JOB_POLICY_CLASS_PROPERTY

      public static final String HIGH_REP_JOB_POLICY_CLASS_PROPERTY
      The fully-qualifed name of a class that implements HighRepJobPolicy and has a no-arg constructor. If not provided we use a DefaultHighRepJobPolicy. See the javadoc for this class for information on its configurable properties.
      See Also:
    • FORCE_IS_HIGH_REP_PROPERTY

      public static final String 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

      public static final String INDEX_CONFIGURATION_FORMAT_PROPERTY
      See Also:
    • AUTO_ID_ALLOCATION_POLICY_PROPERTY

      public static final String 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

      public void init(LocalServiceContext context, Map<String,String> properties)
    • init

      public void init(File appDirectory, com.google.appengine.tools.development.Clock clock, Map<String,String> properties)
    • start

      public void start()
    • stop

      public void stop()
    • setMaxQueryLifetime

      public void setMaxQueryLifetime(int milliseconds)
    • setMaxTransactionLifetime

      public void setMaxTransactionLifetime(int milliseconds)
    • setBackingStore

      public void setBackingStore(String backingStore)
    • setStoreDelay

      public void setStoreDelay(int delayMs)
    • setNoStorage

      public void setNoStorage(boolean noStorage)
    • enableScatterProperty

      public void enableScatterProperty(boolean enable)
    • getPackage

      public String 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

      public Double getDefaultDeadline(boolean isOfflineRequest)
    • getMaximumDeadline

      public Double getMaximumDeadline(boolean isOfflineRequest)