Github user markobean commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/280#discussion_r56328470
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java
 ---
    @@ -143,72 +199,82 @@ protected void init(final 
ProcessorInitializationContext context) {
             return properties;
         }
     
    -    private int readLines(final InputStream in, final int maxNumLines, 
final OutputStream out, final boolean keepAllNewLines) throws IOException {
    +    private int readLines(final InputStream in, final int maxNumLines, 
final long maxByteCount, final OutputStream out) throws IOException {
             int numLines = 0;
    +        long totalBytes = 0L;
             for (int i = 0; i < maxNumLines; i++) {
    -            final long bytes = countBytesToSplitPoint(in, out, 
keepAllNewLines || (i != maxNumLines - 1));
    +            final long bytes = countBytesToSplitPoint(in, out, totalBytes, 
maxByteCount);
    +            totalBytes += bytes;
                 if (bytes <= 0) {
                     return numLines;
                 }
    -
                 numLines++;
    +            if (totalBytes >= maxByteCount && numLines > maxNumLines) {
    --- End diff --
    
    Agreed. "&& numLines > maxNumLines" condition can be removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to