Code Monkey home page Code Monkey logo

dml's Introduction

基于redis,zookeeper实现分布式锁

1.铺垫

countDownLatch的使用[CountDownLatchTest.java]
zookeeper客户端操作zk节点及watcher事件机制[SimpleOperationDemo.java]
curator对客户端的封装demo演示[CuratorCRUD.java]

2.zk原生客户端实现分布式锁

代码[OriginZKlock.java]
分布式锁测试[ZKTest.java]

3.使用curator完成可重入分布式互斥锁(InterProcessMutex)

代码[CuratorLock.java]

4.redis的java客户端实现分布式锁

核心redis方法 setnx(key,val)
代码[DLock.java]
测试[DLockTest.java]

5.Redisson框架实现分布式可重入互斥锁

代码[Redission.java]、[RedissionLock.java]
测试[RedissionLockTest]

dml's People

Contributors

huanghaiheart avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.