accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Turner <>
Subject Re: feedback on Typo
Date Wed, 15 Aug 2012 13:38:04 GMT
On Wed, Aug 15, 2012 at 9:19 AM, Ed Kohlwey <> wrote:
> I think its not just about types, but specifically primitive types and
> tuples.
Right.  And sorting is another very important aspect.   User want to
do things like store dates that sort in reverese order as part of a
tuple in the row.  We tell them its possible if they encode their data
in a certain way.  And we also tell them "oh, BTW if you have binary
data in your tuple it can be tricky to get it right".  So one goal of
Typo is to make this easier for users.   I think something like the
following would do this and get the lexicographic sort order correct.

class RDTypo extends Typo<Pair<Long, Date>,String,String,Text> {
  public RDTypo() {
    super(new PairLexicoder<Long,Date>(new LongLexicoder(), new
ReverseLexicoder<Date>(new DateLexicoder())),
             new StringLexicoder(), new StringLexicoder(), new TextLexicoder());

I so wish that Java had typedef, it could make the Typo API much more
concise.  I never thought I would actually miss C++ template
programming :)  I still need to do some more research on Java generics
to see if I can make things more concise.

> So its avoiding being a full-fledged ORM solution like Gora.
>> Am I right in assuming that this is about simplifying the API for
>> storing typed data in the key, and not about providing a mechanism for
>> query. Isn't this really just about storing stuff you've already
>> decided was a good structure for whatever your query mechanism is?

View raw message