Accept iterators/generators for execute_concurrent()

Description

Currently, execute_concurrent() and execute_concurrent_with_args() convert the passed in statements to a list. It would be better to handle iterators/generators naturally.

As suggested by the TODO comment in concurrent.py, special care needs to be taken to track the correct index for statements. This means results should be stored as a list of (index, result) tuples. Before returning the results, this list would be sorted and then processed to discard the index.

The other challenge mentioned in the TODO comment (figuring out when the last operation has finished) can be accomplished with a countdown latch. See the patch for CASSANDRA-7405 for an example of this.

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Tyler Hobbs

Fix versions

Labels

Reproduced in

None

PM Priority

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Priority

Major
Configure