You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/01/08 18:08:08 UTC

[GitHub] [druid] capistrant commented on pull request #10287: allow the LogUsedSegments duty to be skipped

capistrant commented on pull request #10287:
URL: https://github.com/apache/druid/pull/10287#issuecomment-756913585


   > I like this log message from LogUsedSegments and have found it very useful:
   > 
   > ```java
   > log.info("Found [%,d] used segments.", params.getUsedSegments().size());
   > ```
   > 
   > It's nearly free, since `params.getUsedSegments()` is something that's just passed into the method and doesn't need to be computed. Instead of a config to disable the duty, how about about removing this block and leaving everything else the same:
   > 
   > ```java
   >     DataSourcesSnapshot dataSourcesSnapshot = params.getDataSourcesSnapshot();
   >     for (DataSegment segment : dataSourcesSnapshot.iterateAllUsedSegmentsInSnapshot()) {
   >       if (segment.getSize() < 0) {
   >         log.makeAlert("No size on a segment")
   >            .addData("segment", segment)
   >            .emit();
   >       }
   >     }
   > ```
   > 
   > I'm pretty sure this is ancient debugging code and we can safely get rid of it.
   > 
   > The other potentially expensive part is skipped if log level is INFO or higher. (Which is the default, so it shouldn't be a problem.)
   
   I think I like this idea the most considering everything we have learned since I created the PR. I am going to amend the PR to remove the configuration to skip the duty. Instead we will remove this legacy code and leave everything else as is. Maybe in the future this duty will change and become expensive resulting in having the ability to skip become beneficial. but lets not put the cart ahead of the horse and over complicate things today.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org