[
https://jira.jboss.org/jira/browse/TEIID-169?page=com.atlassian.jira.plug...
]
Steven Hawkins resolved TEIID-169.
----------------------------------
Resolution: Done
Changed BatchedExecution to ResultSetExectuion, which has a next() method to return
results iteratively. There is no need for explicit batching by the connector.
We should clarify the one-to-one relationship between Batch interface
and BasicBatch class in the Connector API
----------------------------------------------------------------------------------------------------------------
Key: TEIID-169
URL:
https://jira.jboss.org/jira/browse/TEIID-169
Project: Teiid
Issue Type: Sub-task
Components: Connector API
Affects Versions: 6.0.0
Reporter: Greg Haber
Assignee: Steven Hawkins
Priority: Optional
Fix For: 6.0.0
When a connector implements the BatchedExecution interface, it is required to implement a
method nextBatch() that returns a Batch. Batch is an interface, and technically can be
implemented however the connector developer wants, as long as it implements "void
addRow(List row)" and "List[] getResults()" - the implementation could
theoretically store the current Batch state internally in a structure that was not a
List[] and just do the needed conversions in these two methods.
However, in every known connector the implementation of BatchedExecution just uses the
BasicBatch implementation we provide for Batch, which takes the straightforward path and
stores the batch internally as an ArrayList.
This best practice is not obvious from the API itself (or even from the doc) - in the
legacy MetaMatrix product we have had an instance where a developer built his own
implementation of Batch (and somehow ran into trouble doing so).
Perhaps we should make this best practice more obvious - one thought is that Batch should
be an abstract class rather than an interface - or perhaps BatchedExecution should require
that nextBatch return BasicBatch or an extension of BasicBatch - or perhaps we should
leave the API as is in this regard and just highlight this in the doc (and javadoc).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira