[
https://issues.apache.org/jira/browse/ACCUMULO-697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421512#comment-13421512
]
Billie Rinaldi commented on ACCUMULO-697:
-----------------------------------------
A related feature in our API is InputFormatBase<K,V> which you can extend to
provide any type of K,V. This was to support the ChunkInputFormat which wraps
a set of Values in an InputStream.
I could see making ScannerBase extend Iterable<E> instead of
Iterable<Entry<Key,Value>>. Then individual scanner implementations could
provide whatever types they wanted, e.g. Iterable<KeyValue>,
Iterable<Entry<Key,Value>>, Iterable<Entry<Key,Whatever>>. We could model the
use of these after the IsolatedScanner and ClientSideIteratorScanner, e.g.
Scanner scanner = new
ClientSideIteratorScanner(connector.createScanner(tableName, authorizations)).
The default types could stay Entry<Key,Value>, and you would use a client side
scanner wrapper to translate them.
> Break Scanner parameterization from Key,Value to Key,{Something}
> ----------------------------------------------------------------
>
> Key: ACCUMULO-697
> URL: https://issues.apache.org/jira/browse/ACCUMULO-697
> Project: Accumulo
> Issue Type: Improvement
> Components: client
> Affects Versions: 1.5.0
> Reporter: Josh Elser
> Assignee: Josh Elser
>
> When writing a custom iterator, many times the iterator has some semantic
> knowledge of what each Key/Value being returned actually means (e.g. A word
> count could be returning Key/Value but really is returning an Integer/Long
> count in the Value). This forces the client to know what is going to be
> returned and handle the cast/transformation.
> I believe it should be fairly straightforward to encapsulate this
> transformation inside the Accumulo client code. I plan on investigating the
> possibility of changing the ScannerBase impl, or perhaps making a
> TypedScannerBase, in which the iterator at the "top" of the stack for a scan
> can return something other than a Value to the client.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira