Package org.redisson.api
Interface RIdGenerator
- All Superinterfaces:
RExpirable
,RExpirableAsync
,RIdGeneratorAsync
,RObject
,RObjectAsync
- All Known Implementing Classes:
RedissonIdGenerator
Id generator of
Long
type numbers.
Returns unique numbers but not monotonically increased.- Author:
- Nikita Koksharov
-
Method Summary
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RIdGeneratorAsync
nextIdAsync, tryInitAsync
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
tryInit
boolean tryInit(long value, long allocationSize) Initializes Id generator params.- Parameters:
value
- - initial valueallocationSize
- - values range allocation size- Returns:
true
if Id generator initializedfalse
if Id generator already initialized
-
nextId
long nextId()Returns next unique number but not monotonically increased- Returns:
- number
-