[
https://issues.apache.org/jira/browse/NIFI-2876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866382#comment-15866382
]
ASF GitHub Bot commented on NIFI-2876:
--------------------------------------
Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1214#discussion_r101111449
--- Diff:
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/util/TextLineDemarcator.java
---
@@ -150,7 +126,15 @@ public OffsetInfo nextOffsetInfo(byte[] startsWith) {
return offsetInfo;
}
- private int isEol(byte currentByte, int currentIndex) {
+ /**
+ * Checks if the 'currentByte' signifies the end of the text line
(EOL);
+ * that is if the current byte's value is '\n' or '\r'. When the
+ * 'currentByte' is '\r' it will also check for the following byte to
see if
+ * it's '\n'. The returned integer value of this operation signifies
how
+ * many bytes represent the EOL and could only ever be 1 or 2 (if
--- End diff --
It could also be `0` to indicate it is not the end of line, correct?
> Refactor TextLineDemarcator and StreamDemarcator into a common abstract class
> -----------------------------------------------------------------------------
>
> Key: NIFI-2876
> URL: https://issues.apache.org/jira/browse/NIFI-2876
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Oleg Zhurakousky
> Assignee: Oleg Zhurakousky
> Priority: Minor
> Fix For: 1.2.0
>
>
> Based on the work that has been performed as part of the NIFI-2851 we now
> have a new class with a significantly faster logic to perform demarcation of
> the InputStream (TextLineDemarcator). This new class's initial starting point
> was the existing LineDemarcator. They both now share ~60-70% of common code
> which would be important to extract into a common abstract class as well as
> incorporate the new (faster) demarcation logic int StreamDemarcator.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)