ServerConfiguration extends CompositeConfiguration { public void validate() { byte dlsnVersion = getDlsnVersion(); Preconditions.checkArgument(dlsnVersion >= DLSN.VERSION0 && dlsnVersion <= DLSN.VERSION1, "Unknown dlsn version " + dlsnVersion); Preconditions.checkArgument(getServerThreads() > 0, "Invalid number of server threads : " + getServerThreads()); Preconditions.checkArgument(getServerShardId() >= 0, "Invalid server shard id : " + getServerShardId()); } ServerConfiguration(); void loadConf(DistributedLogConfiguration dlConf); ServerConfiguration setDlsnVersion(byte version); byte getDlsnVersion(); ServerConfiguration enableDurableWrite(boolean enabled); boolean isDurableWriteEnabled(); ServerConfiguration setRegionId(int regionId); int getRegionId(); ServerConfiguration setServerPort(int port); int getServerPort(); ServerConfiguration setServerShardId(int shardId); int getServerShardId(); int getServerThreads(); ServerConfiguration setServerThreads(int numThreads); ServerConfiguration setPerStreamStatEnabled(boolean enabled); boolean isPerStreamStatEnabled(); ServerConfiguration setGracefulShutdownPeriodMs(long periodMs); long getGracefulShutdownPeriodMs(); long getServiceTimeoutMs(); ServerConfiguration setServiceTimeoutMs(long timeoutMs); long getStreamProbationTimeoutMs(); ServerConfiguration setStreamProbationTimeoutMs(long timeoutMs); ServerConfiguration setStreamPartitionConverterClass(Class<? extends StreamPartitionConverter> converterClass); Class<? extends StreamPartitionConverter> getStreamPartitionConverterClass(); void validate(); static final String SERVER_SERVICE_TIMEOUT_MS; static final String SERVER_SERVICE_TIMEOUT_MS_OLD; static final long SERVER_SERVICE_TIMEOUT_MS_DEFAULT; static final String SERVER_STREAM_PROBATION_TIMEOUT_MS; static final String SERVER_STREAM_PROBATION_TIMEOUT_MS_OLD; static final long SERVER_STREAM_PROBATION_TIMEOUT_MS_DEFAULT; }
@Test(timeout = 60000, expected = IllegalArgumentException.class) public void testUnassignedShardId() { new ServerConfiguration().validate(); }