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

Cleanup: Fix grammar in error message, also improve readability. #13451

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

mayankshriv
Copy link
Contributor

  • Fixed grammar.
  • Now logging table name first, before the list of segments, for better readability.

@mayankshriv mayankshriv force-pushed the msg-cleanup branch 2 times, most recently from dd847fd to 822afe5 Compare June 20, 2024 20:38
@@ -243,7 +243,7 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
Set<String> unavailableSegments = entry.getValue();
numUnavailableSegments += unavailableSegments.size();
brokerResponse.addException(QueryException.getException(QueryException.SERVER_SEGMENT_MISSING_ERROR,
String.format("Find unavailable segments: %s for table: %s", unavailableSegments, tableName)));
String.format("Found unavailable segments for table {%s}: {%s}", tableName, unavailableSegments)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
String.format("Found unavailable segments for table {%s}: {%s}", tableName, unavailableSegments)));
String.format("Found unavailable segments for table %s: %s", tableName, unavailableSegments)));

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding number of unavailable segments, and only log up to 10 segments. If there are more than 10 segments unavailable, append ... after the list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @Jackie-Jiang. Also, given that error path will be very infrequent, I felt it was ok to use stream way to build the string as opposed to StringBuilder and for loop.

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 61.98%. Comparing base (59551e4) to head (ddee792).
Report is 676 commits behind head on master.

Files Patch % Lines
...requesthandler/MultiStageBrokerRequestHandler.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13451      +/-   ##
============================================
+ Coverage     61.75%   61.98%   +0.23%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2557     +121     
  Lines        133233   141194    +7961     
  Branches      20636    21914    +1278     
============================================
+ Hits          82274    87519    +5245     
- Misses        44911    47021    +2110     
- Partials       6048     6654     +606     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 35.36% <0.00%> (-26.35%) ⬇️
java-21 61.87% <0.00%> (+0.25%) ⬆️
skip-bytebuffers-false 61.95% <0.00%> (+0.20%) ⬆️
skip-bytebuffers-true 61.84% <0.00%> (+34.11%) ⬆️
temurin 61.98% <0.00%> (+0.23%) ⬆️
unittests 61.98% <0.00%> (+0.23%) ⬆️
unittests1 46.67% <ø> (-0.22%) ⬇️
unittests2 27.50% <0.00%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -243,7 +244,8 @@ protected BrokerResponse handleRequest(long requestId, String query, @Nullable S
Set<String> unavailableSegments = entry.getValue();
numUnavailableSegments += unavailableSegments.size();
brokerResponse.addException(QueryException.getException(QueryException.SERVER_SEGMENT_MISSING_ERROR,
String.format("Find unavailable segments: %s for table: %s", unavailableSegments, tableName)));
String.format("Found unavailable segments for table %s: %s", tableName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding the count Found %d unavailable segments ...

* Fixed grammar.
* Now logging table name first, before the list of segments, for better readability.
@mayankshriv mayankshriv merged commit d1cf485 into apache:master Jun 24, 2024
20 checks passed
@mayankshriv mayankshriv deleted the msg-cleanup branch June 24, 2024 19:50
suyashpatel98 pushed a commit to suyashpatel98/pinot that referenced this pull request Jul 6, 2024
…che#13451)

* Fixed grammar.
* Now logging table name first, before the list of segments, for better readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants