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

Output first and last query log entries for Teradata in summary section using shared state class #567

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sayuzbas-google
Copy link
Collaborator

@sayuzbas-google sayuzbas-google commented Oct 2, 2024

Finding first and last query log entries for Teradata and output in summary section of Dumper.

Current summary section:
Screenshot 2024-10-04 at 14 44 48

Summary section with query log entries:
Screenshot 2024-10-04 at 14 15 57

@sayuzbas-google
Copy link
Collaborator Author

@misolt could you please review it? I implemented shared state approach and applied it for Teradata logs connectors for now, as this approach was the most voted one during discussion. If it is fine, later can apply for the rest of connectors.

@sayuzbas-google sayuzbas-google changed the title Output in summary first and last query log entries for Teradata Output first and last query log entries for Teradata in summary section Oct 3, 2024
@sayuzbas-google sayuzbas-google added enhancement New feature or request good first issue Good for newcomers java Pull requests that update Java code labels Oct 3, 2024
@sayuzbas-google sayuzbas-google changed the title Output first and last query log entries for Teradata in summary section Output first and last query log entries for Teradata in summary section using shared state class Oct 4, 2024
@@ -265,9 +272,26 @@ private boolean checkRequiredTaskSuccess(
return true;
}

private void outputFirstAndLastQueryLogEnries(SummaryLinePrinter linePrinter) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be helpful to add tests for the logic inside this method

import java.util.concurrent.ConcurrentMap;

public class QueryLogSharedState {
public static final ConcurrentMap<QueryLogEntry, ZonedDateTime> queryLogEntries =
Copy link
Collaborator

Choose a reason for hiding this comment

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

The concurrent collection suggests that this class is designed for use from multiple threads. If this is the case, please document how this is done - is it fully thread-safe and what rules need to be followed by developers using it. If any guarantees provided by the class aren't obvious then it's also good to document them.

@sayuzbas-google sayuzbas-google marked this pull request as draft October 9, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants