GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AutoLoadCache/doc/lock.md at master · caowenyan/AutoLoadCache

Expand file tree

/

lock.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
18 lines (13 loc) · 1.34 KB
/

lock.md

Copy path

File metadata and controls

18 lines (13 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Edit and raw actions

分布式锁配置

为了支持在高并发,大集群环境使用,增加了分布式锁的。

现在只支持排它锁,还不支持重入锁。

需要开启分布式锁支持,需要做以下配置:

  1. 在@Cache注解中设置 lockExpire, 并且opType必须是CacheOpType.READ_WRITE。
  2. 需要往 CacheHandler 中的lock 属性注入ILock实例。 框架中已经内部已经基于Redis实现了一些分布式锁:
  • ILock
    • |-----AbstractRedisLock
      • |-----JedisClusterLock
      • |-----ShardedJedisLock
    • |-----AbstractRedisLockWithLua
      • |-----JedisClusterLockWithLua
      • |-----ShardedJedisLockWithLua
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.