-
Notifications
You must be signed in to change notification settings - Fork 58
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
Startup metric solves feature request #179 #180
base: master
Are you sure you want to change the base?
Conversation
…f selected rows in a query
Thanks for the PR! I just ran the CI and I could see that tests are failing, are the tests passing locally on your machine? |
Thanks, rerunning CI |
Okay so CI looks good |
This feature looks interesting for us too. Do you know when it will be usable @mdedetrich ? |
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et |
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.
Please add proper documentation here.
|
||
import static io.aiven.connect.jdbc.source.JdbcSourceTaskConfig.TABLES_CONFIG; | ||
|
||
public class StartupMetricUpdater { |
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.
Please add proper documentation here. What does this class do. Are there any design constraints that future developers should know about, etc.
properties.put(JdbcSourceTaskConfig.TABLES_CONFIG, ""); | ||
properties.put(JdbcSourceTaskConfig.QUERY_CONFIG, | ||
"SELECT * FROM \"" + SINGLE_TABLE_NAME + "\" WHERE \"id\" > 0"); | ||
properties.put("name", "soneTaskName"); |
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.
Is this an intentional typo?
This PR introduces the feature discussed in #179.
It allows enabling a custom metric to determine the number of messages/records that will be published into the Kafka topic.
To reduce database load, the corresponding query is executed at startup only. The metric is published via JMX under
io.aiven.connect.jdbc.initialImportCount<task=\"{connector/task_name}\", topic=\"{topic_name}\", [table=\"{table_name}\",
The attribute ‘table’ is optional, depending on the table or query mode.
The feature is disabled by default and can be enabled with the config
JdbcSourceTaskConfig.INITIAL_MESSAGE_COUNT_METRIC_ENABLED_CONFIG