Class IncrementalUidGenerator
java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.uid.UidGenerator
services.moleculer.uid.IncrementalUidGenerator
- All Implemented Interfaces:
MoleculerLifecycle
Fast
UidGenerator, based on nodeID and an atomic sequence number.
It's faster than the StandardUidGenerator.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicLongprotected char[]UID prefix (null = nodeID)Fields inherited from class MoleculerComponent
broker, logger, name -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class MoleculerComponent
getBroker, getLogger, getName, stopped
-
Field Details
-
prefix
protected char[] prefixUID prefix (null = nodeID) -
counter
-
-
Constructor Details
-
IncrementalUidGenerator
public IncrementalUidGenerator()
-
-
Method Details
-
started
Initializes UID generator instance.- Specified by:
startedin interfaceMoleculerLifecycle- Overrides:
startedin classMoleculerComponent- Parameters:
broker- parent ServiceBroker- Throws:
Exception
-
nextUID
- Specified by:
nextUIDin classUidGenerator
-
getPrefix
-
setPrefix
-