Skip to content

Conversation

@arjun4084346
Copy link
Contributor

@arjun4084346 arjun4084346 commented Apr 17, 2025

Problem Statement

In several places, Kafka admin/consumer/admin adapter factories are created directly (new ApacheKafkaAdminAdapterFactory()) without using venice properties. This obstructs using a different type of adapter transparently with the help of properties.
We are not passing configs needed by pubsub clients to VPJ.

Solution

  • used PubSubClientsFactory.fromVeniceProperties to create adaptor factories
  • passing pubsub configs obtained through pubsub broker wrappers to VPJ

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging.

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues.
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed.
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation.
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList).
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination.

How was this PR tested?

  • New unit tests added.
  • New integration tests added.
  • Modified or extended existing tests.
  • Verified backward compatibility (if applicable).

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

@arjun4084346 arjun4084346 marked this pull request as draft April 17, 2025 01:05
@arjun4084346 arjun4084346 requested a review from Copilot April 17, 2025 07:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

internal/venice-common/src/java/com/linkedin/venice/pubsub/PubSubClientsFactory.java:26

  • [nitpick] Consider adding JavaDoc comments for the new generic parameters to improve code clarity and assist future maintainers.
public class PubSubClientsFactory<P extends PubSubProducerAdapter, C extends PubSubConsumerAdapter, A extends PubSubAdminAdapter> {

internal/venice-common/src/java/com/linkedin/venice/pubsub/PubSubClientsFactory.java:46

  • [nitpick] Consider capturing explicit generic types in the factory method for better type inference and consistency across usages.
public static PubSubClientsFactory<? extends PubSubProducerAdapter, ? extends PubSubConsumerAdapter, ? extends PubSubAdminAdapter> fromVeniceProperties(

@sushantmane
Copy link
Contributor

Even for draft PRs, having a clear and descriptive title is helpful.

@arjun4084346 arjun4084346 changed the title [DRAFT] initial commit [dvc][vpj] used venice properties to create kafka adapter factories Apr 27, 2025
@arjun4084346 arjun4084346 marked this pull request as ready for review April 27, 2025 02:54
@arjun4084346 arjun4084346 force-pushed the xinfra branch 4 times, most recently from aa47f65 to 5c84429 Compare April 28, 2025 06:59
@arjun4084346 arjun4084346 force-pushed the xinfra branch 2 times, most recently from adf4913 to 3842960 Compare May 1, 2025 01:40
Copy link
Contributor

@sushantmane sushantmane left a comment

Choose a reason for hiding this comment

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

Thanks, @arjun4084346! Let’s update the PR title to use “PubSub” instead of “Kafka” for clarity and accuracy:
"[vpj][dvc][cc][test] Create PubSub adapter factories based on VeniceProperties"

@arjun4084346 arjun4084346 changed the title [dvc][vpj] used venice properties to create kafka adapter factories [vpj][dvc][cc][test] Create PubSub adapter factories based on VeniceProperties May 1, 2025
@arjun4084346 arjun4084346 force-pushed the xinfra branch 2 times, most recently from 580f789 to b807425 Compare May 2, 2025 02:24
@arjun4084346 arjun4084346 requested a review from sushantmane May 2, 2025 02:42
@arjun4084346 arjun4084346 force-pushed the xinfra branch 2 times, most recently from 2a80e77 to 0801cae Compare May 2, 2025 03:44
Copy link
Contributor

@sushantmane sushantmane left a comment

Choose a reason for hiding this comment

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

Overall, the changes look good. Just a few minor comments. Let’s also update the PR description and commit message to better reflect the current changes--they're a bit outdated now.

Copy link
Contributor

@sushantmane sushantmane left a comment

Choose a reason for hiding this comment

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

Thanks, @arjun4084346!

@arjun4084346 arjun4084346 merged commit 04e5179 into linkedin:main May 5, 2025
58 checks passed
WhitneyDeng pushed a commit to WhitneyDeng/venice that referenced this pull request May 16, 2025
…roperties (linkedin#1702)

passing pubsub configs to vpj and venice writer inside VPJ so admin/producer/consumer adapters of 
multiple types can be supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants