You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org> on 2009/05/14 10:30:45 UTC

[jira] Updated: (IMAP-8) Let MailboxManager return Lists that could be backed lazyly

     [ https://issues.apache.org/jira/browse/IMAP-8?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Burrell Donkin updated IMAP-8:
-------------------------------------

    Fix Version/s:     (was: 0.2)
                   0.1

> Let MailboxManager return Lists that could be backed lazyly
> -----------------------------------------------------------
>
>                 Key: IMAP-8
>                 URL: https://issues.apache.org/jira/browse/IMAP-8
>             Project: JAMES Imap
>          Issue Type: Improvement
>          Components: Mailbox
>    Affects Versions: 0.1
>            Reporter: Joachim Draeger
>            Priority: Minor
>             Fix For: 0.1
>
>
> At the moment MailboxManager uses arrays which is IMO the most clearest and easiest way.
> I still follow the idea of requesting exactly the needed data to reduce the count of queries to e.g. a RDBMS.
> But for example requesting a bunch of headers from a mailbox that could have 10000 msgs by a modem-user could cost a lot of memory for a longer period.
> Future implementations could decide to back the list lazily (at least the Iterator) by chunks of 500 msgs.
> So using the Iterator would be best practice. 
> Why not use just Iterator? 	
>  - convenient use of the list methods (toArray, size(), get(i))
>  - possible optimization like "select count(*)" for size()
>  - today's implementation could just use an ArrayList
>  - future implementations will not be too complicated by using wrappers
>    and AbstractList/AbstractSequentialList
> Well, one pitfall are intermediate deletions of results. When the size() has been requested by the client, the list could contain nulls.
> To fulfill the List contract the Iterator has to do the same.
> Saying: "If you didn't call size() before, you don't need to care about null results" would be bad.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org