You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "highluck (Jira)" <ji...@apache.org> on 2020/01/08 09:30:00 UTC
[jira] [Updated] (KAFKA-9384) Loop improvements
[ https://issues.apache.org/jira/browse/KAFKA-9384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
highluck updated KAFKA-9384:
----------------------------
Priority: Minor (was: Major)
> Loop improvements
> ------------------
>
> Key: KAFKA-9384
> URL: https://issues.apache.org/jira/browse/KAFKA-9384
> Project: Kafka
> Issue Type: Improvement
> Components: streams
> Affects Versions: 2.4.0
> Reporter: highluck
> Priority: Minor
> Fix For: 2.4.0
>
>
> Loop improvements
> [streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractSegments.java|https://github.com/apache/kafka/pull/7277/files#diff-337cba828184b5a77a6b1472697b758a]
> I think we can improve this loop
>
> {code:java}
> // 코드 자리 표시자
> 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);
> }
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)