Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDAP-21079] Implement cdap-tms-spanner extension - Part 1 #15750

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

sidhdirenge
Copy link
Contributor

Implement methods like createTopic(), publish() etc.
Follow up PR to include changes for fetch().

createAllTopics() is placed in DelegatingMessagingService() right now as it has dependency on DefaultTopicMetadata class that comes from cdap-tms module. Extensions should not have this dependency. This is a TODO where cdap-tms would be refactored to remove these dependencies.

The code is tested in autopush project.

image

Junits are tested by setting the system properties, as done in SpannerStructuredAdminTest.
Screenshot 2024-12-02 at 8 33 44 PM

image

@sidhdirenge sidhdirenge self-assigned this Dec 2, 2024
@sidhdirenge sidhdirenge added the build Triggers github actions build label Dec 2, 2024
@sidhdirenge sidhdirenge marked this pull request as ready for review December 2, 2024 16:33
@@ -139,13 +142,25 @@ private MessagingService getDelegate() {
LOG.info("Messaging service {} is loaded", messagingService.getName());
try {
messagingService.initialize(new DefaultMessagingServiceContext(this.cConf));
} catch (IOException e) {
createTopics(cConf, messagingService);
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we need this for Spanner implementation. It's a bit strange to create topic here. How are we creating topics for TMS implementation now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not putting this in initialize() method inside spanner implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For TMS implementation, it is part of the start up which is called when MessagingService pod comes up : CoreMessagingService.java#L239

I was planning to do createTopics() in SpannerMessagingService.initialise() but the issue here is the MessagingServiceUtils class is also in cdap-tms. Also, DefaultTopicMetadata which is input to the createTopic() method. This class is in cdap-tms module (same level as the DefaultMessagingServiceContext, DelegatingMessagingService).
We can somehow get away with the DefaultTopicMetadata dependency, as the properties which are set here are not very useful in case of Cloud Spanner. But the MessagingServiceUtils is needed here.

I have added some code comments in the createTopics(), may be, I can add a TODO as well there stating this method can be removed from DelegatingMessagingService after the cdap-tms module refactoring.

Copy link

sonarcloud bot commented Dec 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
43.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Triggers github actions build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants