Skip to content

Commit

Permalink
Tweaking Config Properties
Browse files Browse the repository at this point in the history
Changed the property names and default values to reflect their use
 inside the code and to reduce ambiguity (particularly around the term
 "cluster" which is used extensively).
  • Loading branch information
jimwebber committed Aug 10, 2016
1 parent 29712d6 commit e6b1cc0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Expand Up @@ -46,7 +46,7 @@
@Description("Settings for Core-Edge Clusters") @Description("Settings for Core-Edge Clusters")
public class CoreEdgeClusterSettings public class CoreEdgeClusterSettings
{ {
public static final Function<String, ListenSocketAddress> LISTEN_SOCKET_ADDRESS = new Function<String, private static final Function<String, ListenSocketAddress> LISTEN_SOCKET_ADDRESS = new Function<String,
ListenSocketAddress>() ListenSocketAddress>()
{ {
@Override @Override
Expand All @@ -63,7 +63,7 @@ public String toString()
} }
}; };


public static final Function<String, AdvertisedSocketAddress> ADVERTISED_SOCKET_ADDRESS = new Function<String, private static final Function<String, AdvertisedSocketAddress> ADVERTISED_SOCKET_ADDRESS = new Function<String,
AdvertisedSocketAddress>() AdvertisedSocketAddress>()
{ {
@Override @Override
Expand Down Expand Up @@ -121,25 +121,25 @@ public String toString()
public static final Setting<Long> lock_read_timeout = public static final Setting<Long> lock_read_timeout =
setting( "core_edge.lock_read_timeout", DURATION, "20s" ); setting( "core_edge.lock_read_timeout", DURATION, "20s" );


@Description("Network interface and port for the RAFT server to listen on.") @Description("Network interface and port for the transaction shipping server to listen on.")
public static final Setting<ListenSocketAddress> transaction_listen_address = public static final Setting<ListenSocketAddress> transaction_listen_address =
setting( "core_edge.transaction_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:6001" ); setting( "core_edge.transaction_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:6000" );


@Description("Hostname/IP address and port that other RAFT servers can use to communicate with us.") @Description("Hostname/IP address and port for the transaction shipping server to listen on.")
public static final Setting<AdvertisedSocketAddress> transaction_advertised_address = public static final Setting<AdvertisedSocketAddress> transaction_advertised_address =
setting( "core_edge.transaction_advertised_address", ADVERTISED_SOCKET_ADDRESS, "localhost:6001" ); setting( "core_edge.transaction_advertised_address", ADVERTISED_SOCKET_ADDRESS, "localhost:6000" );


@Description("Network interface and port for the RAFT server to listen on.") @Description("Network interface and port for the RAFT server to listen on.")
public static final Setting<ListenSocketAddress> raft_listen_address = public static final Setting<ListenSocketAddress> raft_listen_address =
setting( "core_edge.raft_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:7400" ); setting( "core_edge.raft_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:7000" );


@Description("Hostname/IP address and port that other RAFT servers can use to communicate with us.") @Description("Hostname/IP address and port for the RAFT server to listen on.")
public static final Setting<AdvertisedSocketAddress> raft_advertised_address = public static final Setting<AdvertisedSocketAddress> raft_advertised_address =
setting( "core_edge.raft_advertised_address", ADVERTISED_SOCKET_ADDRESS, "localhost:7400" ); setting( "core_edge.raft_advertised_address", ADVERTISED_SOCKET_ADDRESS, "localhost:7000" );


@Description("Host and port to bind the cluster management communication.") @Description("Host and port to bind the cluster management communication.")
public static final Setting<ListenSocketAddress> cluster_listen_address = public static final Setting<ListenSocketAddress> hazelcast_listen_address =
setting( "core_edge.cluster_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:5001" ); setting( "core_edge.hazelcast_listen_address", LISTEN_SOCKET_ADDRESS, "0.0.0.0:5000" );


@Description("A comma-separated list of other members of the cluster to join.") @Description("A comma-separated list of other members of the cluster to join.")
public static final Setting<List<AdvertisedSocketAddress>> initial_core_cluster_members = public static final Setting<List<AdvertisedSocketAddress>> initial_core_cluster_members =
Expand Down
Expand Up @@ -103,8 +103,8 @@ private HazelcastInstance createHazelcastInstance()
log.info( "Discovering cluster with initial members: " + initialMembers ); log.info( "Discovering cluster with initial members: " + initialMembers );


NetworkConfig networkConfig = new NetworkConfig(); NetworkConfig networkConfig = new NetworkConfig();
ListenSocketAddress address = config.get( CoreEdgeClusterSettings.cluster_listen_address ); ListenSocketAddress hazelcastAddress = config.get( CoreEdgeClusterSettings.hazelcast_listen_address );
networkConfig.setPort( address.socketAddress().getPort() ); networkConfig.setPort( hazelcastAddress.socketAddress().getPort() );
networkConfig.setJoin( joinConfig ); networkConfig.setJoin( joinConfig );


com.hazelcast.config.Config c = new com.hazelcast.config.Config(); com.hazelcast.config.Config c = new com.hazelcast.config.Config();
Expand Down
Expand Up @@ -53,7 +53,7 @@ public class CoreClusterMember
private final int serverId; private final int serverId;
private CoreGraphDatabase database; private CoreGraphDatabase database;


public static final String CLUSTER_NAME = "core-neo4j"; static final String CLUSTER_NAME = "core-neo4j";


public CoreClusterMember( int serverId, int clusterSize, public CoreClusterMember( int serverId, int clusterSize,
List<AdvertisedSocketAddress> addresses, List<AdvertisedSocketAddress> addresses,
Expand All @@ -77,7 +77,7 @@ public CoreClusterMember( int serverId, int clusterSize,
params.put( CoreEdgeClusterSettings.cluster_name.name(), CLUSTER_NAME ); params.put( CoreEdgeClusterSettings.cluster_name.name(), CLUSTER_NAME );
params.put( CoreEdgeClusterSettings.initial_core_cluster_members.name(), initialMembers ); params.put( CoreEdgeClusterSettings.initial_core_cluster_members.name(), initialMembers );
params.put( GraphDatabaseSettings.record_format.name(), recordFormat ); params.put( GraphDatabaseSettings.record_format.name(), recordFormat );
params.put( CoreEdgeClusterSettings.cluster_listen_address.name(), "localhost:" + clusterPort ); params.put( CoreEdgeClusterSettings.hazelcast_listen_address.name(), "localhost:" + clusterPort );
params.put( CoreEdgeClusterSettings.transaction_advertised_address.name(), "localhost:" + txPort ); params.put( CoreEdgeClusterSettings.transaction_advertised_address.name(), "localhost:" + txPort );
params.put( CoreEdgeClusterSettings.transaction_listen_address.name(), "127.0.0.1:" + txPort ); params.put( CoreEdgeClusterSettings.transaction_listen_address.name(), "127.0.0.1:" + txPort );
params.put( CoreEdgeClusterSettings.raft_advertised_address.name(), "localhost:" + raftPort ); params.put( CoreEdgeClusterSettings.raft_advertised_address.name(), "localhost:" + raftPort );
Expand Down

0 comments on commit e6b1cc0

Please sign in to comment.