public interface Sets
| Modifier and Type | Method and Description |
|---|---|
void |
add(String namespace,
String set,
Map<String,Long> entries)
Add batch of entries/weights to the set in the given namespace.
|
default void |
add(String namespace,
String set,
String entry)
Add an entry with weight of 0 to the set in the given namespace.
|
void |
add(String namespace,
String set,
String entry,
long weight)
Add an entry with a weight to the set in the given namespace.
|
void |
create(String namespace)
Create a new namespace.
|
default void |
delete(String namespace,
String set)
Deletes all entries in the set in the given namespace.
|
void |
delete(String namespace,
String set,
Collection<String> entries)
Delete batch of objects from set in the given namespace; no-op if an entry is not found.
|
void |
delete(String namespace,
String set,
long min,
long max)
Deletes all entries in the set with weights between the given min and max, in the given namespace.
|
boolean |
delete(String namespace,
String set,
String entry)
Deletes an entry from the set in the given namespace.
|
void |
drop(String namespace)
Drop a namespace.
|
default Collection<String> |
entries(String namespace,
String set)
Return object entries and weights stored in the set with start and count and weight more than min, less than max
|
default Collection<String> |
entries(String namespace,
String set,
int start,
int count)
Return object entries and weights stored in the set with start and count and weight more than min, less than max
|
default Collection<String> |
entries(String namespace,
String set,
int start,
int count,
boolean ascending)
Return object entries and weights stored in the set with start and count and weight more than min, less than max
|
Collection<String> |
entries(String namespace,
String set,
long min,
long max,
int start,
int count,
boolean ascending)
Return entries stored in the set with start and count and weight more than min, less than max.
|
default String |
first(String namespace,
String set)
Get the first entry in the set ordered ascending by weight.
|
default Map<String,Long> |
get(String namespace,
String set)
Return all entries stored in the set, ordered by weight ascending
|
default Map<String,Long> |
get(String namespace,
String set,
int start,
int count)
Return entries stored in the set with start and count, ordered by weight ascending
|
Map<String,Long> |
get(String namespace,
String set,
long min,
long max,
int start,
int count,
boolean ascending)
Return entries and weights stored in the set with start and count and weight more than min, less than max.
|
void |
inc(String namespace,
String set,
String entry,
long count)
Atomic operation to increment an entry's weight in the set by the given count.
|
default Map<String,Long> |
intersect(String namespace,
Collection<String> sets)
Return intersect of all entries stored in the given sets, ordered by weight ascending
|
default Map<String,Long> |
intersect(String namespace,
Collection<String> sets,
int start,
int count)
Return entries stored in the set with start and count, ordered by weight ascending
|
Map<String,Long> |
intersect(String namespace,
Collection<String> sets,
long min,
long max,
int start,
int count,
boolean ascending)
Return intersection of entries and weights stored in all of the given sets,
with start and count and weight more than min, less than max.
|
default String |
last(String namespace,
String set)
Get the last entry in the set ordered ascending by weight.
|
Collection<String> |
namespaces()
Get list of all namespaces.
|
default Map<String,Long> |
pop(String namespace,
String set)
Return and atomically remove all entries in the set
|
default Map<String,Long> |
pop(String namespace,
String set,
int start,
int count)
Return and atomically remove all entries in the set with start and count
|
Map<String,Long> |
pop(String namespace,
String set,
long min,
long max,
int start,
int count,
boolean ascending)
Return and atomically remove entries and weights stored in the set
with start and count and weight more than min, less than max.
|
Collection<String> |
sets(String namespace)
Returns list of all sets in the given namespace.
|
int |
size(String namespace,
String set)
Get the number of entries in the set.
|
default Map<String,Long> |
union(String namespace,
Collection<String> sets)
Return union of all entries stored in the given sets, ordered by weight ascending
|
default Map<String,Long> |
union(String namespace,
Collection<String> sets,
int start,
int count)
Return entries stored in the set with start and count, ordered by weight ascending
|
Map<String,Long> |
union(String namespace,
Collection<String> sets,
long min,
long max,
int start,
int count,
boolean ascending)
Return union of entries and weights stored in any of the given sets,
with start and count and weight more than min, less than max.
|
Long |
weight(String namespace,
String set,
String entry)
Returns an entry's weight in the set.
|
Collection<String> namespaces() throws IOException
IOException - exception thrown from the underlying storage implementationvoid create(String namespace) throws IOException
namespace - the namespace identifierIOException - exception thrown from the underlying storage implementationvoid drop(String namespace) throws IOException
namespace - the namespace identifierIOException - exception thrown from the underlying storage implementationvoid add(String namespace, String set, String entry, long weight) throws IOException
namespace - the namespaceset - name of the set to add the entry toentry - the entryweight - weight of the entry in the setIOException - exception thrown from the underlying storage implementationdefault void add(String namespace, String set, String entry) throws IOException
namespace - the namespaceset - name of the set to add the entry toentry - the entryIOException - exception thrown from the underlying storage implementationvoid add(String namespace, String set, Map<String,Long> entries) throws IOException
namespace - the namespaceset - name of the set to add the entry toentries - map of entries to weightsIOException - exception thrown from the underlying storage implementationCollection<String> entries(String namespace, String set, long min, long max, int start, int count, boolean ascending) throws IOException
namespace - the namespaceset - name of the sorted setmin - the minimum weightmax - the maximum weightstart - start offsetcount - maximum number of entries to returnascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Collection<String> entries(String namespace, String set, int start, int count, boolean ascending) throws IOException
namespace - the namespaceset - name of the sorted setstart - start offsetcount - maximum number of entries to returnascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Collection<String> entries(String namespace, String set, int start, int count) throws IOException
namespace - the namespaceset - name of the sorted setstart - start offsetcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationdefault Collection<String> entries(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationMap<String,Long> get(String namespace, String set, long min, long max, int start, int count, boolean ascending) throws IOException
namespace - the namespaceset - name of the sorted setmin - the minimum weightmax - the maximum weightstart - start offsetcount - maximum number of entries to return; -1 for infiniteascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> get(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> get(String namespace, String set, int start, int count) throws IOException
namespace - the namespaceset - name of the sorted setstart - start offsetcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationvoid delete(String namespace, String set, long min, long max) throws IOException
namespace - the namespaceset - name of the sorted setmin - the minimum weightmax - the maximum weightIOException - exception thrown from the underlying storage implementationdefault void delete(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationboolean delete(String namespace, String set, String entry) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationvoid delete(String namespace, String set, Collection<String> entries) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationMap<String,Long> union(String namespace, Collection<String> sets, long min, long max, int start, int count, boolean ascending) throws IOException
namespace - the namespacesets - name of the sorted sets to do union overmin - the minimum weightmax - the maximum weightstart - start offsetcount - maximum number of entries to return; -1 for infiniteascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> union(String namespace, Collection<String> sets) throws IOException
namespace - the namespacesets - name of the sorted sets to do union overIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> union(String namespace, Collection<String> sets, int start, int count) throws IOException
namespace - the namespacesets - name of the sorted sets to do union overstart - start offsetcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationMap<String,Long> intersect(String namespace, Collection<String> sets, long min, long max, int start, int count, boolean ascending) throws IOException
namespace - the namespacesets - name of the sorted sets to do intersection overmin - the minimum weightmax - the maximum weightstart - start offsetcount - maximum number of entries to return; -1 for infiniteascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> intersect(String namespace, Collection<String> sets) throws IOException
namespace - the namespacesets - name of the sorted sets to do intersect overIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> intersect(String namespace, Collection<String> sets, int start, int count) throws IOException
namespace - the namespacesets - name of the sorted sets to do intersect overstart - start offsetcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationMap<String,Long> pop(String namespace, String set, long min, long max, int start, int count, boolean ascending) throws IOException
namespace - the namespaceset - name of the sorted setmin - the minimum weightmax - the maximum weightstart - start offsetcount - maximum number of entries to return; -1 for infiniteascending - ordered ascending or descending by weightIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> pop(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationdefault Map<String,Long> pop(String namespace, String set, int start, int count) throws IOException
namespace - the namespaceset - name of the sorted setstart - start offsetcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationCollection<String> sets(String namespace) throws IOException
namespace - the namespaceIOException - exception thrown from the underlying storage implementationint size(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationdefault String first(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationdefault String last(String namespace, String set) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationLong weight(String namespace, String set, String entry) throws IOException
namespace - the namespaceset - name of the sorted setIOException - exception thrown from the underlying storage implementationvoid inc(String namespace, String set, String entry, long count) throws IOException
namespace - the namespaceset - name of the sorted setcount - maximum number of entries to returnIOException - exception thrown from the underlying storage implementationCopyright © 2019. All rights reserved.