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();
@@ -89,6 +89,7 @@ public class MapByNameTest {
public static void main(String... args) throws IOException, InterruptedException {
NodeDiscovery nodeDiscovery = new NodeDiscovery();
/*
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder.of(CharSequence
.class, CharSequence.class)
@@ -96,14 +97,13 @@ public class MapByNameTest {
.name("myMap")
.removeReturnsNull(true);
*/
ReplicationHubFindByName mapByName = nodeDiscovery.mapByName();
mapByName.add(builder);
// wait for ever
for (; ; ) {
}
ChronicleMapBuilder myMap = mapByName.get("myMap");
}