Repository navigation
Conversation
Add a Storm-owned ZkClient interface, implemented on Curator in the internal org.apache.storm.zookeeper.curator package. Curator remains a dependency; no behaviour change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Apache Curator may move to the Apache Attic. Storm uses Curator for all of its ZooKeeper access, and Curator types currently leak into Storm's public API. So any later replacement of Curator would break users and plugin authors.
This PR is the first step. It removes Curator types from Storm's public and protected signatures. It does not remove Curator: Curator is still a dependency, still shaded in
storm-shaded-deps, and still does all ZooKeeper work at runtime. Behaviour is unchanged.New types:
org.apache.storm.zookeeper.ZkClient: a Storm-owned handle to a started ZooKeeper session. It replacesCuratorFrameworkin all signatures and covers only what Storm calls today. Its javadoc defines the contract: paths,KeeperExceptions passed through unwrapped, watch dispatch, default and parent ACLs, retries, asyncsync, and default data.org.apache.storm.zookeeper.curator(internal package):CuratorZkClient(the onlyZkClientimplementation, delegating to Curator),CuratorUtils(moved fromorg.apache.storm.utils) andCuratorRetryPolicy.org.apache.storm.zookeeper.LeaderListenerreplaces Curator'sLeaderLatchListeneras the return type ofLeaderListenerCallbackFactory.create.org.apache.storm.cluster.ConnectionStategainsSUSPENDEDandREAD_ONLY, appended so existing ordinals stay the same.LeaderElectorImpstill uses Curator'sLeaderLatchinternally, but no longer exposes it.external/storm-kafka-migration(standalone tools using unshaded Curator) and test-only Curator use (curator-test) are unchanged.In main code, Curator imports go from 19 files to 4: the internal
zookeeper.curatorpackage andLeaderElectorImp.Upgrade notes
Breaking for code that implements or calls these APIs. Users who only submit topologies are not affected.
IStateStorage.add_listenernow takesorg.apache.storm.cluster.ClusterStateListenerinstead of Curator'sConnectionStateListener. Customstorm.cluster.state.storeimplementations must be updated.org.apache.storm.utils.CuratorUtilsmoved to the internal packageorg.apache.storm.zookeeper.curator.newCuratorStarted(...)andnewCurator(conf, servers, port, auth, acl)were removed.StormBoundedExponentialBackoffRetryno longer extends Curator'sBoundedExponentialBackoffRetry, sogetNandallowRetryare gone.getSleepTimeMsis unchanged.These now take or return
ZkClientinstead ofCuratorFramework:ClientZookeeper's static helpers, plusmkClient,mkClientImpl,mkdirsImplandaddListenerZookeeper.zkLeaderElectorandzkLeaderElectorImplLeaderElectorImp,LeaderListenerCallbackandLeaderListenerCallbackFactoryNimbus.getVersionForKeyKeySequenceNumber.getKeySequenceNumberBlobStoreUtils.createZKClient,getNimbodesWithLatestSequenceNumberOfBlobandupdateKeyForBlobStoreLocalFsBlobStoreSynchronizer.setZkClientTransactionalState.createNodeandTestTransactionalState.createNodeThe test hooks exposed through
MockedClientZookeeperandMockedZookeeperchange accordingly.Zookeeper.toNimbusInfo(Participant)is nowtoNimbusInfo(String participantId, boolean isLeader).The protected
TransactionalState.forPath(PathAndBytesable<String>, String, byte[])was removed.