ZOOKEEPER-4966: Decouple `ZKConfig` from `QuorumPeerConfig.ConfigException`
ZKConfig is client accessible, it should avoid accessing server side QuorumPeerConfig.
Changes:
- Introduce
org.apache.zookeeper.common.ConfigExceptionforZKConfig(String configPath). - Make
QuorumPeerConfig.ConfigExceptiona subclass of above. - Throw
QuorumPeerConfig.ConfigExceptionif possible.
Given above changes, this pr maintain abi compatibility with old releases.
Breaking change: ZKConfig(String configPath) throws org.apache.zookeeper.common.ConfigException now but not QuorumPeerConfig.ConfigException, so developers have to fix it to compile.
This is a small step towards ZOOKEEPER-233.
Refs: ZOOKEEPER-233, ZOOKEEPER-835, and ZOOKEEPER-842.
The breaking change is source code level so it won't break runtime code. We could also make org.apache.zookeeper.common.ConfigException as an unchecked exception, but that could break runtime expectation as it could be catched as RuntimeException. I would prefer to break in source code leve but not runtime.
Give this pr and #2305, I could split zookeeper-client from zookeeper-server by moving classes mostly, though, the package hierarcy does not look good.
@kezhuw Did you see my comments?