I think that you bring up a larger issue. I think that we should write an easy to use native java client that wraps the Thrift RPC. I originally created the RPC to not be limit what could be done. For example, if someone wanted to do a record query and then fetch the entire row I wanted to allow that to happen (even if most of the time it doesn't make sense). If you look at other projects that use Thrift the generated RPC can be complex to use. However wrapper clients in various languages have been built to ease the pain of the RPC. Cassandra is a good example of this with it's many native clients that wrap the Thrift RPC.
Also, I think that if we can change the RPC to be easier to use, we should. It just might not be possible to make it easy to use without writing a native Java client. Thoughts? Aaron On Thu, Sep 13, 2012 at 9:25 AM, Tim Williams <[email protected]> wrote: > On Thu, Sep 13, 2012 at 9:11 AM, Tim Williams <[email protected]> > wrote: > > Can someone validate my understanding of what's supposed to happen for > > result fetching? > > > > For a Row Query (ie. the default, SuperQueryOn == true): > > > > ..if I add a selector (e.g. blurQuery.setSelector(new Selector())), > > then I'm able to traverse directly over RowResults that are fully > > populated, like: > > > > FetchResult fr = r.getFetchResult(); > > fr.getRowResult().getRow().getId(); > > > > ...but then, if I do a Record Query (ie. SuperQueryOn == false): > > > > ...and add the same selector (e.g. blurQuery.setSelector(new > > Selector()), I would have thought, I'd be able to do something > > similar, like: > > > > FetchResult fr = r.getFetchResult(); > > fr.getRecordResult().getRecord().getRecordId(); > > > > .. but the record isn't populated. So, I'm not getting why the > > apparent inconsistency. Do I need to do something different to > > automatically fetch the record results? > > After a spin through BlurResultIterableSearcher, I'll answer myself:) > The default Selector is specifically a Row selector - you have to > create a new Selector and setRecordOnly(true) to get the desired > behavior. > > This does make me wonder we can't use a simple boolean flag > (fetchResults(true)) on the query and internally create the right > selector based on the value of SuperQueryOn? > > Thanks, > --tim >
