类 AbstractCacheCreator

java.lang.Object
org.babyfish.jimmer.sql.cache.spi.AbstractCacheCreator
所有已实现的接口:
CacheCreator
直接已知子类:
RedisCacheCreator, RedisCacheCreator

public abstract class AbstractCacheCreator extends Object implements CacheCreator
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • withRemoteDuration

      @NewChain @NotNull public @NotNull CacheCreator withRemoteDuration(@Nullable @Nullable Duration duration, int randomPercent)
      从接口复制的说明: CacheCreator
      Set L2 cache expiration time.

      This method does not modify the current object, but creates a new object.

      指定者:
      withRemoteDuration 在接口中 CacheCreator
      参数:
      duration - The expiration time
      randomPercent - A random percent

      Batch loading is a frequently used optimization method in jimmer, so a batch of values are often put into the cache at the same time. If the expiration time of these cached data is the same, then in the future, some affected data will be discarded by the cache at the same time so that a big hole will appear in the defense of the cache, which is easy to be penetrated.

      To solve this problem, Jimmer supports a random factor that modifies the expiration time and then applies it to the L2 cache, ultimately making the expiration time of the data uneven.

      返回:
      The created new object
    • withLocalCache

      @NewChain @NotNull public @NotNull CacheCreator withLocalCache(int maximumSize, Duration duration)
      指定者:
      withLocalCache 在接口中 CacheCreator
    • withLock

      @NewChain @NotNull public @NotNull CacheCreator withLock(@Nullable @Nullable CacheLocker locker, @Nullable @Nullable Duration waitDuration, @Nullable @Nullable Duration leaseDuration)
      指定者:
      withLock 在接口中 CacheCreator
    • withTracking

      @NewChain @NotNull public @NotNull CacheCreator withTracking(@Nullable @Nullable CacheTracker tracker)
      指定者:
      withTracking 在接口中 CacheCreator
    • withMultiViewProperties

      @NewChain @NotNull public @NotNull CacheCreator withMultiViewProperties(@Nullable @Nullable Integer localMaximumSize, @Nullable @Nullable Duration localDuration, @Nullable @Nullable Duration remoteDuration)
      指定者:
      withMultiViewProperties 在接口中 CacheCreator
    • args

      protected final <A extends AbstractCacheCreator.Args> A args()
    • newArgs

      protected abstract AbstractCacheCreator.Args newArgs(AbstractCacheCreator.Cfg cfg)
    • newCacheCreator

      protected abstract CacheCreator newCacheCreator(AbstractCacheCreator.Cfg cfg)