mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-163 renamed chronicle custer to chronicle channel
This commit is contained in:
+4
-4
@@ -45,8 +45,8 @@ import static net.openhft.chronicle.map.Replica.ModificationNotifier.NOP;
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
public final class ReplicatingChannel implements Closeable {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ReplicatingChannel.class.getName());
|
||||
public final class ChannelReplicator implements Closeable {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ChannelReplicator.class.getName());
|
||||
|
||||
private static final byte BOOTSTRAP_MESSAGE = 'B';
|
||||
final EntryExternalizable asEntryExternalizable = new EntryExternalizable() {
|
||||
@@ -152,7 +152,7 @@ public final class ReplicatingChannel implements Closeable {
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
ReplicatingChannel.this.close();
|
||||
ChannelReplicator.this.close();
|
||||
}
|
||||
};
|
||||
private final int maxEntrySize;
|
||||
@@ -169,7 +169,7 @@ public final class ReplicatingChannel implements Closeable {
|
||||
private final Set<AbstractChannelReplicator> replicators =
|
||||
new CopyOnWriteArraySet<AbstractChannelReplicator>();
|
||||
|
||||
ReplicatingChannel(ReplicatingChannelBuilder builder) {
|
||||
ChannelReplicator(ChannelReplicatorBuilder builder) {
|
||||
localIdentifier = builder.identifier;
|
||||
maxEntrySize = builder.maxEntrySize;
|
||||
chronicleChannels = new Replica[builder.maxNumberOfChronicles];
|
||||
+7
-7
@@ -21,7 +21,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* @author Rob Austin.
|
||||
*/
|
||||
public final class ReplicatingChannelBuilder {
|
||||
public final class ChannelReplicatorBuilder {
|
||||
|
||||
final byte identifier;
|
||||
final int maxEntrySize;
|
||||
@@ -29,7 +29,7 @@ public final class ReplicatingChannelBuilder {
|
||||
private UdpReplicationConfig udpReplicationConfig = null;
|
||||
private TcpReplicationConfig tcpReplicationConfig = null;
|
||||
|
||||
ReplicatingChannelBuilder(byte identifier, final int maxEntrySize) {
|
||||
ChannelReplicatorBuilder(byte identifier, final int maxEntrySize) {
|
||||
this.identifier = identifier;
|
||||
this.maxEntrySize = maxEntrySize;
|
||||
if (identifier <= 0) {
|
||||
@@ -38,23 +38,23 @@ public final class ReplicatingChannelBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
public ReplicatingChannelBuilder udpReplication(UdpReplicationConfig replicationConfig) {
|
||||
public ChannelReplicatorBuilder udpReplication(UdpReplicationConfig replicationConfig) {
|
||||
this.udpReplicationConfig = replicationConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReplicatingChannelBuilder tcpReplication(TcpReplicationConfig replicationConfig) {
|
||||
public ChannelReplicatorBuilder tcpReplication(TcpReplicationConfig replicationConfig) {
|
||||
this.tcpReplicationConfig = replicationConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReplicatingChannelBuilder maxNumberOfChronicles(int maxNumberOfChronicles) {
|
||||
public ChannelReplicatorBuilder maxNumberOfChronicles(int maxNumberOfChronicles) {
|
||||
this.maxNumberOfChronicles = maxNumberOfChronicles;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ReplicatingChannel create() throws IOException {
|
||||
final ReplicatingChannel replicatingCluster = new ReplicatingChannel(this);
|
||||
public ChannelReplicator create() throws IOException {
|
||||
final ChannelReplicator replicatingCluster = new ChannelReplicator(this);
|
||||
if (tcpReplicationConfig != null) {
|
||||
final TcpReplicator tcpReplicator = new TcpReplicator(
|
||||
replicatingCluster.asReplica,
|
||||
@@ -562,10 +562,10 @@ public class ChronicleMapBuilder<K, V> implements Cloneable,
|
||||
}
|
||||
|
||||
|
||||
public ChronicleMapBuilder<K, V> channel(ReplicatingChannel.ChronicleChannel replicator) {
|
||||
this.identifier = replicator.identifier();
|
||||
public ChronicleMapBuilder<K, V> channel(ChannelReplicator.ChronicleChannel chronicleChannel) {
|
||||
this.identifier = chronicleChannel.identifier();
|
||||
this.replicators.clear();
|
||||
replicators.put(replicator.getClass(), replicator);
|
||||
replicators.put(chronicleChannel.getClass(), chronicleChannel);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user