K - The key typepublic interface IRegionProvider<K extends IKey<K>>
extends java.io.Flushable, java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
java.util.stream.Stream<java.util.Map.Entry<K,java.nio.ByteBuffer>> |
allEntries()
Gets a
Stream over all already saved entries. |
java.util.stream.Stream<K> |
allKeys()
Gets a
Stream over all already saved keys. |
java.util.stream.Stream<RegionKey> |
allRegions()
Gets a
Stream over the keys of all the existing regions. |
void |
forExistingRegion(K key,
CheckedConsumer<? super IRegion<K>,java.io.IOException> consumer)
Calls the given function with region at that location and returns value from that function..
|
void |
forRegion(K key,
CheckedConsumer<? super IRegion<K>,java.io.IOException> consumer)
Calls the given consumer with region at that location.
|
<R> java.util.Optional<R> |
fromExistingRegion(K key,
CheckedFunction<? super IRegion<K>,R,java.io.IOException> func)
Calls the given consumer with region at that location.
|
<R> R |
fromRegion(K key,
CheckedFunction<? super IRegion<K>,R,java.io.IOException> func)
Calls the given function with region at that location and returns value from that function.
|
void forRegion(K key, CheckedConsumer<? super IRegion<K>,java.io.IOException> consumer) throws java.io.IOException
key - The key for the IRegionconsumer - Consumer that accepts the IRegionjava.io.IOException<R> java.util.Optional<R> fromExistingRegion(K key, CheckedFunction<? super IRegion<K>,R,java.io.IOException> func) throws java.io.IOException
key - The key for the IRegionregionKey if it existsjava.io.IOException<R> R fromRegion(K key, CheckedFunction<? super IRegion<K>,R,java.io.IOException> func) throws java.io.IOException
key - The key for the IRegionjava.io.IOExceptionvoid forExistingRegion(K key, CheckedConsumer<? super IRegion<K>,java.io.IOException> consumer) throws java.io.IOException
key - The key for the IRegionconsumer - Accepts the given region, if it already existsjava.io.IOExceptionjava.util.stream.Stream<RegionKey> allRegions() throws java.io.IOException
Stream over the keys of all the existing regions.
All regions that had been created at the time of this method invocation are guaranteed to be present in the returned Stream, no guarantees
are made for regions created during iteration.
The returned Stream should be closed (using BaseStream.close()) once no longer needed to avoid potential
resource leaks. If not closed, any resources allocated by the Stream may not be freed until the Stream
instance is garbage-collected.
Stream over the keys of all the existing regionsjava.io.IOExceptionjava.util.stream.Stream<K> allKeys() throws java.io.IOException
Stream over all already saved keys.
Keys saved while the Stream is being evaluated are not guaranteed to be listed.
The returned Stream should be closed (using BaseStream.close()) once no longer needed to avoid potential
resource leaks. If not closed, any resources allocated by the Stream may not be freed until the Stream
instance is garbage-collected.
Stream over all already saved keysjava.io.IOExceptionjava.util.stream.Stream<java.util.Map.Entry<K,java.nio.ByteBuffer>> allEntries() throws java.io.IOException
Stream over all already saved entries.
Entries saved while the Stream is being evaluated are not guaranteed to be listed.
The returned Stream should be closed (using BaseStream.close()) once no longer needed to avoid potential
resource leaks. If not closed, any resources allocated by the Stream may not be freed until the Stream
instance is garbage-collected.
Stream over all already saved entriesjava.io.IOException