Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9384

Loop improvements

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.5.0
    • Component/s: streams
    • Labels:
      None
    • Flags:
      Patch

      Description

      Loop improvements

      streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractSegments.java

      I think we can improve this loop

       

      // 코드 자리 표시자
      final long[] segmentIds = new long[list.length];
      for (int i = 0; i < list.length; i++) {
          segmentIds[i] = segmentIdFromSegmentName(list[i], dir);
      }
      
      // open segments in the id order
      Arrays.sort(segmentIds);
      for (final long segmentId : segmentIds) {
          if (segmentId >= 0) {
              getOrCreateSegment(segmentId, context);
          }
      }
      
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                high.lee highluck
                Reporter:
                high.lee highluck
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: