-
Notifications
You must be signed in to change notification settings - Fork 342
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
base: develop
Are you sure you want to change the base?
Conversation
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cdap-tms/src/main/java/io/cdap/cdap/messaging/service/CoreMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
...saging-ext-spanner/src/main/java/io/cdap/cdap/messaging/spanner/SpannerMessagingService.java
Outdated
Show resolved
Hide resolved
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
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.
Junits are tested by setting the system properties, as done in SpannerStructuredAdminTest.