Re: OzoneHashMap
Leo Mekenkamp <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2004-07-21 at 11:15, Philip C C wrote:
> I am in need of 'OzoneHashMap' implementation for for
> keeping a medium size collection of objects - that
> itself are OzoneObjects.
>
> But in ozone1.2, there is no implementation class for
> OzoneHashMap interface. So I just tryed to implement
> it based on the source 'HashMap.java' from the Sun.
>
> My implementation starts like this..
>
> public class OzoneHashMapImpl extends AbstractOzoneMap
> implements OzoneHashMap {
> static final long serialVersionUID = 1L;
> ....
> ...
> }
>
> Later I realized that, using a hashtable based
> implementation for an Ozone collection class is not a
> good idea because of the difference in inner working
> of Ozone and Hashtable and usage of hashtable inside
> an OzoneObjects causes scalability and performance
> problems.
The main problem in implementing an ozone-aware hashmap/-table is that a
hashtable structure uses linear address space (an array) internally to
store references to objects. Ozone has no support for such a linear
address space, at least not in the sense of 'load object nr N from
structure S from disc'. Either all objects from an array are loaded, or
none, leading to scalability and performance issues.
> So I left with two options - either use
> NodeTreeMapImpl or FullTreeMapImpl. But I don't need
> tree features, because I just need a collection class
> that is fast in adding and retrieving elements.
>
>
> Is anybody having a better implementation of
> 'OzoneHashMap' interface ?
AFAIK not publicly available.
> If my choices are only NodeTreeMapImpl or
> FullTreeMapImpl, which one is better suited for me if
> I want to keep a collection of OzoneObjects (size
> vary 100 - 1000)
NodeTreeMap is probably better suited for large numbers of items (as is
stated in the javadocs).
Cheers,
Leo
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click