You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "qingbo li (JIRA)" <ji...@apache.org> on 2019/03/30 07:58:00 UTC
[jira] [Updated] (NIFI-6165) PutSolrRecord Improvement
[ https://issues.apache.org/jira/browse/NIFI-6165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
qingbo li updated NIFI-6165:
----------------------------
Affects Version/s: 1.9.1
Description:
{code:java}
while ((record = reader.nextRecord()) != null) {
SolrInputDocument inputDoc = new SolrInputDocument();
writeRecord(record, inputDoc,fieldList,EMPTY_STRING);
inputDocumentList.add(inputDoc);
if(inputDocumentList.size()==batchSize) {
index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
inputDocumentList = new ArrayList<>();
}
index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
}
I think this second index method shoud outside of while ,and I don't catch you why must new ArrayList after first index, index method had cleared the SolrInputDocument List.{code}
was:
{code:java}
while ((record = reader.nextRecord()) != null) {
SolrInputDocument inputDoc = new SolrInputDocument();
writeRecord(record, inputDoc,fieldList,EMPTY_STRING);
inputDocumentList.add(inputDoc);
if(inputDocumentList.size()==batchSize) {
index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
inputDocumentList = new ArrayList<>();
}
index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
}
{code}
> PutSolrRecord Improvement
> -------------------------
>
> Key: NIFI-6165
> URL: https://issues.apache.org/jira/browse/NIFI-6165
> Project: Apache NiFi
> Issue Type: Improvement
> Affects Versions: 1.9.1
> Environment: nifi1.9
> Reporter: qingbo li
> Priority: Major
>
> {code:java}
> while ((record = reader.nextRecord()) != null) {
> SolrInputDocument inputDoc = new SolrInputDocument();
> writeRecord(record, inputDoc,fieldList,EMPTY_STRING);
> inputDocumentList.add(inputDoc);
> if(inputDocumentList.size()==batchSize) {
> index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
> inputDocumentList = new ArrayList<>();
> }
> index(isSolrCloud, collection, commitWithin, contentStreamPath, requestParams, inputDocumentList);
> }
> I think this second index method shoud outside of while ,and I don't catch you why must new ArrayList after first index, index method had cleared the SolrInputDocument List.{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)