Package org.redisson.api
Interface RSet<V>
-
- Type Parameters:
V
- type of value
- All Superinterfaces:
<V>
,<V>
,<V>>
,<V>>
,<V>
- All Known Implementing Classes:
RedissonSet
,RedissonSetMultimapValues
,RedissonTransactionalSet
public interface RSet<V> extends <V>, <V>>
Redis based implementation of- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
... names)
Diff sets specified by name and write to current set.RCountDownLatch
getCountDownLatch(V value)
ReturnsRCountDownLatch
instance associated withvalue
RLock
getFairLock(V value)
ReturnsRLock
instance associated withvalue
RLock
getLock(V value)
Returns lock instance associated withvalue
RPermitExpirableSemaphore
getPermitExpirableSemaphore(V value)
ReturnsRPermitExpirableSemaphore
instance associated withvalue
RReadWriteLock
getReadWriteLock(V value)
ReturnsRReadWriteLock
instance associated withvalue
RSemaphore
getSemaphore(V value)
ReturnsRSemaphore
instance associated withvalue
int
... names)
Intersection sets specified by name and write to current set.<V>
iterator(int count)
Returns elements iterator fetches elements in a batch.<V>
pattern)
Returns elements iterator.<V>
pattern, int count)
Returns elements iterator fetches elements in a batch.<KOut,VOut>
RCollectionMapReduce<V,KOut,VOut>mapReduce()
ReturnsRMapReduce
object associated with this objectboolean
destination, V member)
Move a member from this set to the given destination set in.V
random()
Returns random element<V>
random(int count)
Returns random elements from set limited bycount
<V>
readAll()
Read all elements at once<V>
... names)
Diff sets specified by name with current set.<V>
... names)
Intersection sets specified by name with current set without current set state change.<V>
... names)
Union sets specified by name with current set without current set state change.V
removeRandom()
Removes and returns random element<V>
removeRandom(int amount)
Removes and returns random elements limited byamount
<V>
stream(int count)
Returns stream of elements fetches elements in a batch.<V>
pattern)
Returns stream of elements.<V>
pattern, int count)
Returns stream of elements fetches elements in a batch.boolean
tryAdd(V... values)
Tries to add elements only if none of them in set.int
... names)
Union sets specified by name and write to current set.-
Methods inherited from interface org.redisson.api.RCollectionAsync
addAllAsync, addAsync, containsAllAsync, containsAsync, removeAllAsync, removeAsync, retainAllAsync, sizeAsync
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
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
-
Methods inherited from interface org.redisson.api.RSetAsync
diffAsync, intersectionAsync, moveAsync, randomAsync, randomAsync, readAllAsync, readDiffAsync, readIntersectionAsync, readUnionAsync, removeRandomAsync, removeRandomAsync, tryAddAsync, unionAsync
-
Methods inherited from interface org.redisson.api.RSortable
readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
Methods inherited from interface org.redisson.api.RSortableAsync
readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
-
-
-
-
Method Detail
-
getCountDownLatch
RCountDownLatch getCountDownLatch(V value)
ReturnsRCountDownLatch
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RCountDownLatch object
-
getPermitExpirableSemaphore
RPermitExpirableSemaphore getPermitExpirableSemaphore(V value)
ReturnsRPermitExpirableSemaphore
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RPermitExpirableSemaphore object
-
getSemaphore
RSemaphore getSemaphore(V value)
ReturnsRSemaphore
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RSemaphore object
-
getFairLock
RLock getFairLock(V value)
ReturnsRLock
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RLock object
-
getReadWriteLock
RReadWriteLock getReadWriteLock(V value)
ReturnsRReadWriteLock
instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RReadWriteLock object
-
getLock
RLock getLock(V value)
Returns lock instance associated withvalue
- Parameters:
value
- - set value- Returns:
- RLock object
-
stream
<V> stream(int count)
Returns stream of elements fetches elements in a batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- stream of elements
-
stream
< pattern, int count)
Returns stream of elements fetches elements in a batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- stream of elements
-
stream
< pattern)
Returns stream of elements. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search pattern- Returns:
- stream of elements
-
iterator
<V> iterator(int count)
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
< pattern, int count)
Returns elements iterator fetches elements in a batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- iterator
-
iterator
< pattern)
Returns elements iterator. Ifpattern
is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search pattern- Returns:
- iterator
-
mapReduce
<KOut,VOut> RCollectionMapReduce<V,KOut,VOut> mapReduce()
ReturnsRMapReduce
object associated with this object- Type Parameters:
KOut
- output keyVOut
- output value- Returns:
- MapReduce instance
-
removeRandom
<V> removeRandom(int amount)
Removes and returns random elements limited byamount
- Parameters:
amount
- of random elements- Returns:
- random elements
-
removeRandom
V removeRandom()
Removes and returns random element- Returns:
- random element
-
random
V random()
Returns random element- Returns:
- random element
-
random
<V> random(int count)
Returns random elements from set limited bycount
- Parameters:
count
- - values amount to return- Returns:
- random elements
-
move
boolean move( destination, V member)
Move a member from this set to the given destination set in.- Parameters:
destination
- the destination setmember
- the member to move- Returns:
- true if the element is moved, false if the element is not a member of this set or no operation was performed
-
readAll
<V> readAll()
Read all elements at once- Returns:
- values
-
union
int union(... names)
Union sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of union
-
readUnion
<... names)
Union sets specified by name with current set without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
diff
int diff(... names)
Diff sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- values
-
readDiff
<... names)
Diff sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
intersection
int intersection(... names)
Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of intersection
-
readIntersection
<... names)
Intersection sets specified by name with current set without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
tryAdd
boolean tryAdd(V... values)
Tries to add elements only if none of them in set.- Parameters:
values
- - values to add- Returns:
true
if elements successfully added, otherwisefalse
.
-
-