From 1b4da147c07366d9aa5b35e24e0c39ab37588ac5 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Tue, 14 Oct 2014 10:14:21 +0100 Subject: [PATCH] HCOLL-163 updated readme --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f0b4706ff..a5a64ea2d 100644 --- a/README.md +++ b/README.md @@ -524,10 +524,11 @@ Chronicle Channels are similar to TCP replication, where each map has to be give when using Chronicle Channels its the channels that are given the unique identifier not the map. ``` java -byte identifier = 2; int maxEntrySize = 1024; -ChannelProvider replicator = new ChannelProviderBuilder(identifier, maxEntrySize) - .create(); +byte identifier= 1; +ChannelProvider channelProvider = new ChannelProviderBuilder() + .maxEntrySize(maxEntrySize) + .replicators(identifier, tcpReplicationConfig).create(); ``` In this example above the channel is given the identifier of 2 @@ -538,22 +539,22 @@ are able to attach additional maps to a ChannelProvider once its up and running, entry in the map can not be known in advance and we don’t currently support automatic resizing of buffers. -Once you have created the ChannelProvider you should attach your tcp configuration +When creating the ChannelProvider you should attach your tcp or udp configuration ``` java -byte identifier = 2; -int maxEntrySize =1024; -ChannelProvider replicator = new ChannelProviderBuilder(identifier, 1024) - .tcpReplication(tcpConfig) - .create();; +int maxEntrySize = 1024; +byte identifier = 1; +ChannelProvider channelProvider = new ChannelProviderBuilder() + .maxEntrySize(maxEntrySize) + .replicators(identifier, tcpReplicationConfig).create(); ``` Attaching ChannelProvider replication to the map: ``` java ChronicleMap map = ChronicleMapBuilder.of(Integer.class, CharSequence.class) - .entries(1000) - .channel(replicator.createChannel((short) 1)) - .create(file); + .entries(1000) + .channel(channelProviderA.createChannel((short) 1)) + .create(getPersistenceFile()); ``` The chronicle channel is use to identify which map is to be replicated to which other map on