HCOLL-134 attempting to bias to use IPV4 addresses

This commit is contained in:
Rob Austin
2014-11-18 12:23:11 +00:00
parent baa966ca2d
commit 825668e126
3 changed files with 12 additions and 6 deletions
@@ -1139,7 +1139,13 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
public static InetAddress getDefaultAddress() throws SocketException {
NetworkInterface networkInterface = ConcurrentExpiryMap.defaultNetworkInterface();
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
InetAddress inetAddress = inetAddresses.nextElement();
// we will take the last one as this is likely to be an ipv address which is easier to work with
InetAddress inetAddress = null;
for (; inetAddresses.hasMoreElements(); ) {
inetAddress = inetAddresses.nextElement();
}
if (inetAddress == null)
throw new IllegalStateException();
@@ -46,7 +46,7 @@ class ReplicationHubFindByName implements FindByName {
public ReplicationHubFindByName(ReplicationHub replicationHub) throws IOException {
this.replicationHub = replicationHub;
this.map = (Map) of(CharSequence.class, ChronicleMapBuilder.class)
.entrySize(300)
.entrySize(2500)
.entries(128)
.instance()
.replicatedViaChannel(replicationHub.createChannel((short) MAP_BY_NAME_CHANNEL)).create();