https://github.com/shihuili1218/klein
🔥 Klein is a Paxos based distributed collection tool library, including distributed ArrayList, distributed HashMap, distributed Cache, distributed Lock, etc..
https://github.com/shihuili1218/klein
algorithms cache consensus distributed distributed-systems paxos raft
Last synced: 16 days ago
JSON representation
🔥 Klein is a Paxos based distributed collection tool library, including distributed ArrayList, distributed HashMap, distributed Cache, distributed Lock, etc..
- Host: GitHub
- URL: https://github.com/shihuili1218/klein
- Owner: shihuili1218
- License: apache-2.0
- Created: 2022-10-18T12:05:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T08:05:04.000Z (about 1 year ago)
- Last Synced: 2024-04-12T15:24:01.884Z (about 1 year ago)
- Topics: algorithms, cache, consensus, distributed, distributed-systems, paxos, raft
- Language: Java
- Homepage:
- Size: 1.16 MB
- Stars: 247
- Watchers: 4
- Forks: 15
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
### [中文](readme_zh_cn.md)
Thanks to JetBrains for the free license.
Open source: Gitee | Github | CodeChina
Document: Gitbook# Introduce
Klein is a distributed collection tool library based on Paxos, including distributed Cache, distributed message queue, distributed List, distributed Map, distributed Lock and so on. What's interesting about this is that you can keep data consistent across members without relying on any middleware.
You can understand that Klein is a distributed tool that depends on your project through Maven. We hope it will replace your existing Redis, messaging middleware, registry, configuration center, etc.
If you are interested in distributed message queue, distributed List, distributed Map, distributed Lock, we can share the existing design, you can participate in the coding work. 😆 😆 😆
**Look forward to your star⭐**
# Quick Start
### dependence klein
```xmlcom.ofcoder.klein.core
klein-core
{last-version}```
### startup
```
Klein instance = Klein.startup();
instance.awaitInit();KleinCache klein = KleinFactory.getInstance().createCache("klein");
klein.put("hello", "klein");KleinCache lock = KleinFactory.getInstance().createLock("klein");
cache.acquire(1, TimeUnit.SECONDS);
```
### set property
For all configurable parameters, see: `com.ofcoder.klein.KleinProp`You can set it through `System#setProperty` or get the `KleinProp` object
```
System.setProperty("klein.id", "2")// or
KleinProp prop = KleinProp.loadIfPresent();
```# Jepsen Test
[Run on Gitpod](https://gitpod.io/#/github.com/shihuili1218/klein)