[
https://issues.apache.org/jira/browse/NIFI-6165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
qingbo li updated NIFI-6165:
----------------------------
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 the second run index method shoud outside of while ,and I don't catch
that why must new ArrayList after run index methond, 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);
}
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}
> 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 the second run index method shoud outside of while ,and I don't catch
> that why must new ArrayList after run index methond, index method had cleared
> the SolrInputDocument List.{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)