You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/04/04 15:27:00 UTC

[jira] [Commented] (NIFI-6016) PutCassandraRecord handles batch size incorrect

    [ https://issues.apache.org/jira/browse/NIFI-6016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16809969#comment-16809969 ] 

ASF subversion and git services commented on NIFI-6016:
-------------------------------------------------------

Commit d36fa6a210261c147453144ef2fb202745319c84 in nifi's branch refs/heads/master from dnsbtchr
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=d36fa6a ]

NIFI-6016 PutCassandraRecord batch size

Adds resetting the batch size to fix broken batch processing

Removes empty line

Signed-off-by: Matthew Burgess <ma...@apache.org>

This closes #3337


> PutCassandraRecord handles batch size incorrect
> -----------------------------------------------
>
>                 Key: NIFI-6016
>                 URL: https://issues.apache.org/jira/browse/NIFI-6016
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.8.0
>            Reporter: Dennis Boettcher
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Having 100 records and a batch size of 10 I expected 10 BatchStatements with each 10 statements to be executed against Cassandra. The actual behaviour is that 1 BatchStatement with 10 statements and 1 BatchStatement with 90 statements is executed against Cassandra. The reason for that is the check of the batch size:
> {code:java}
> if (recordsAdded.incrementAndGet() == batchSize) {
>     connectionSession.execute(batchStatement);
>     batchStatement.clear();
> }
> {code}
> Since 'recordsAdded' is never reset it will match the 'batchSize' either once or never but never more than once.
> I've changed it like this which produces the expected behaviour:
> {code:java}
> if (recordsAdded.incrementAndGet() == batchSize) {
>   connectionSession.execute(batchStatement);
>   batchStatement.clear();
>   recordsAdded.set(0);
> }
> {code}
> Do I expect the wrong thing or is it an issue?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)