-
Sub-task
-
Resolution: Done
-
Optional
-
6.0.0
-
None
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).
- relates to
-
TEIID-161 Move common type conversion logic into a centralized facility for connectors
- Closed