[Kde-pim] Problem with bulk fetching of items with 4.8

Shaheed Haque srhaque at theiet.org
Thu Jan 26 23:18:32 GMT 2012


Hi Kevin,

See below...

2012/1/26 Kevin Krammer <kevin.krammer at gmx.at>
>
> Hi Shaheed,
>
> On Thursday, 2012-01-26, Shaheed Haque wrote:
> > Hi,
> >
> > I just upgraded to kde 4.8 etc., and now I'm running into a problem with
> > the Exchange Contacts resource (the one in the playground). Basically, the
> > problem is that I am trying to retrieve ~467,000 contacts, and so rather
> > than the normal scheme of crreating "skeleton" item in retrieveItems(), and
> > then fetching the full item in retrieveItem(), I've been creating the full
> > item (i.e. with a payload) by kicking off a scheduleCustomTask from
> > retrieveItems().
>
> While I don't know what might have changed in the Akonadi libs that causes
> this (Volker might), I'd like to ask what you need the custom task for.
>
> The item retrieval is not bound to the life time of the retrieveItems() call,
> so you could start any operation right in there and just call
> itemRetrievalDone() whenever this (potentially asynchronous) operation is
> done.

That's interesting. I had assumed that retrieveItems() was supposed to
finish "quickly", so I'm doing something like this:

retrieveItems()
{
    ...
    scheduleCustomTask("retrieveGALItems")
    cancelTask()
}

retrieveGALItems()
{
    ...
    fetch 300 items from Exchange
    itemsRetrievedIncremental(items);
    // go around again.
    scheduleCustomTask("retrieveGALItems")
}

> See for example the Maildir resource (kdepim-runtime/resources/maildir), which
> starts a KJob based asynchronous operation in its retrieveItems().
> This job then adds/modifies/deletes items as required and its result signal
> triggers the call the itemsRetrievalDone(), which ends the retrieveItems task.

OK, that looks like what I need to do...I will give that a spin.

> Just in case: the same approach also be used with itemsRetrievedIncremental(),
> I used that combination in a smaller resource[1] which repeatedly gets at most
> 100 items from a webservice until all are done.

Thanks for the helpful reply!

Shaheed


> Cheers,
> Kevin
>
> [1] https://projects.kde.org/projects/playground/pim/akonadi-
> sugarcrm/repository
>
> See the resource and listentriesjob
> --
> Kevin Krammer, KDE developer, xdg-utils developer
> KDE user support, developer mentoring
>
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list