Package discord4j.store.chronicle
Class LongChronicleStore<V extends Serializable>
- java.lang.Object
-
- discord4j.store.chronicle.LongChronicleStore<V>
-
- All Implemented Interfaces:
LongObjStore<V>
,Store<Long,V>
public class LongChronicleStore<V extends Serializable> extends Object implements LongObjStore<V>
-
-
Constructor Summary
Constructors Constructor Description LongChronicleStore(Class<V> valueClass, boolean persist)
LongChronicleStore(Class<V> valueClass, File location)
LongChronicleStore(net.openhft.chronicle.map.ChronicleMap<net.openhft.chronicle.core.values.LongValue,V> mapInst)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
reactor.core.publisher.Mono<Long>
count()
Retrieves the amount of stored values in the data source currently.reactor.core.publisher.Mono<Void>
delete(long id)
Deletes a value associated with the provided id.reactor.core.publisher.Mono<Void>
delete(Publisher<Long> ids)
Deletes the values associated with the provided ids.reactor.core.publisher.Mono<Void>
deleteAll()
Deletes all entries in the data source.reactor.core.publisher.Mono<Void>
deleteInRange(long start, long end)
Deletes values within a range of ids.reactor.core.publisher.Mono<V>
find(long id)
Attempts to find the value associated with the provided id.reactor.core.publisher.Flux<V>
findInRange(long start, long end)
Retrieves all stored values with ids within a provided range.reactor.core.publisher.Mono<Void>
invalidate()
Invalidates the contents of the store.reactor.core.publisher.Flux<Long>
keys()
Gets a stream of all keys in the data source.reactor.core.publisher.Mono<Void>
saveWithLong(long key, V value)
Stores a key value pair.reactor.core.publisher.Mono<Void>
saveWithLong(Publisher<LongObjTuple2<V>> entryStream)
Stores key value pairs.reactor.core.publisher.Flux<V>
values()
Gets a stream of all values in the data source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface discord4j.store.api.primitive.LongObjStore
delete, deleteInRange, entries, find, findInRange, longObjEntries, save, save
-
-
-
-
Constructor Detail
-
LongChronicleStore
public LongChronicleStore(Class<V> valueClass, boolean persist) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException
-
LongChronicleStore
public LongChronicleStore(Class<V> valueClass, @Nullable File location) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException
-
LongChronicleStore
public LongChronicleStore(net.openhft.chronicle.map.ChronicleMap<net.openhft.chronicle.core.values.LongValue,V> mapInst)
-
-
Method Detail
-
saveWithLong
public reactor.core.publisher.Mono<Void> saveWithLong(long key, V value)
Description copied from interface:LongObjStore
Stores a key value pair.- Specified by:
saveWithLong
in interfaceLongObjStore<V extends Serializable>
- Parameters:
key
- The key representing the value.value
- The value.- Returns:
- A mono which signals the completion of the storage of the pair.
-
saveWithLong
public reactor.core.publisher.Mono<Void> saveWithLong(Publisher<LongObjTuple2<V>> entryStream)
Description copied from interface:LongObjStore
Stores key value pairs.- Specified by:
saveWithLong
in interfaceLongObjStore<V extends Serializable>
- Parameters:
entryStream
- A flux providing the key value pairs.- Returns:
- A mono which signals the completion of the storage of the pairs.
-
find
public reactor.core.publisher.Mono<V> find(long id)
Description copied from interface:LongObjStore
Attempts to find the value associated with the provided id.- Specified by:
find
in interfaceLongObjStore<V extends Serializable>
- Parameters:
id
- The id to search with.- Returns:
- A mono, which may or may not contain an associated object.
-
findInRange
public reactor.core.publisher.Flux<V> findInRange(long start, long end)
Description copied from interface:LongObjStore
Retrieves all stored values with ids within a provided range.- Specified by:
findInRange
in interfaceLongObjStore<V extends Serializable>
- Parameters:
start
- The starting key (inclusive).end
- The ending key (exclusive).- Returns:
- The stream of values with ids within the provided range.
-
count
public reactor.core.publisher.Mono<Long> count()
Description copied from interface:Store
Retrieves the amount of stored values in the data source currently.- Specified by:
count
in interfaceStore<Long,V extends Serializable>
- Returns:
- A mono which provides the amount of stored values.
-
delete
public reactor.core.publisher.Mono<Void> delete(long id)
Description copied from interface:LongObjStore
Deletes a value associated with the provided id.- Specified by:
delete
in interfaceLongObjStore<V extends Serializable>
- Parameters:
id
- The id of the value to delete.- Returns:
- A mono which signals the completion of the deletion of the value.
-
delete
public reactor.core.publisher.Mono<Void> delete(Publisher<Long> ids)
Description copied from interface:Store
Deletes the values associated with the provided ids.- Specified by:
delete
in interfaceLongObjStore<V extends Serializable>
- Specified by:
delete
in interfaceStore<Long,V extends Serializable>
- Parameters:
ids
- A stream of ids to delete values for.- Returns:
- A mono which signals the completion of the deletion of the values.
-
deleteAll
public reactor.core.publisher.Mono<Void> deleteAll()
Description copied from interface:Store
Deletes all entries in the data source.- Specified by:
deleteAll
in interfaceStore<Long,V extends Serializable>
- Returns:
- A mono which signals the completion of the deletion of all values.
-
keys
public reactor.core.publisher.Flux<Long> keys()
Description copied from interface:Store
Gets a stream of all keys in the data source.- Specified by:
keys
in interfaceStore<Long,V extends Serializable>
- Returns:
- The stream of keys stored.
-
values
public reactor.core.publisher.Flux<V> values()
Description copied from interface:Store
Gets a stream of all values in the data source.- Specified by:
values
in interfaceStore<Long,V extends Serializable>
- Returns:
- The stream of values stored.
-
deleteInRange
public reactor.core.publisher.Mono<Void> deleteInRange(long start, long end)
Description copied from interface:LongObjStore
Deletes values within a range of ids.- Specified by:
deleteInRange
in interfaceLongObjStore<V extends Serializable>
- Parameters:
start
- The starting key (inclusive).end
- The ending key (exclusive).- Returns:
- A mono which signals the completion of the deletion of values.
-
invalidate
public reactor.core.publisher.Mono<Void> invalidate()
Description copied from interface:Store
Invalidates the contents of the store. Once this is invoked, there is no longer a guarantee that the data in the store is reliable.- Specified by:
invalidate
in interfaceStore<Long,V extends Serializable>
- Returns:
- A mono which signals the completion of the invalidation of all values.
-
close
public void close()
-
-