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 "Joachim Draeger (JIRA)" <se...@james.apache.org> on 2006/12/12 11:34:21 UTC
[jira] Created: (JAMES-734) Let MailboxManager return Lists that
could be backed lazyly
Let MailboxManager return Lists that could be backed lazyly
-----------------------------------------------------------
Key: JAMES-734
URL: http://issues.apache.org/jira/browse/JAMES-734
Project: James
Issue Type: Improvement
Components: IMAPServer
Affects Versions: Trunk
Reporter: Joachim Draeger
Priority: Minor
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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Commented: (JAMES-734) Let MailboxManager return Lists that
could be backed lazyly
Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/JAMES-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541303 ]
Robert Burrell Donkin commented on JAMES-734:
---------------------------------------------
Consensus seems to be that Iterators are the best choice. All arrays and lists in the MailboxAPI should be replaced by Iterators,
> Let MailboxManager return Lists that could be backed lazyly
> -----------------------------------------------------------
>
> Key: JAMES-734
> URL: https://issues.apache.org/jira/browse/JAMES-734
> Project: James
> Issue Type: Improvement
> Components: IMAPServer
> Affects Versions: Trunk
> Reporter: Joachim Draeger
> Priority: Minor
>
> 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
[jira] Updated: (IMAP-8) Let MailboxManager return Lists that could
be backed lazyly
Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/IMAP-8?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Burrell Donkin updated IMAP-8:
-------------------------------------
Component/s: Mailbox
Affects Version/s: 0.1
Fix Version/s: 0.2
Mailbox API needs review and revision. This issues should be included as part of that exercise.
> 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.2
>
>
> 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
[jira] Closed: (IMAP-8) Let MailboxManager return Lists that could
be backed lazyly
Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/IMAP-8?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Burrell Donkin closed IMAP-8.
------------------------------------
Resolution: Fixed
This has now been done.
> 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.2
>
>
> 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
[jira] Updated: (IMAP-8) Let MailboxManager return Lists that could
be backed lazyly
Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
[ 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