zookeeper
zookeeper copied to clipboard
ZOOKEEPER-3583:Add new apis to get node type and ttl time info
- Add new apis:
getStatPersisted, getTTL, getNodeTypein theZooKeeper.java - Currently, the
ephemeralOwnerof stat returned from java native client is not the actual one, due to the methodDataNode#getClientEphemeralOwner, I cannot change it for the compatibility. -
getStatPersistedmainly is used for getting the actualephemeralOwnerstored in the disk, Only use the actualephemeralOwnerstored in the disk, can we get the node type and ttl time info. -
stat -d /pathto show more details about a node -
NOTE: for TTL node, get
EPHEMERALwhenextendedTypesEnableddisable, getPERSISTENT_WITH_TTLwhenextendedTypesEnabledenable in the client side. For example: setting-Dzookeeper.extendedTypesEnabled=truein thezkCli.sh - more details in the ZOOKEEPER-3583
Refer to this link for build results (access rights to CI server needed): https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build-maven/1674/