public class SharedHashMapBuilder<K,V> extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static short |
FILE_REPLICATION_MODIFICATION_ITERATOR_ID |
static short |
JDBC_REPLICATION_MODIFICATION_ITERATOR_ID |
static short |
UDP_REPLICATION_MODIFICATION_ITERATOR_ID |
Constructor and Description |
---|
SharedHashMapBuilder() |
SharedHashMapBuilder(Class<K> kClass,
Class<V> vClass) |
Modifier and Type | Method and Description |
---|---|
int |
actualEntriesPerSegment() |
SharedHashMapBuilder<K,V> |
actualEntriesPerSegment(int actualEntriesPerSegment) |
int |
actualSegments() |
SharedHashMapBuilder<K,V> |
actualSegments(int actualSegments) |
net.openhft.lang.io.serialization.BytesMarshallerFactory |
bytesMarshallerFactory() |
SharedHashMapBuilder |
bytesMarshallerFactory(net.openhft.lang.io.serialization.BytesMarshallerFactory bytesMarshallerFactory) |
boolean |
canReplicate() |
SharedHashMapBuilder |
canReplicate(boolean canReplicate) |
SharedHashMapBuilder<K,V> |
clone() |
ChronicleMap<K,V> |
create() |
<K,V> ChronicleMap<K,V> |
create(File file,
Class<K> kClass,
Class<V> vClass)
Deprecated.
|
long |
entries() |
SharedHashMapBuilder<K,V> |
entries(long entries) |
net.openhft.collections.Alignment |
entryAndValueAlignment()
Returns alignment of addresses in memory of entries and independently of values within entries.
|
SharedHashMapBuilder<K,V> |
entryAndValueAlignment(net.openhft.collections.Alignment alignment)
Specifies alignment of address in memory of entries and independently of address in memory of values
within entries.
|
int |
entrySize() |
SharedHashMapBuilder |
entrySize(int entrySize)
Note that the actual entrySize will be aligned to 4 (default entry alignment).
|
boolean |
equals(Object o) |
net.openhft.collections.SharedMapErrorListener |
errorListener() |
SharedHashMapBuilder |
errorListener(net.openhft.collections.SharedMapErrorListener errorListener) |
net.openhft.collections.SharedMapEventListener |
eventListener() |
SharedHashMapBuilder |
eventListener(net.openhft.collections.SharedMapEventListener eventListener) |
File |
file() |
SharedHashMapBuilder<K,V> |
file(File file) |
boolean |
generatedKeyType() |
SharedHashMapBuilder |
generatedKeyType(boolean generatedKeyType) |
boolean |
generatedValueType() |
SharedHashMapBuilder |
generatedValueType(boolean generatedValueType) |
int |
hashCode() |
byte |
identifier() |
SharedHashMapBuilder |
identifier(byte identifier) |
<K> Class<K> |
kClass() |
SharedHashMapBuilder |
kClass(Class kClass) |
boolean |
largeSegments() |
SharedHashMapBuilder |
largeSegments(boolean largeSegments) |
long |
lockTimeOutMS() |
SharedHashMapBuilder |
lockTimeOutMS(long lockTimeOutMS) |
int |
metaDataBytes() |
SharedHashMapBuilder |
metaDataBytes(int metaDataBytes) |
int |
minSegments() |
SharedHashMapBuilder |
minSegments(int minSegments)
Set minimum number of segments.
|
net.openhft.lang.io.serialization.ObjectSerializer |
objectSerializer() |
SharedHashMapBuilder |
objectSerializer(net.openhft.lang.io.serialization.ObjectSerializer objectSerializer) |
static <K,V> SharedHashMapBuilder<K,V> |
of(Class<K> kClass,
Class<V> vClass) |
boolean |
putReturnsNull()
Map.put() returns the previous value, functionality which is rarely used but fairly cheap for HashMap.
|
SharedHashMapBuilder |
putReturnsNull(boolean putReturnsNull)
Map.put() returns the previous value, functionality which is rarely used but fairly cheap for HashMap.
|
boolean |
removeReturnsNull()
Map.remove() returns the previous value, functionality which is rarely used but fairly cheap for
HashMap.
|
SharedHashMapBuilder |
removeReturnsNull(boolean removeReturnsNull)
Map.remove() returns the previous value, functionality which is rarely used but fairly cheap for
HashMap.
|
int |
replicas() |
SharedHashMapBuilder<K,V> |
replicas(int replicas) |
net.openhft.collections.TcpReplicatorBuilder |
tcpReplicatorBuilder() |
SharedHashMapBuilder |
tcpReplicatorBuilder(net.openhft.collections.TcpReplicatorBuilder tcpReplicatorBuilder) |
net.openhft.collections.TimeProvider |
timeProvider() |
SharedHashMapBuilder |
timeProvider(net.openhft.collections.TimeProvider timeProvider) |
String |
toString() |
boolean |
transactional() |
SharedHashMapBuilder<K,V> |
transactional(boolean transactional)
Not supported yet.
|
net.openhft.collections.UdpReplicatorBuilder |
udpReplicatorBuilder() |
SharedHashMapBuilder |
udpReplicatorBuilder(net.openhft.collections.UdpReplicatorBuilder udpReplicatorBuilder) |
<V> Class<V> |
vClass() |
SharedHashMapBuilder |
vClass(Class vClass) |
public static final short UDP_REPLICATION_MODIFICATION_ITERATOR_ID
public static final short JDBC_REPLICATION_MODIFICATION_ITERATOR_ID
public static final short FILE_REPLICATION_MODIFICATION_ITERATOR_ID
public static <K,V> SharedHashMapBuilder<K,V> of(Class<K> kClass, Class<V> vClass)
public SharedHashMapBuilder<K,V> clone()
public SharedHashMapBuilder minSegments(int minSegments)
ConcurrentHashMap
.public int minSegments()
public SharedHashMapBuilder entrySize(int entrySize)
Note that the actual entrySize will be aligned to 4 (default entry alignment). I. e. if you set
entry size to 30, the actual entry size will be 32 (30 aligned to 4 bytes). If you don't want entry
size to be aligned, set entryAndValueAlignment(Alignment.NO_ALIGNMENT)
.
entrySize
- the size in bytesSharedHashMapBuilder
backentryAndValueAlignment(Alignment)
,
entryAndValueAlignment()
public int entrySize()
public SharedHashMapBuilder<K,V> entryAndValueAlignment(net.openhft.collections.Alignment alignment)
Useful when values of the map are updated intensively, particularly fields with volatile access, because it doesn't work well if the value crosses cache lines. Also, on some (nowadays rare) architectures any misaligned memory access is more expensive than aligned.
Note that
specified entrySize()
will be aligned according to this alignment. I. e. if you set entrySize(20)
and Alignment.OF_8_BYTES
, actual entry size will be 24
(20 aligned to 8 bytes).
SharedHashMapBuilder
backentryAndValueAlignment()
public net.openhft.collections.Alignment entryAndValueAlignment()
Default is Alignment.OF_4_BYTES
.
entryAndValueAlignment(Alignment)
public SharedHashMapBuilder<K,V> entries(long entries)
public long entries()
public SharedHashMapBuilder<K,V> replicas(int replicas)
public int replicas()
public SharedHashMapBuilder<K,V> actualEntriesPerSegment(int actualEntriesPerSegment)
public int actualEntriesPerSegment()
public SharedHashMapBuilder<K,V> actualSegments(int actualSegments)
public int actualSegments()
public SharedHashMapBuilder<K,V> transactional(boolean transactional)
transactional
- if the built map should be transactionalSharedHashMapBuilder
backpublic boolean transactional()
public SharedHashMapBuilder kClass(Class kClass)
public SharedHashMapBuilder vClass(Class vClass)
public SharedHashMapBuilder<K,V> file(File file)
public File file()
public <K> Class<K> kClass()
public <V> Class<V> vClass()
public ChronicleMap<K,V> create() throws IOException
IOException
@Deprecated public <K,V> ChronicleMap<K,V> create(File file, Class<K> kClass, Class<V> vClass) throws IOException
IOException
public SharedHashMapBuilder lockTimeOutMS(long lockTimeOutMS)
public long lockTimeOutMS()
public SharedHashMapBuilder errorListener(net.openhft.collections.SharedMapErrorListener errorListener)
public net.openhft.collections.SharedMapErrorListener errorListener()
public SharedHashMapBuilder putReturnsNull(boolean putReturnsNull)
putReturnsNull
- false if you want SharedHashMap.put() to not return the object that was replaced
but instead return nullpublic boolean putReturnsNull()
public SharedHashMapBuilder removeReturnsNull(boolean removeReturnsNull)
removeReturnsNull
- false if you want SharedHashMap.remove() to not return the object that was
removed but instead return nullpublic boolean removeReturnsNull()
public boolean generatedKeyType()
public SharedHashMapBuilder generatedKeyType(boolean generatedKeyType)
public boolean generatedValueType()
public SharedHashMapBuilder generatedValueType(boolean generatedValueType)
public boolean largeSegments()
public SharedHashMapBuilder largeSegments(boolean largeSegments)
public SharedHashMapBuilder metaDataBytes(int metaDataBytes)
public int metaDataBytes()
public SharedHashMapBuilder eventListener(net.openhft.collections.SharedMapEventListener eventListener)
public net.openhft.collections.SharedMapEventListener eventListener()
public boolean canReplicate()
public SharedHashMapBuilder canReplicate(boolean canReplicate)
public SharedHashMapBuilder timeProvider(net.openhft.collections.TimeProvider timeProvider)
public net.openhft.collections.TimeProvider timeProvider()
public byte identifier()
public SharedHashMapBuilder identifier(byte identifier)
public SharedHashMapBuilder tcpReplicatorBuilder(net.openhft.collections.TcpReplicatorBuilder tcpReplicatorBuilder)
public net.openhft.collections.TcpReplicatorBuilder tcpReplicatorBuilder()
public net.openhft.collections.UdpReplicatorBuilder udpReplicatorBuilder()
public SharedHashMapBuilder udpReplicatorBuilder(net.openhft.collections.UdpReplicatorBuilder udpReplicatorBuilder)
public net.openhft.lang.io.serialization.BytesMarshallerFactory bytesMarshallerFactory()
public SharedHashMapBuilder bytesMarshallerFactory(net.openhft.lang.io.serialization.BytesMarshallerFactory bytesMarshallerFactory)
public net.openhft.lang.io.serialization.ObjectSerializer objectSerializer()
public SharedHashMapBuilder objectSerializer(net.openhft.lang.io.serialization.ObjectSerializer objectSerializer)
Copyright © 2014. All rights reserved.