Skip to content

Remove Curator types from Storm's public API - #9288

Draft
rzo1 wants to merge 1 commit into
masterfrom
curator-decouple-step1
Draft

rzo1 wants to merge 1 commit into
masterfrom
curator-decouple-step1

Conversation

@rzo1

@rzo1 rzo1 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

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 replaces CuratorFramework in 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, async sync, and default data.
  • org.apache.storm.zookeeper.curator (internal package): CuratorZkClient (the only ZkClient implementation, delegating to Curator), CuratorUtils (moved from org.apache.storm.utils) and CuratorRetryPolicy.
  • org.apache.storm.zookeeper.LeaderListener replaces Curator's LeaderLatchListener as the return type of LeaderListenerCallbackFactory.create.
  • org.apache.storm.cluster.ConnectionState gains SUSPENDED and READ_ONLY, appended so existing ordinals stay the same.

LeaderElectorImp still uses Curator's LeaderLatch internally, 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.curator package and LeaderElectorImp.

Upgrade notes

Breaking for code that implements or calls these APIs. Users who only submit topologies are not affected.

  • IStateStorage.add_listener now takes org.apache.storm.cluster.ClusterStateListener instead of Curator's ConnectionStateListener. Custom storm.cluster.state.store implementations must be updated.

  • org.apache.storm.utils.CuratorUtils moved to the internal package org.apache.storm.zookeeper.curator. newCuratorStarted(...) and newCurator(conf, servers, port, auth, acl) were removed.

  • StormBoundedExponentialBackoffRetry no longer extends Curator's BoundedExponentialBackoffRetry, so getN and allowRetry are gone. getSleepTimeMs is unchanged.

  • These now take or return ZkClient instead of CuratorFramework:

    • ClientZookeeper's static helpers, plus mkClient, mkClientImpl, mkdirsImpl and addListener
    • Zookeeper.zkLeaderElector and zkLeaderElectorImpl
    • LeaderElectorImp, LeaderListenerCallback and LeaderListenerCallbackFactory
    • Nimbus.getVersionForKey
    • KeySequenceNumber.getKeySequenceNumber
    • BlobStoreUtils.createZKClient, getNimbodesWithLatestSequenceNumberOfBlob and updateKeyForBlobStore
    • LocalFsBlobStoreSynchronizer.setZkClient
    • TransactionalState.createNode and TestTransactionalState.createNode

    The test hooks exposed through MockedClientZookeeper and MockedZookeeper change accordingly.

  • Zookeeper.toNimbusInfo(Participant) is now toNimbusInfo(String participantId, boolean isLeader).

  • The protected TransactionalState.forPath(PathAndBytesable<String>, String, byte[]) was removed.

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.
@rzo1 rzo1 added this to the 3.3.0 milestone Nov 18, 2026
@rzo1
rzo1 requested review from GGraziadei and reiabreu November 18, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant