-
Notifications
You must be signed in to change notification settings - Fork 14.6k
KAFKA-18891: KIP-877 add support for RemoteLogMetadataManager and RemoteStorageManager #19286
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
Conversation
fix test
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.
Thanks for the PR. It's really not nice that we need to build the plugin in 2 stages. I left a suggestion to refactor the RemoteLogManager
creation logic. Let's see what people think
I will take a look later. |
server/src/test/java/org/apache/kafka/server/MonitorablePluginsIntegrationTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/kafka/server/MonitorablePluginsIntegrationTest.java
Outdated
Show resolved
Hide resolved
I have updated integration test, PTAL. |
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.
Thanks for the updates, I made another pass and left a few more comments
|
||
remoteStorageManagerPlugin = configAndWrapRSMPlugin(createRemoteStorageManager()); | ||
remoteLogMetadataManagerPlugin = configAndWrapRLMMPlugin(createRemoteLogMetadataManager()); | ||
remoteLogManagerConfigured = true; |
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.
Do we need to keep this field? It's always set to true
in the constructor, so it can never be null if you have an instance of RemoteLogManager
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.
Remove it.
@@ -237,9 +239,12 @@ public RemoteLogManager(RemoteLogManagerConfig rlmConfig, | |||
this.updateRemoteLogStartOffset = updateRemoteLogStartOffset; | |||
this.brokerTopicStats = brokerTopicStats; | |||
this.metrics = metrics; | |||
this.endpoint = endpoint; | |||
|
|||
remoteStorageManagerPlugin = configAndWrapRSMPlugin(createRemoteStorageManager()); |
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.
Could we merge the create and config methods? For example have createRemoteStorageManagerPlugin()
do it all and return Plugin<RemoteStorageManager>
.
Same for remoteLogMetadataManagerPlugin
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.
The reason I did not merge this two methods was if we merge them into one, we will include the configuration step when creating RLMM and RSM in test (we use createRemoteStorageManager
in test).
That means we will miss real configuration step in test if merge them (configuration step should be included in createRemoteStorageManagerPlugin
)
assertEquals(true, ((MonitorableNoOpRemoteStorageManager) remoteLogManager.storageManager()).pluginMetrics); | ||
assertEquals(true, ((MonitorableNoOpRemoteLogMetadataManager) remoteLogManager.remoteLogMetadataManager()).pluginMetrics); |
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.
We can use assertTrue()
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.
Done.
return tags; | ||
} | ||
|
||
} |
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.
nit: missing new line
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.
Done.
} | ||
} | ||
|
||
private static Map<String, String> expectedTags(String config, String clazz) { |
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.
Do we really need this method?
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.
Remove it, thanks.
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.
After merging trunk and move private method to the end, this method is back.
Can you rebase on trunk? |
Update, thanks. |
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.
LGTM
…teStorageManager (apache#19286) 1. Remove `RemoteLogManager#startup` and `RemoteLogManager#onEndpointCreated` 2. Move endpoint creation to `BrokerServer` 3. Move `RemoteLogMetadataManager#configure` and `RemoteLogStorageManager#configure` to RemoteLogManager constructor Reviewers: Mickael Maison <[email protected]>, Ken Huang <[email protected]>, Jhen-Yung Hsu <[email protected]>
RemoteLogManager#startup
andRemoteLogManager#onEndpointCreated
BrokerServer
RemoteLogMetadataManager#configure
andRemoteLogStorageManager#configure
to RemoteLogManager constructorReviewers: Mickael Maison [email protected], Ken Huang
[email protected], Jhen-Yung Hsu [email protected]