[Kde-pim] ItemFetchJob - Only fetching items which have a payload

Kevin Krammer krammer at kde.org
Fri May 24 09:09:38 BST 2013


On Thursday, 2013-05-23, Vishesh Handa wrote:
> On Thu, May 23, 2013 at 11:52 PM, Kevin Krammer <krammer at kde.org> wrote:
> > On Thursday, 2013-05-23, Vishesh Handa wrote:
> > > Hey guys
> > > 
> > > In the Akonadi Nepomuk Feeder we have this ItemFetchJob which fetches
> > > all the items in a collection, and then sends them for indexing if
> > > they
> > 
> > aren't
> > 
> > > already indexed.
> > > 
> > > The problem is that many of these items often do not have a payload, so
> > > when we try to fetch the payload in order to index its contents, the
> > 
> > fetch
> > 
> > > fails. This skews the progress and results in the akonadi feeder
> > 
> > attempting
> > 
> > > to fetch a large number of payload-less items on startup.
> > > 
> > > Is there any way to only fetch the items which have a payload in a
> > > cache, but not fetch the actual payload?
> > 
> > Not sure I understand you correctly, but are you looking for
> > Item::cachedPayloadParts()?
> 
> No. That doesn't seem to give me what I want.
> 
> I basically have 6014 items which do not have any data in their RFC822 data
> field
> 
> 
> I got the number by executing this query - "select count(*) from parttable
> where data is null". When I try to fetch any of these 6014 emails it
> complains that there is no payload. The debug messages look like this -
> 
> 
> 210405 no payload

[...]

> But these items are still returned by the ItemFetchJob even with
> cachedPayloadParts(true) or fetchFullPayload(true)

I am not sure what you mean. When you get those item from the fetch job that 
performs the collection listing, does their cachedPayloadParts() method return 
a set that contians RFC822 but when you then fetch the item it doesn't have a 
payload?

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20130524/eb4ebc3b/attachment.sig>
-------------- next part --------------
_______________________________________________
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