mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Merge remote-tracking branch 'origin/doco_refresh' into doco_refresh
# Conflicts: # ReadMe.adoc # docs/CM_Download.adoc # docs/CM_Features.adoc # docs/CM_Replication.adoc
This commit is contained in:
+24
@@ -1,12 +1,19 @@
|
||||
= Chronicle Map
|
||||
|
||||
<<<<<<< HEAD
|
||||
Chronicle Map is a super-fast, in-memory, key-value store, designed for low-latency, and/or multi-process applications such as trading and financial market applications.
|
||||
|
||||
=======
|
||||
Chronicle Map is a super-fast, in-memory, non-blocking, key-value store, designed for low-latency, and/or multi-process
|
||||
applications such as trading and financial market applications.
|
||||
See <<docs/CM_Features.adoc#,Features doc>> for more information.
|
||||
>>>>>>> origin/doco_refresh
|
||||
|
||||
The size of a Chronicle Map is not limited by memory (RAM), but rather by the available disk capacity.
|
||||
|
||||
image::docs\images\CM_Overview.jpg[]
|
||||
|
||||
<<<<<<< HEAD
|
||||
== Prerequisites
|
||||
|
||||
To run Chronicle Map, please ensure you have first installed:
|
||||
@@ -14,6 +21,8 @@ To run Chronicle Map, please ensure you have first installed:
|
||||
* Java (1.8.0_91 or later)
|
||||
* Apache Maven (3.2.3 or later)
|
||||
|
||||
=======
|
||||
>>>>>>> origin/doco_refresh
|
||||
=== Use cases
|
||||
Chronicle Map is used in production around the
|
||||
world for:
|
||||
@@ -29,11 +38,21 @@ distributed across multiple machines.
|
||||
Chronicle Map is:
|
||||
|
||||
• **fast**. Millions of operations per second, with
|
||||
<<<<<<< HEAD
|
||||
low and stable microsecond latencies.
|
||||
• **reliable**. Chronicle Software have a “chaos
|
||||
monkey” test which verifies Chronicle Map
|
||||
multi-master replication in the face of node
|
||||
and network failures.
|
||||
=======
|
||||
low and stable microsecond latencies for reads and writes. Write queries scale well up
|
||||
to the number of hardware execution threads in the server. Read queries never block each
|
||||
other.
|
||||
• **reliable**. Chronicle Software have a “chaos
|
||||
monkey” test which verifies Chronicle Map
|
||||
multi-master replication in the face of node
|
||||
and network failures. The map can optionally be persisted to disk.
|
||||
>>>>>>> origin/doco_refresh
|
||||
• **in production** at banks and hedge funds,
|
||||
globally.
|
||||
• **built using lessons learnt** from real-world
|
||||
@@ -50,6 +69,11 @@ your own.
|
||||
|
||||
=== Replication Environment Example
|
||||
The following diagram shows an example of Chronicle Map replication over three servers (or sites).
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Chronicle Map Replication is part of Chronicle Map (Enterprise Edition); a commercially supported
|
||||
version of our successful open source Chronicle Map.
|
||||
>>>>>>> origin/doco_refresh
|
||||
|
||||
image::docs\images\Configure_Three_Way_Replication.png[]
|
||||
|
||||
|
||||
@@ -8,6 +8,15 @@ Neil Clifford
|
||||
|
||||
toc::[]
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
== Prerequisites
|
||||
|
||||
To run Chronicle Map, please ensure you have first installed:
|
||||
|
||||
* Java (1.8.0_91 or later)
|
||||
* Apache Maven (3.2.3 or later)
|
||||
>>>>>>> origin/doco_refresh
|
||||
|
||||
== License
|
||||
|
||||
|
||||
@@ -18,7 +18,11 @@ applications, such as trading and financial market applications.
|
||||
- **High concurrency**: Write queries scale well up to the number of hardware execution threads in
|
||||
the server. Read queries never block each other.
|
||||
- **Persistence to disk** - (Optional)
|
||||
<<<<<<< HEAD
|
||||
- **Multi-key queries** - (Optional, closed-source) - Eventually-consistent, fully-redundant, asynchronous replication across
|
||||
=======
|
||||
- **Multi-master replication** - (Optional, commercial functionality) - Eventually-consistent, fully-redundant, asynchronous replication across
|
||||
>>>>>>> origin/doco_refresh
|
||||
servers, "last write wins" strategy by default, allows to implement custom https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type[state-based CRDT] strategy.
|
||||
|
||||
== Unique features
|
||||
|
||||
@@ -167,6 +167,7 @@ The following example uses a basic `yaml` configuration file to define defaults
|
||||
[source, yaml]
|
||||
....
|
||||
!ReplicatedMapCfg {
|
||||
<<<<<<< HEAD
|
||||
|
||||
hostId: 1, # host id must be unique within the cluster
|
||||
listenAddressHostPort: "localhost:9301", # address on which to listen for inbound replication requests
|
||||
@@ -182,6 +183,21 @@ mapLogDirectory: target/mapReplicationLogs, # directory where replication events
|
||||
keysAreConstantSize: true, # determines how keys are serialised
|
||||
valuesAreConstantSize: true # determines how values are serialised
|
||||
|
||||
=======
|
||||
hostId: 1, # host id must be unique within the cluster
|
||||
listenAddressHostPort: "localhost:9301", # address on which to listen for inbound replication requests
|
||||
entries: 10000, # entries hint suggesting the initial size of the map
|
||||
keyClass: !type long, # class of the key type
|
||||
valueClass: !type long, # class of the value type
|
||||
exampleKey: 17, # an example key (used to size the map)
|
||||
exampleValue: 37, # an example value (used to size the map)
|
||||
name: testLongToLongMap, # a name for the map (used to determine filename)
|
||||
locator: "csp://localhost:9301/map/test", # a locator, used for discovery
|
||||
mapFileDataDirectory: target/mapData, # directory where map file should be stored
|
||||
mapLogDirectory: target/mapReplicationLogs, # directory where replication events should be recorded
|
||||
keysAreConstantSize: true, # determines how keys are serialised
|
||||
valuesAreConstantSize: true # determines how values are serialised
|
||||
>>>>>>> origin/doco_refresh
|
||||
}
|
||||
....
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<groupId>net.openhft</groupId>
|
||||
<artifactId>java-parent-pom</artifactId>
|
||||
<version>1.1.12</version>
|
||||
<version>1.1.13</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<dependency>
|
||||
<groupId>net.openhft</groupId>
|
||||
<artifactId>chronicle-bom</artifactId>
|
||||
<version>1.14.51</version>
|
||||
<version>1.14.79</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.wire.AbstractMarshallable;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public final class AbstractMarshallableKeyValueTest {
|
||||
|
||||
@Test
|
||||
public void shouldAcceptAbstractMarshallableComponents() throws Exception {
|
||||
final ChronicleMap<Key, Value> map = ChronicleMapBuilder.of(Key.class, Value.class).entries(10).
|
||||
averageKey(new Key()).averageValue(new Value()).create();
|
||||
|
||||
map.put(new Key(), new Value());
|
||||
|
||||
assertThat(map.get(new Key()).number, is(new Value().number));
|
||||
}
|
||||
|
||||
private static final class Key extends AbstractMarshallable {
|
||||
private String k = "key";
|
||||
}
|
||||
|
||||
private static final class Value extends AbstractMarshallable {
|
||||
private Integer number = Integer.valueOf(17);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user