1 Star 1 Fork 0

Seppiko Project / Leaf

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Seppiko Leaf

Introduction

Another Snowflake algorithm implement. A network service for generating unique ID numbers at high scale with some simple guarantees.

https://github.com/twitter/snowflake

If you need RESTful API.Please see Leaf-Gateway

How to start

You need to modify leaf.json for configure leaf server.

Use -Dleaf.configFile=leaf.json custom leaf.json file path.

Configuration

leaf.json

{
  "port": 9800,
  "timeOffset": 1577420144
}

timeOffset is an initial time offset,you can set it on you first time (Millisecond). You can use LeafTest.genTime generator it.

Compile and package

mvn clean
mvn protobuf:compile
mvn protobuf:compile-custom
mvn package

Example

This is gRPC service,please see example\Client.java for you.

Before you use Leaf Client,please copy src\main\proto\leaf.proto to you project, and run mvn protobuf:compile protobuf:compile-custom for generator related classes.

License

Licensed under of Apache License, Version 2.0

Sponsors

JetBrians

Comments ( 0 )

Sign in for post a comment

About

Snowflake算法的gRPC实现,用于ID生成的微服务软件。 spread retract
Java
Apache-2.0
Cancel

Leaf

Contributors

All

Activities

load more
can not load any more
Java
1
https://gitee.com/seppiko/leaf.git
git@gitee.com:seppiko/leaf.git
seppiko
leaf
Leaf
master

Search