public final class ChronicleMapStatelessClientBuilder<K,V> extends Object implements ChronicleHashStatelessClientBuilder<ChronicleMapStatelessClientBuilder<K,V>,ChronicleMap<K,V>>, MapBuilder<ChronicleMapStatelessClientBuilder<K,V>>
| Modifier and Type | Method and Description |
|---|---|
ChronicleMap<K,V> |
create() |
static <K,V> ChronicleMap<K,V> |
createClientOf(InetSocketAddress serverAddress)
Equivalent of
ChronicleMapStatelessClientBuilder.<K, V>of(serverAddress).create(). |
ChronicleMapStatelessClientBuilder<K,V> |
name(String name) |
ChronicleMapStatelessClientBuilder<K,V> |
putReturnsNull(boolean putReturnsNull)
Configures if the maps created by this
MapBuilder should return null
instead of previous mapped values on ChornicleMap.put(key, value) calls. |
ChronicleMapStatelessClientBuilder<K,V> |
removeReturnsNull(boolean removeReturnsNull)
Configures if the maps created by this
MapBuilder should return null
instead of the last mapped value on ChronicleMap.remove(key) calls. |
ChronicleMapStatelessClientBuilder<K,V> |
tcpBufferSize(int tcpBufferSize) |
ChronicleMapStatelessClientBuilder<K,V> |
timeout(long timeout,
TimeUnit units) |
public static <K,V> ChronicleMap<K,V> createClientOf(InetSocketAddress serverAddress) throws IOException
ChronicleMapStatelessClientBuilder.<K, V>of(serverAddress).create().K - key type of the mapV - value type of the mapserverAddress - address of the server mapIOExceptionpublic ChronicleMapStatelessClientBuilder<K,V> putReturnsNull(boolean putReturnsNull)
MapBuilderMapBuilder should return null
instead of previous mapped values on ChornicleMap.put(key, value) calls.
Map.put() returns the previous value, functionality
which is rarely used but fairly cheap for simple in-process, on-heap implementations like
HashMap. But an off-heap collection has to create a new object and deserialize
the data from off-heap memory. A collection hiding remote queries over the network should
send the value back in addition to that. It's expensive for something you probably don't use.
By default, of cause, ChronicleMap conforms the general Map contract and
returns the previous mapped value on put() calls.
putReturnsNull in interface MapBuilder<ChronicleMapStatelessClientBuilder<K,V>>putReturnsNull - true if you want ChronicleMap.put() to not return the value that was replaced but
instead return nullMapBuilder with this configuration appliedMapBuilder.removeReturnsNull(boolean)public ChronicleMapStatelessClientBuilder<K,V> removeReturnsNull(boolean removeReturnsNull)
MapBuilderMapBuilder should return null
instead of the last mapped value on ChronicleMap.remove(key) calls.
Map.remove() returns the previous value, functionality which is
rarely used but fairly cheap for simple in-process, on-heap implementations like HashMap. But an off-heap collection has to create a new object and deserialize the data
from off-heap memory. A collection hiding remote queries over the network should send
the value back in addition to that. It's expensive for something you probably don't use.
By default, of cause, ChronicleMap conforms the general Map contract and
returns the mapped value on remove() calls.
removeReturnsNull in interface MapBuilder<ChronicleMapStatelessClientBuilder<K,V>>removeReturnsNull - true if you want ChronicleMap.remove() to not return the value of the removed entry
but instead return nullMapBuilder with this configuration appliedMapBuilder.putReturnsNull(boolean)public ChronicleMapStatelessClientBuilder<K,V> timeout(long timeout, TimeUnit units)
timeout in interface ChronicleHashStatelessClientBuilder<ChronicleMapStatelessClientBuilder<K,V>,ChronicleMap<K,V>>public ChronicleMapStatelessClientBuilder<K,V> name(String name)
name in interface ChronicleHashStatelessClientBuilder<ChronicleMapStatelessClientBuilder<K,V>,ChronicleMap<K,V>>public ChronicleMapStatelessClientBuilder<K,V> tcpBufferSize(int tcpBufferSize)
tcpBufferSize in interface ChronicleHashStatelessClientBuilder<ChronicleMapStatelessClientBuilder<K,V>,ChronicleMap<K,V>>public ChronicleMap<K,V> create() throws IOException
create in interface ChronicleHashStatelessClientBuilder<ChronicleMapStatelessClientBuilder<K,V>,ChronicleMap<K,V>>IOExceptionCopyright © 2015. All rights reserved.