LocalDatastoreService

com.google.appengine.api.datastore.dev

Class LocalDatastoreService

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


    public abstract class LocalDatastoreService
    extends java.lang.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 com.google.appengine.tools.development.LocalRpcService, however it is still called a service for backwards compatibility.

    • Field Detail

      • PACKAGE

        public static final java.lang.String PACKAGE
        The package name for this service.
        See Also:
        Constant Field Values
      • MAX_QUERY_LIFETIME_PROPERTY

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

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

        public static final java.lang.String STORE_DELAY_PROPERTY
        How long to wait before updating the persistent store in milliseconds.
        See Also:
        Constant Field Values
      • MAX_EG_PER_TXN

        public static final int MAX_EG_PER_TXN
        The maximum number of entity groups in a transaction.
        See Also:
        Constant Field Values
      • BACKING_STORE_PROPERTY

        public static final java.lang.String BACKING_STORE_PROPERTY
        Where to read/store the datastore from/to.
        See Also:
        Constant Field Values
      • EMULATE_VNEXT_FEATURES

        public static final java.lang.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:
        Constant Field Values
      • NO_INDEX_AUTO_GEN_PROP

        public static final java.lang.String NO_INDEX_AUTO_GEN_PROP
        True to prevent the datastore from writing com.google.apphosting.utils.config.IndexesXmlReader#GENERATED_INDEX_FILENAME.
        See Also:
        Constant Field Values
      • NO_STORAGE_PROPERTY

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

        public static final java.lang.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:
        Constant Field Values
      • FORCE_IS_HIGH_REP_PROPERTY

        public static final java.lang.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:
        Constant Field Values
      • INDEX_CONFIGURATION_FORMAT_PROPERTY

        public static final java.lang.String INDEX_CONFIGURATION_FORMAT_PROPERTY
        See Also:
        Constant Field Values
      • AUTO_ID_ALLOCATION_POLICY_PROPERTY

        public static final java.lang.String AUTO_ID_ALLOCATION_POLICY_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocalDatastoreService

        public LocalDatastoreService()
    • Method Detail

      • addActionImpl

        protected abstract void addActionImpl(TaskQueueAddRequest action)
        Calls the add method on the taskqueue service.

        Subclasses should override this to use the appropriate method of calling other services.

      • 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,
                         java.util.Map<java.lang.String,java.lang.String> properties)
      • init

        public void init(java.io.File appDirectory,
                         Clock clock,
                         java.util.Map<java.lang.String,java.lang.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(java.lang.String backingStore)
      • setStoreDelay

        public void setStoreDelay(int delayMs)
      • setNoStorage

        public void setNoStorage(boolean noStorage)
      • enableScatterProperty

        public void enableScatterProperty(boolean enable)
      • getPackage

        public java.lang.String getPackage()
      • get

        public GetResponse get(Status status,
                               GetRequest request)
      • put

        public PutResponse put(Status status,
                               PutRequest request)
      • putImpl

        public PutResponse putImpl(Status status,
                                   PutRequest request)
      • delete

        public DeleteResponse delete(Status status,
                                     DeleteRequest request)
      • addActions

        public VoidProto addActions(Status status,
                                    TaskQueueBulkAddRequest request)
      • deleteImpl

        public DeleteResponse deleteImpl(Status status,
                                         DeleteRequest request)
      • runQuery

        public QueryResult runQuery(Status status,
                                    Query query)
      • next

        public QueryResult next(Status status,
                                NextRequest request)
      • deleteCursor

        public VoidProto deleteCursor(Status status,
                                      Cursor request)
      • beginTransaction

        public Transaction beginTransaction(Status status,
                                            BeginTransactionRequest req)
      • commit

        public CommitResponse commit(Status status,
                                     Transaction req)
      • rollback

        public VoidProto rollback(Status status,
                                  Transaction req)
      • createIndex

        public Integer64Proto createIndex(Status status,
                                          CompositeIndex req)
      • updateIndex

        public VoidProto updateIndex(Status status,
                                     CompositeIndex req)
      • getIndices

        public CompositeIndices getIndices(Status status,
                                           StringProto req)
      • deleteIndex

        public VoidProto deleteIndex(Status status,
                                     CompositeIndex req)
      • allocateIds

        public AllocateIdsResponse allocateIds(Status status,
                                               AllocateIdsRequest req)
      • getDefaultDeadline

        public java.lang.Double getDefaultDeadline(boolean isOfflineRequest)
      • getMaximumDeadline

        public java.lang.Double getMaximumDeadline(boolean isOfflineRequest)
      • getCreationCostAnalysis

        public CreationCostAnalysis getCreationCostAnalysis(com.google.appengine.api.datastore.Entity e)
        Return a cost analysis of the operations required to create this entity.