@Override protected void process(CommandLine cli) { super.process(cli); builder.withDiscoveryPort(Integer.parseInt(cli.getOptionValue("r", "" + DEFAULT_DISCOVERY_PORT))); builder.withRegistrationPort(Integer.parseInt(cli.getOptionValue("w", "" + DEFAULT_REGISTRATION_PORT))); builder.withReplicationPort(Integer.parseInt(cli.getOptionValue("p", "" + DEFAULT_REPLICATION_PORT))); builder.withEvictionTimeout(Integer.parseInt(cli.getOptionValue("et", "" + WriteServerConfig.DEFAULT_EVICTION_TIMEOUT))); builder.withEvictionStrategyType(StrategyType.valueOf(cli.getOptionValue("es", StrategyType.PercentageDrop.name()))); builder.withEvictionStrategyValue(cli.getOptionValue("ev", "20")); } }
@Override protected void process(CommandLine cli) { super.process(cli); builder.withDiscoveryPort(Integer.parseInt(cli.getOptionValue("r", "" + DEFAULT_DISCOVERY_PORT))); builder.withRegistrationPort(Integer.parseInt(cli.getOptionValue("w", "" + DEFAULT_REGISTRATION_PORT))); builder.withReplicationPort(Integer.parseInt(cli.getOptionValue("p", "" + DEFAULT_REPLICATION_PORT))); builder.withEvictionTimeout(Integer.parseInt(cli.getOptionValue("et", "" + WriteServerConfig.DEFAULT_EVICTION_TIMEOUT))); builder.withEvictionStrategyType(StrategyType.valueOf(cli.getOptionValue("es", StrategyType.PercentageDrop.name()))); builder.withEvictionStrategyValue(cli.getOptionValue("ev", "20")); } }
.withReadClusterVipAddress(EmbeddedReadCluster.READ_SERVER_NAME) .withDataCenterType(DataCenterType.Basic) .withRegistrationPort(writeServerAddress.getRegistrationPort()) .withDiscoveryPort(writeServerAddress.getInterestPort()) .withReplicationPort(writeServerAddress.getReplicationPort())
@Override protected void before() throws Throwable { WriteServerConfig config = WriteServerConfig.writeBuilder() .withAppName(name) .withVipAddress(name) .withReadClusterVipAddress(readClusterName) .withDataCenterType(DataCenterType.Basic) .withHttpPort(0) .withRegistrationPort(0) .withDiscoveryPort(0) .withReplicationPort(0) .withCodec(codec) .withShutDownPort(0) .withWebAdminPort(0) .withReplicationRetryMillis(1000) .build(); Observable<ChangeNotification<Server>> noPeers = Observable.never(); server = new EmbeddedWriteServer(config, noPeers, noPeers, false, false); server.start(); }
@Override public int scaleUpByOne() { WriteServerAddress writeServerAddress = new WriteServerAddress("localhost", nextAvailablePort, nextAvailablePort + 1, nextAvailablePort + 2); WriteServerConfig config = WriteServerConfig.writeBuilder() .withAppName(WRITE_SERVER_NAME) .withVipAddress(WRITE_SERVER_NAME) .withDataCenterType(DataCenterType.Basic) .withRegistrationPort(writeServerAddress.getRegistrationPort()) .withDiscoveryPort(writeServerAddress.getDiscoveryPort()) .withReplicationPort(writeServerAddress.getReplicationPort()) .withCodec(Codec.Avro) .withShutDownPort(nextAvailablePort + 3) .withWebAdminPort(nextAvailablePort + 4) .withReplicationRetryMillis(1000) .build(); EmbeddedWriteServer newServer = newServer(config); newServer.start(); nextAvailablePort += 10; return scaleUpByOne(newServer, writeServerAddress); }
@Override protected void before() throws Throwable { WriteServerConfig config = WriteServerConfig.writeBuilder() .withAppName(name) .withVipAddress(name) .withDataCenterType(DataCenterType.Basic) .withRegistrationPort(0) .withDiscoveryPort(0) .withReplicationPort(0) .withCodec(Codec.Avro) .withShutDownPort(0) .withWebAdminPort(0) .withReplicationRetryMillis(1000) .build(); server = new EmbeddedWriteServer(config, Observable.<ChangeNotification<InetSocketAddress>>never(), false, false); server.start(); }