Made TcpConfig back immutable; Draw the borderline: Builders are mutable, Configs are immutable (hence ChronicleHashInstanceBuilder and StatelessClientBuilder renamed to Configs; improved TcpConfig static factory naming

This commit is contained in:
leventov
2014-11-07 12:24:52 +03:00
parent 4a51b129a3
commit 4c86dae04f
29 changed files with 198 additions and 215 deletions
@@ -25,6 +25,7 @@ import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.InetSocketAddress;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
/**
@@ -71,7 +72,7 @@ public class Builder {
final byte identifier,
final int serverPort,
final InetSocketAddress... endpoints) throws IOException {
TcpConfig tcpConfig = TcpConfig.of(serverPort, endpoints)
TcpConfig tcpConfig = TcpConfig.unknownTopology(serverPort, Arrays.asList(endpoints))
.heartBeatInterval(1L, TimeUnit.SECONDS);
return ChronicleMapBuilder.of(kClass, vClass)
.replication(identifier, tcpConfig);