Hi,

On 19 July 2013 03:04, Dishara Wijewardana <ddwijeward...@gmail.com> wrote:

> Hi Ian,
>
> On Thu, Jul 18, 2013 at 11:15 AM, Ian Boston <i...@tfd.co.uk> wrote:
>
> > Hi,
> > listChildren is only supposed to return a list of immediate children (ie
> no
> > recursion).
> >
> +1
>
> >
> > If code using listChildren wants the entire structure is should call
> > listChildren, using ResourceResolver.listChildren(childResource);
> >
> > Note, ResourceProvider.listChildren will always be called by the
> > ResourceResolver and never directly by the client code.
> >
> > I didn't get you. Provider accepts a resolver as per API. Provider does
> not keep a reference of a resolver. Correct me if I am wrong.
>



I meant that an application wont directly call
ResourceProvider.listChildren(resource);

an application will call ResourceResolver.listChildren(resource) which will
select the appropriate ResorceProvider and then call
ResourceProvider.listChildren(Resource)




>
>
> > also, listChildren should return a true iterator, where the Resources are
> > not loaded into memory until they are requested. Usually that means
> having
> > some form of query to generate pointers to the list of Resources and as
> the
> > iterator.hasNext() and iterator.next() are invoked the iterator loads the
> > resources into memory. That way, if there are millions of children, code
> > can retrieve the first 10 without having to wait for 1M to be loaded
> into a
> > list.
> >
> >
> Big +1 . I was infact thinking about this when I started implementing this.
>  But from a resource what we have is basically its path and from that to
> even at least to check how many children are there in immediate level, we
> have to query from cassandra. As far as I feel we cannot avoid that
> Cassandra call. But we can avoid loading generating resources out from it.
>
>
Agreed, and it might be possible to stream the result of the Cassandra call
so that the Cassandra driver only needs to read the first few bytes before
it can deliver the first resource.

Best Regards
Ian



>
> >
> > Best Regards
> > Ian
> >
> >
> >
> > On 18 July 2013 01:55, Dishara Wijewardana <ddwijeward...@gmail.com>
> > wrote:
> >
> > > Hi Ian and all,
> > > I am in the process of completing the rest of the implementation.
> > >
> > > I would like to know about what is expected to return  from this
> method.
> > > CAssandraResourceProvider.listChildren(Resource).
> > > Is it all the children inside the resource path ? (then we have to
> > > recursively search all nodes until the leaf node). Or shouldn't we
> have a
> > > certain depth to return the results.
> > >
> > >
> > > --
> > > Thanks
> > > /Dishara
> > >
> >
>
>
>
> --
> Thanks
> /Dishara
>

Reply via email to