Package me.ahoo.cosid.cosid
Interface CosIdGenerator
- All Superinterfaces:
IdGenerator
,Statistical
,StringIdGenerator
- All Known Implementing Classes:
ClockSyncCosIdGenerator
,Radix36CosIdGenerator
,Radix62CosIdGenerator
,RadixCosIdGenerator
CosIdGenerator algorithm ID generator.
-
Method Summary
Modifier and TypeMethodDescriptiondefault long
generate()
Generate distributed ID.default String
Generate string type distributed ID.long
int
default IdConverter
ID converter, used to convertlong
type ID toString
.default IdGeneratorStat
stat()
-
Method Details
-
getMachineId
int getMachineId() -
getLastTimestamp
long getLastTimestamp() -
getStateParser
-
idConverter
Description copied from interface:IdGenerator
ID converter, used to convertlong
type ID toString
.- Specified by:
idConverter
in interfaceIdGenerator
- Returns:
- ID converter
-
generate
default long generate()Description copied from interface:IdGenerator
Generate distributed ID.- Specified by:
generate
in interfaceIdGenerator
- Returns:
- generated distributed ID
-
generateAsState
-
generateAsString
Description copied from interface:StringIdGenerator
Generate string type distributed ID.- Specified by:
generateAsString
in interfaceIdGenerator
- Specified by:
generateAsString
in interfaceStringIdGenerator
- Returns:
- string type distributed ID
-
stat
- Specified by:
stat
in interfaceIdGenerator
- Specified by:
stat
in interfaceStatistical
-