* Is this a valid configuration that we can run with? This code might grow
* over time.
*/
public void validate() throws ConfigurationException {
if (!getZkPrefix().startsWith("/")) {
throw new ConfigurationException(ZK_PREFIX + " must start with a /");
}
// Validate that if Regions exist and inter-region communication is SSL
// enabled, that the Regions correspond to valid HedwigSocketAddresses,
// namely that SSL ports are present.
if (isInterRegionSSLEnabled() && getRegions().size() > 0) {
for (String hubString : getRegions()) {
HedwigSocketAddress hub = new HedwigSocketAddress(hubString);
if (hub.getSSLSocketAddress() == null)
throw new ConfigurationException("Region defined does not have required SSL port: " + hubString);
}
}
// Validate that the Bookkeeper ensemble size >= quorum size.
if (getBkEnsembleSize() < getBkQuorumSize()) {
throw new ConfigurationException("BK ensemble size (" + getBkEnsembleSize()
+ ") is less than the quorum size (" + getBkQuorumSize() + ")");
}
// add other checks here
}