in bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java [3218:3257]
public void validate() throws ConfigurationException {
// generate config def
ConfigDef configDef = ConfigDef.of(ServerConfiguration.class);
try {
configDef.validate(this);
} catch (ConfigException e) {
throw new ConfigurationException(e.getMessage(), e.getCause());
}
if (getSkipListArenaChunkSize() < getSkipListArenaMaxAllocSize()) {
throw new ConfigurationException("Arena max allocation size should be smaller than the chunk size.");
}
if (getJournalAlignmentSize() < 512 || getJournalAlignmentSize() % 512 != 0) {
throw new ConfigurationException("Invalid journal alignment size : " + getJournalAlignmentSize());
}
if (getJournalAlignmentSize() > getJournalPreAllocSizeMB() * 1024 * 1024) {
throw new ConfigurationException("Invalid preallocation size : " + getJournalPreAllocSizeMB() + " MB");
}
if (0 == getBookiePort() && !getAllowEphemeralPorts()) {
throw new ConfigurationException("Invalid port specified, using ephemeral ports accidentally?");
}
if (isEntryLogPerLedgerEnabled() && getUseTransactionalCompaction()) {
throw new ConfigurationException(
"When entryLogPerLedger is enabled , it is unnecessary to use transactional compaction");
}
if ((getJournalFormatVersionToWrite() >= 6) ^ (getFileInfoFormatVersionToWrite() >= 1)) {
throw new ConfigurationException("For persisiting explicitLac, journalFormatVersionToWrite should be >= 6"
+ "and FileInfoFormatVersionToWrite should be >= 1");
}
if (getMinorCompactionInterval() > 0 && getMinorCompactionInterval() * SECOND < getGcWaitTime()) {
throw new ConfigurationException("minorCompactionInterval should be >= gcWaitTime.");
}
if (getMajorCompactionInterval() > 0 && getMajorCompactionInterval() * SECOND < getGcWaitTime()) {
throw new ConfigurationException("majorCompactionInterval should be >= gcWaitTime.");
}
if (getEntryLocationCompactionInterval() > 0
&& getEntryLocationCompactionInterval() * SECOND < getGcWaitTime()) {
throw new ConfigurationException("entryLocationCompactionInterval should be >= gcWaitTime.");
}
}