accumulo Scanner
HI Scanner full table, but need the data in each row, is the rowkey of the same data, save data to JavaBean. <http://apache-accumulo.1065345.n5.nabble.com/file/n12506/accumulo.png> -- View this message in context: http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506.html Sent from the Developers mailing list archive at Nabble.com.
Re: accumulo Scanner
You can use the WholeRowIterator to get a map of all key/value pairs for a single row. It works as long as your row is small enough to fit in memory. I don't know of any libraries convert between a row and a JavaBean. Typo[2] is the closest project I know of. -Russ 1: http://accumulo.apache.org/1.6/apidocs/org/apache/accumulo/core/iterators/user/WholeRowIterator.html 2:https://github.com/keith-turner/typo On Wed, Dec 10, 2014 at 6:14 PM, panqing...@163.com wrote: > HI > Scanner full table, but need the data in each row, is the rowkey of the > same > data, save data to JavaBean. > > <http://apache-accumulo.1065345.n5.nabble.com/file/n12506/accumulo.png> > > > > -- > View this message in context: > http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506.html > Sent from the Developers mailing list archive at Nabble.com. >
Re: accumulo Scanner
One option is to implement a class extending the RowEncodingIterator: http://accumulo.apache.org/1.6/apidocs/org/apache/accumulo/core/iterators/user/RowEncodingIterator.html <http://accumulo.apache.org/1.6/apidocs/org/apache/accumulo/core/iterators/user/RowEncodingIterator.html> I personally have implementations that will automatically return a serialized protocol buffer or thrift object based on keys in the data. I think it should be possible to implement an iterator with rowEncoder and rowDecoder methods to convert to a JavaBean. > On Dec 10, 2014, at 9:55 PM, Russ Weeks wrote: > > You can use the WholeRowIterator to get a map of all key/value pairs for a > single row. It works as long as your row is small enough to fit in memory. > > I don't know of any libraries convert between a row and a JavaBean. Typo[2] > is the closest project I know of. > > -Russ > > 1: > http://accumulo.apache.org/1.6/apidocs/org/apache/accumulo/core/iterators/user/WholeRowIterator.html > 2:https://github.com/keith-turner/typo > > On Wed, Dec 10, 2014 at 6:14 PM, panqing...@163.com > wrote: > >> HI >> Scanner full table, but need the data in each row, is the rowkey of the >> same >> data, save data to JavaBean. >> >> <http://apache-accumulo.1065345.n5.nabble.com/file/n12506/accumulo.png> >> >> >> >> -- >> View this message in context: >> http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506.html >> Sent from the Developers mailing list archive at Nabble.com. >>
Re: accumulo Scanner
I try to use the WholeRowIterator, the same rowkey data into a line, Now, Value contains ColumnFamily, ColumnQualifier, value,but the value of Value should be how to analysis? for (Entry entry : scanner) { log.info("" + entry.getKey() + "," + entry.getValue()); } -- View this message in context: http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506p12552.html Sent from the Developers mailing list archive at Nabble.com.
Re: accumulo Scanner
You're going to want to use WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()) for that one. You can do: for(Entry entry : scanner) { for(Entry actualEntry : WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()).entrySet()) { // do something with actualEntry } } On Thu, Dec 11, 2014 at 10:24 PM, panqing...@163.com wrote: > I try to use the WholeRowIterator, the same rowkey data into a line, Now, > Value contains ColumnFamily, ColumnQualifier, value,but the value of Value > should be how to analysis? > > for (Entry entry : scanner) { > log.info("" + entry.getKey() + "," + entry.getValue()); > } > > > > > -- > View this message in context: > http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506p12552.html > Sent from the Developers mailing list archive at Nabble.com. >
Re: accumulo Scanner
Thank you for your reply, have time to Chinese play. -- View this message in context: http://apache-accumulo.1065345.n5.nabble.com/accumulo-Scanner-tp12506p12554.html Sent from the Developers mailing list archive at Nabble.com.