Package org.redisson.api
Interface RSet<V>
-
- Type Parameters:
V
- value
- All Superinterfaces:
Collection<V>
,Iterable<V>
,RCollectionAsync<V>
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RSetAsync<V>
,RSortable<Set<V>>
,RSortableAsync<Set<V>>
,Set<V>
- All Known Implementing Classes:
RedissonSet
,RedissonSetMultimapValues
,RedissonTransactionalSet
public interface RSet<V> extends Set<V>, RExpirable, RSetAsync<V>, RSortable<Set<V>>
Distributed and concurrent implementation ofSet
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
diff(String... names)
Diff sets specified by name and write to current set.RLock
getLock(V value)
Returns lock instance associated withvalue
int
intersection(String... names)
Intersection sets specified by name and write to current set.Iterator<V>
iterator(int count)
Returns an iterator over elements in this set.Iterator<V>
iterator(String pattern)
Returns iterator over elements in this set matchespattern
.Iterator<V>
iterator(String pattern, int count)
Returns an iterator over elements in this set.<KOut,VOut>
RCollectionMapReduce<V,KOut,VOut>mapReduce()
ReturnsRMapReduce
object associated with this objectboolean
move(String destination, V member)
Move a member from this set to the given destination set in.V
random()
Returns random element from setSet<V>
random(int count)
Returns random elements from set limited bycount
Set<V>
readAll()
Read all elements at onceSet<V>
readDiff(String... names)
Diff sets specified by name with current set.Set<V>
readIntersection(String... names)
Intersection sets specified by name with current set without current set state change.Set<V>
readUnion(String... names)
Union sets specified by name with current set without current set state change.V
removeRandom()
Removes and returns random element from setSet<V>
removeRandom(int amount)
Removes and returns random elements from setint
union(String... names)
Union sets specified by name and write to current set.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
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, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RSetAsync
diffAsync, intersectionAsync, moveAsync, randomAsync, randomAsync, readAllAsync, readDiffAsync, readIntersectionAsync, readUnionAsync, removeRandomAsync, removeRandomAsync, 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
-
getLock
RLock getLock(V value)
Returns lock instance associated withvalue
- Parameters:
value
- - set value- Returns:
- lock
-
iterator
Iterator<V> iterator(int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
Iterator<V> iterator(String pattern, int count)
Returns an iterator over elements in this set. Elements are loaded in 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
Iterator<V> iterator(String pattern)
Returns iterator over elements in this set matchespattern
.- 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
Set<V> removeRandom(int amount)
Removes and returns random elements from set- Parameters:
amount
- of random values- Returns:
- random values
-
removeRandom
V removeRandom()
Removes and returns random element from set- Returns:
- value
-
random
V random()
Returns random element from set- Returns:
- value
-
random
Set<V> random(int count)
Returns random elements from set limited bycount
- Parameters:
count
- - values amount to return- Returns:
- value
-
move
boolean move(String 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
-
union
int union(String... 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
Set<V> readUnion(String... names)
Union sets specified by name with current set without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
diff
int diff(String... 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
Set<V> readDiff(String... names)
Diff sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
intersection
int intersection(String... 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
-
-