diff --git a/doc/eight-byte-id-structure.md b/doc/eight-byte-id-structure.md index 0844edc..96f01c5 100644 --- a/doc/eight-byte-id-structure.md +++ b/doc/eight-byte-id-structure.md @@ -5,14 +5,14 @@ The eight byte IDs generated by the `LocalUniqueIDGenerator` and `SynchronizedUniqueIDGenerator` classes conform to the following structure: ``` -TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTSSSSSS ...MGGGG GGGGCCCC +TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTSSSSSS GGGMGGGG GGGGCCCC | | | || | v | | |\ | | v \ \ | Date of ID creation, measured in milliseconds | \ \ | -ellapsed since 1970-01-01T00:00:00.000, | Reserved \ \ | -represented in reverse byte-order (in SPREAD | for future | | | -mode) to guarantee an even spread of IDs. | use. | | | +ellapsed since 1970-01-01T00:00:00.000, | Generator \ \ | +represented in reverse byte-order (in SPREAD | ID, see | | | +mode) to guarantee an even spread of IDs. | below. | | | | | | | v | | | | | | @@ -27,13 +27,13 @@ mode) to guarantee an even spread of IDs. | use. | | | v | | Generator ID, manually assigned, or acquired | - through negotiation via a ZooKeeper-quorum. | - | + through negotiation via Etcd. Limited to 2048 | + per Cluster ID. | v Cluster ID. Always manually assigned or statically configured. Limited to - 16 (actieve) clusters. + 16 (active) clusters. ``` This approach offers a few useful features: diff --git a/pom.xml b/pom.xml index a0cd353..e7bb4ed 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.lable.oss.uniqueid uniqueid - 3.2-SNAPSHOT + 3.3-SNAPSHOT pom UniqueID @@ -45,12 +45,12 @@ 1.8 2.9-beta4 - 3.4.6 + 3.7.2 0.4.1 1.7.21 - 2.7 + 2.17.1 1.0 diff --git a/uniqueid-core/pom.xml b/uniqueid-core/pom.xml index 8072009..b9d2b78 100644 --- a/uniqueid-core/pom.xml +++ b/uniqueid-core/pom.xml @@ -20,7 +20,7 @@ uniqueid org.lable.oss.uniqueid - 3.2-SNAPSHOT + 3.3-SNAPSHOT 4.0.0 diff --git a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java index 739fb9a..4ac9bc9 100644 --- a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java +++ b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/AutoRefillStack.java @@ -15,7 +15,6 @@ */ package org.lable.oss.uniqueid; -import javax.annotation.PreDestroy; import java.io.IOException; import java.util.ArrayDeque; import java.util.Deque; @@ -63,7 +62,6 @@ public static IDGenerator decorate(IDGenerator generator, int batchSize) { return new AutoRefillStack(generator, batchSize); } - @PreDestroy @Override public void close() throws IOException { generator.close(); diff --git a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java index 8450a2c..fb1232b 100644 --- a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java +++ b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/LocalUniqueIDGeneratorFactory.java @@ -37,7 +37,7 @@ public class LocalUniqueIDGeneratorFactory { * Return the UniqueIDGenerator instance for this specific generator-ID, cluster-ID combination. If one was * already created, that is returned. * - * @param generatorId Generator ID to use (0 ≤ n ≤ 255). + * @param generatorId Generator ID to use (0 ≤ n ≤ 2047). * @param clusterId Cluster ID to use (0 ≤ n ≤ 15). * @param clock Clock implementation. * @param mode Generator mode. @@ -58,7 +58,7 @@ public synchronized static IDGenerator generatorFor(int generatorId, int cluster * Return the UniqueIDGenerator instance for this specific generator-ID, cluster-ID combination. If one was * already created, that is returned. * - * @param generatorId Generator ID to use (0 ≤ n ≤ 255). + * @param generatorId Generator ID to use (0 ≤ n ≤ 2047). * @param clusterId Cluster ID to use (0 ≤ n ≤ 15). * @param mode Generator mode. * @return A thread-safe UniqueIDGenerator instance. diff --git a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/Blueprint.java b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/Blueprint.java index 922fed2..b35f65f 100644 --- a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/Blueprint.java +++ b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/Blueprint.java @@ -34,7 +34,7 @@ public class Blueprint { /** * Upper bound (inclusive) of the generator-ID. */ - public final static int MAX_GENERATOR_ID = 255; + public final static int MAX_GENERATOR_ID = 2047; /** * Upper bound (inclusive) of the cluster-ID. diff --git a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java index b554da2..2f6b01a 100644 --- a/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java +++ b/uniqueid-core/src/main/java/org/lable/oss/uniqueid/bytes/IDBuilder.java @@ -24,7 +24,7 @@ *

* The eight byte ID is composed as follows: * - *

TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTSSSSSS ...MGGGG GGGGCCCC
+ *
TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT TTSSSSSS GGGMGGGG GGGGCCCC
* *