Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.


Stay organized with collections Save and categorize content based on your preferences.

Class LocalDatastoreServiceTestConfig

  • java.lang.Object
  • All Implemented Interfaces:

    public final class LocalDatastoreServiceTestConfig
    extends java.lang.Object
    implements LocalServiceTestConfig
    Config for accessing the local datastore service in tests. Default behavior is to configure the local datastore to only store data in-memory, to not write anything to disk, and for all jobs to apply on the first attempt (master/slave consistency model). tearDown() wipes out all in-memory state so that the datastore is empty at the end of every test.
    • Constructor Detail

      • LocalDatastoreServiceTestConfig

        public LocalDatastoreServiceTestConfig()
    • Method Detail

      • isNoStorage

        public boolean isNoStorage()
      • setNoStorage

        public LocalDatastoreServiceTestConfig setNoStorage(boolean noStorage)
        True to put the datastore into "memory-only" mode.
        noStorage -
        this (for chaining)
      • getMaxQueryLifetimeMs

        public java.lang.Integer getMaxQueryLifetimeMs()
      • setMaxQueryLifetimeMs

        public LocalDatastoreServiceTestConfig setMaxQueryLifetimeMs(int maxQueryLifetimeMs)
        Sets how long a query can stay "live" before we expire it.
        maxQueryLifetimeMs -
        this (for chaining)
      • getMaxTxnLifetimeMs

        public java.lang.Integer getMaxTxnLifetimeMs()
      • setMaxTxnLifetimeMs

        public LocalDatastoreServiceTestConfig setMaxTxnLifetimeMs(int maxTxnLifetimeMs)
        Sets how long a txn can stay "live" before we expire it.
        maxTxnLifetimeMs -
        this (for chaining)
      • getStoreDelayMs

        public java.lang.Integer getStoreDelayMs()
      • setStoreDelayMs

        public LocalDatastoreServiceTestConfig setStoreDelayMs(int storeDelayMs)
        Sets how long to wait before updating the persistent store. Only useful if isNoStorage() returns false.
        storeDelayMs -
        this (for chaining)
      • getBackingStoreLocation

        public java.lang.String getBackingStoreLocation()
      • setBackingStoreLocation

        public LocalDatastoreServiceTestConfig setBackingStoreLocation(java.lang.String backingStoreLocation)
        Where to read/store the datastore from/to.
        backingStoreLocation -
        this (for chaining)
      • isNoIndexAutoGen

        public boolean isNoIndexAutoGen()
      • setNoIndexAutoGen

        public LocalDatastoreServiceTestConfig setNoIndexAutoGen(boolean noIndexAutoGen)
        True to prevent the datastore from writing the auto-generated index file.
        noIndexAutoGen -
        this (for chaining)
      • getDefaultHighRepJobPolicyRandomSeed

        public java.lang.Long getDefaultHighRepJobPolicyRandomSeed()
      • getDefaultHighRepJobPolicyUnappliedJobPercentage

        public java.lang.Float getDefaultHighRepJobPolicyUnappliedJobPercentage()
      • setDefaultHighRepJobPolicyUnappliedJobPercentage

        public LocalDatastoreServiceTestConfig setDefaultHighRepJobPolicyUnappliedJobPercentage(float defaultHighRepJobPolicyUnappliedJobPercentage)
        The percentage of job application attempts that will fail. Must be >= 0 and <= 100. This validation is performed during the initialization of LocalDatastoreService, not in the setter, so it will not fail fast. In addition, any portion of the value beyond two decimal places will be truncated. This method cannot be used in combination with setAlternateHighRepJobPolicyClass(Class).
        defaultHighRepJobPolicyUnappliedJobPercentage - The percentage of job application attempts that should fail.
        this (for chaining)
        java.lang.IllegalArgumentException - If setAlternateHighRepJobPolicyClass(Class) has been called.
      • getAlternateHighRepJobPolicyClass

        public java.lang.Class<? extends HighRepJobPolicy> getAlternateHighRepJobPolicyClass()
      • setApplyAllHighRepJobPolicy

        public LocalDatastoreServiceTestConfig setApplyAllHighRepJobPolicy()
        Make the datastore a high-replication datastore, but with all jobs applying immediately (simplifies tests that use eventually-consistent queries).