SEARCH-2390: Skip getting nodes from repository when no transactions left

Cherry picked from 2141634
This commit is contained in:
Angel Borroy
2020-08-19 12:32:21 +02:00
parent 5080c58198
commit 2b683b055c
@@ -1052,7 +1052,9 @@ public class MetadataTracker extends ActivatableTracker
* @throws JSONException
*/
private int indexBatchOfTransactions(List<Transaction> txBatch)
throws AuthenticationException, IOException, JSONException, ExecutionException, InterruptedException {
throws AuthenticationException, IOException, JSONException, ExecutionException, InterruptedException
{
// Skip transactions without modifications (updates, deletes)
ArrayList<Long> txIds = new ArrayList<>();
for (Transaction tx : txBatch)
@@ -1062,7 +1064,13 @@ public class MetadataTracker extends ActivatableTracker
txIds.add(tx.getId());
}
}
// Skip getting nodes when no transactions left
if (txIds.size() == 0)
{
return 0;
}
// Get Nodes Id properties for every transaction
GetNodesParameters gnp = new GetNodesParameters();
gnp.setTransactionIds(txIds);