You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (JIRA)" <ji...@apache.org> on 2019/03/06 18:34:00 UTC
[jira] [Updated] (NIFI-6016) PutCassandraRecord handles batch size
incorrect
[ https://issues.apache.org/jira/browse/NIFI-6016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Burgess updated NIFI-6016:
-------------------------------
Status: Patch Available (was: Open)
> 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: 20m
> 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)