Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Make ProducerIdManager an interface - #1061

Merged
BewareMyPower merged 4 commits into
streamnative:masterfrom
eolivelli:impl/produceridmanager-interface
Feb 10, 2022
Merged

Make ProducerIdManager an interface#1061
BewareMyPower merged 4 commits into
streamnative:masterfrom
eolivelli:impl/produceridmanager-interface

Conversation

@eolivelli

Copy link
Copy Markdown
Contributor

This is a preliminary refactor that makes ProducerIdManager an interface.
The plan is to contribute a new implementation of ProducerIdManager that does not use the MetadataStore service (ZooKeeper) but it stores the ids on a Pulsar topic.

Using Pulsar as backing store for generating the ids is better when you are using this feature in a MultiTenant environment and you want to fully isolate the data of each tenants.

@Demogorgon314 Demogorgon314 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@BewareMyPower
BewareMyPower merged commit b07222d into streamnative:master Feb 10, 2022
BewareMyPower pushed a commit that referenced this pull request Feb 10, 2022
This is a preliminary refactor that makes ProducerIdManager an interface.
The plan is to contribute a new implementation of ProducerIdManager that does not use the MetadataStore service (ZooKeeper) but it stores the ids on a Pulsar topic.

Using Pulsar as backing store for generating the ids is better when you are using this feature in a MultiTenant environment and you want to fully isolate the data of each tenants.
BewareMyPower pushed a commit that referenced this pull request Feb 10, 2022
This is a preliminary refactor that makes ProducerIdManager an interface.
The plan is to contribute a new implementation of ProducerIdManager that does not use the MetadataStore service (ZooKeeper) but it stores the ids on a Pulsar topic.

Using Pulsar as backing store for generating the ids is better when you are using this feature in a MultiTenant environment and you want to fully isolate the data of each tenants.

(cherry picked from commit b07222d)
@BewareMyPower

Copy link
Copy Markdown
Contributor

@Demogorgon314 Could you help cherry-pick this PR to branch-2.8.2? I met some conflicts in cleanZNode().

<<<<<<< HEAD:tests/src/test/java/io/streamnative/pulsar/handlers/kop/coordinator/transaction/ProducerIdManagerTest.java
        Stat stat = mockZooKeeper.exists(ProducerIdManager.KOP_PID_BLOCK_ZNODE, null);
        if (stat != null) {
            mockZooKeeper.delete(ProducerIdManager.KOP_PID_BLOCK_ZNODE, -1);
        }
=======
        pulsar.getLocalMetadataStore()
                .deleteRecursive(ProducerIdManagerImpl.KOP_PID_BLOCK_ZNODE).get(10, TimeUnit.SECONDS);
>>>>>>> b07222d (Make ProducerIdManager an interface (#1061)):tests/src/test/java/io/streamnative/pulsar/handlers/kop/coordinator/transaction/ProducerIdManagerImplTest.java

Demogorgon314 pushed a commit that referenced this pull request Feb 10, 2022
This is a preliminary refactor that makes ProducerIdManager an interface.
The plan is to contribute a new implementation of ProducerIdManager that does not use the MetadataStore service (ZooKeeper) but it stores the ids on a Pulsar topic.

Using Pulsar as backing store for generating the ids is better when you are using this feature in a MultiTenant environment and you want to fully isolate the data of each tenants.

(cherry picked from commit b07222d)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants