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

[GitHub] [incubator-pinot] npawar commented on a change in pull request #4078: Reduce logging in controller

npawar commented on a change in pull request #4078: Reduce logging in controller
URL: https://github.com/apache/incubator-pinot/pull/4078#discussion_r272419560
 
 

 ##########
 File path: pinot-controller/src/main/java/org/apache/pinot/controller/validation/OfflineSegmentIntervalChecker.java
 ##########
 @@ -81,18 +83,23 @@ private void validateOfflineSegmentPush(TableConfig tableConfig) {
     SegmentsValidationAndRetentionConfig validationConfig = tableConfig.getValidationConfig();
     if (numSegments >= 2 && StringUtils.isNotEmpty(validationConfig.getTimeColumnName())) {
       List<Interval> segmentIntervals = new ArrayList<>(numSegments);
-      List<String> segmentsWithInvalidInterval = new ArrayList<>();
+      List<String> segmentsWithInvalidInterval = new ArrayList<>(MAX_SEGMENTS_WITH_INVALID_INTERVALS_TO_LOG);
+      int numSegmentsWithInvalidIntervals = 0;
       for (OfflineSegmentZKMetadata offlineSegmentZKMetadata : offlineSegmentZKMetadataList) {
         Interval timeInterval = offlineSegmentZKMetadata.getTimeInterval();
         if (timeInterval != null && TimeUtils.timeValueInValidRange(timeInterval.getStartMillis()) && TimeUtils
             .timeValueInValidRange(timeInterval.getEndMillis())) {
           segmentIntervals.add(timeInterval);
         } else {
-          segmentsWithInvalidInterval.add(offlineSegmentZKMetadata.getSegmentName());
+          numSegmentsWithInvalidIntervals ++;
+          if (segmentsWithInvalidInterval.size() < MAX_SEGMENTS_WITH_INVALID_INTERVALS_TO_LOG) {
+            segmentsWithInvalidInterval.add(offlineSegmentZKMetadata.getSegmentName());
+          }
         }
       }
       if (!segmentsWithInvalidInterval.isEmpty()) {
-        LOGGER.warn("Table: {} has segments with invalid interval: {}", offlineTableName, segmentsWithInvalidInterval);
+        LOGGER.warn("Table: {} has {} segments with invalid interval. Listing up to {}: {}", offlineTableName,
 
 Review comment:
   hmm, that's a good idea. Periodically printing this is not really helping anyway. Will add that as a followup.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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