@Override public void init( final BrokerCfg brokerCfg, final String brokerBase, final Environment environment) { applyEnvironment(environment); client.applyDefaults(this); management.applyDefaults(this); replication.applyDefaults(this); subscription.applyDefaults(this); }
@Override public void init(BrokerCfg globalConfig, String brokerBase, Environment environment) { if (isExternal()) { jarPath = ConfigurationUtil.toAbsolutePath(jarPath, brokerBase); } }
public void init(final String brokerBase, final Environment environment) { network.init(this, brokerBase, environment); cluster.init(this, brokerBase, environment); threads.init(this, brokerBase, environment); metrics.init(this, brokerBase, environment); data.init(this, brokerBase, environment); exporters.forEach(e -> e.init(this, brokerBase, environment)); gateway.init(this, brokerBase, environment); }
public static void assignSocketAddresses(final BrokerCfg brokerCfg) { final NetworkCfg network = brokerCfg.getNetwork(); brokerCfg.getGateway().getNetwork().setPort(SocketUtil.getNextAddress().port()); network.getClient().setPort(SocketUtil.getNextAddress().port()); network.getManagement().setPort(SocketUtil.getNextAddress().port()); network.getReplication().setPort(SocketUtil.getNextAddress().port()); network.getSubscription().setPort(SocketUtil.getNextAddress().port()); }
private void assertPorts( final String configFileName, final int client, final int management, final int replication, final int subscription) { final NetworkCfg network = readConfig(configFileName).getNetwork(); assertThat(network.getClient().getPort()).isEqualTo(client); assertThat(network.getManagement().getPort()).isEqualTo(management); assertThat(network.getReplication().getPort()).isEqualTo(replication); assertThat(network.getSubscription().getPort()).isEqualTo(subscription); }
public SocketAddress getClientAddress() { return brokerCfg.getNetwork().getClient().toSocketAddress(); }
public SocketAddress getManagementAddress() { return brokerCfg.getNetwork().getManagement().toSocketAddress(); }
public static Consumer<BrokerCfg> setSubscriptionApiPort(final int port) { return cfg -> cfg.getNetwork().getSubscription().setPort(port); } }
public static Consumer<BrokerCfg> setClientApiPort(final int port) { return cfg -> cfg.getNetwork().getClient().setPort(port); }
public static Consumer<BrokerCfg> setReplicationApiPort(final int port) { return cfg -> cfg.getNetwork().getReplication().setPort(port); }
public static Consumer<BrokerCfg> setManagementApiPort(final int port) { return cfg -> cfg.getNetwork().getManagement().setPort(port); }
public static Consumer<BrokerCfg> setCluster( final int nodeId, final int partitionCount, final int replicationFactor, final int clusterSize) { return cfg -> { final ClusterCfg cluster = cfg.getCluster(); cluster.setNodeId(nodeId); cluster.setPartitionsCount(partitionCount); cluster.setReplicationFactor(replicationFactor); cluster.setClusterSize(clusterSize); }; }
public static Consumer<BrokerCfg> setPartitionCount(final int partitionCount) { return cfg -> cfg.getCluster().setPartitionsCount(partitionCount); }
public SocketAddress getClientAddress() { return brokerCfg.getNetwork().getClient().toSocketAddress(); }
public SocketAddress getManagementAddress() { return brokerCfg.getNetwork().getManagement().toSocketAddress(); }
public static Consumer<BrokerCfg> setSubscriptionApiPort(final int port) { return cfg -> cfg.getNetwork().getSubscription().setPort(port); } }
public void init(final String brokerBase, final Environment environment) { network.init(this, brokerBase, environment); cluster.init(this, brokerBase, environment); threads.init(this, brokerBase, environment); metrics.init(this, brokerBase, environment); data.init(this, brokerBase, environment); exporters.forEach(e -> e.init(this, brokerBase, environment)); gateway.init(this, brokerBase, environment); }
public static Consumer<BrokerCfg> setCluster( final int nodeId, final int partitionCount, final int replicationFactor, final int clusterSize) { return cfg -> { final ClusterCfg cluster = cfg.getCluster(); cluster.setNodeId(nodeId); cluster.setPartitionsCount(partitionCount); cluster.setReplicationFactor(replicationFactor); cluster.setClusterSize(clusterSize); }; }
@Override public void init( final BrokerCfg brokerCfg, final String brokerBase, final Environment environment) { applyEnvironment(environment); client.applyDefaults(this); management.applyDefaults(this); replication.applyDefaults(this); subscription.applyDefaults(this); }
@Override public void init(BrokerCfg globalConfig, String brokerBase, Environment environment) { if (isExternal()) { jarPath = ConfigurationUtil.toAbsolutePath(jarPath, brokerBase); } }