[netcdf-java] Persisting a NetcdfDatasetCache
Nick Bower
nick.bower at metoceanengineers.com
Mon Feb 18 02:23:22 MST 2008
Jon you're absolutely right - turns out after a refactor (which included
moving to persistent backend) we're caching just standard linkedlist,
string and date objects (ie all serializable). I need to update the use
of our ehcache api in this case. Sorry for any confusion.
Jon Blower wrote:
> Hi Nick,
>
> Oh wait, I just read the last sentence of your post properly, sorry ;-)
>
>
>> I'm using EHCache with persistent filesystem backend to recall
>> non-Serializable objects between JVM restarts in non-Netcdf software.
>>
>
> How are you doing this? According to the ehcache documentation at
> http://ehcache.sourceforge.net/documentation/storage_options.html:
>
> "Only Elements which are Serializable can be placed in the DiskStore.
> Any non serializable Elements which attempt to overflow to the
> DiskStore will be removed instead, and a WARNING level log message
> emitted."
>
> Perhaps the ehcache docs haven't kept up with the software (although I
> still can't imagine how non-serializable objects can be persisted...)
>
> Cheers, Jon
>
> On Feb 18, 2008 8:28 AM, Jon Blower <jdb at mail.nerc-essc.ac.uk> wrote:
>
>> Hi Nick,
>>
>> Thanks for this. Unfortunately unless NetcdfDataset becomes
>> Serializable then persistence to disk will not be possible with
>> ehcache (non-serializable object caching only works for in-memory
>> caches). Another option of course would be to persist to a (perhaps
>> embedded) database with Hibernate or similar. However, I think the
>> simplest option would be to make NetcdfDataset serializable and use
>> ehcache or even something ad-hoc.
>>
>> Cheers, Jon
>>
>>
>> On Feb 18, 2008 6:21 AM, Nick Bower <nick.bower at metoceanengineers.com> wrote:
>>
>>> I was curious seeing this post and so noticed the NetcdfDatasetCache
>>> just now.
>>>
>>> Depending on what Jon says, I'm guessing there may be 2 options for
>>> integration here?
>>>
>>> 1) simply persisting cache state (thus reloading datasets on restart)
>>> 2) persisting cached objects properly by looking into changing
>>> NetcdfDatasetCache.cache from an ArrayList to an instance of EHCache's
>>> CacheManager. Just have to try it and see as NetcdfDataset is not
>>> serializable although EHCache specifically deals with non-serializable.
>>>
>>> I'm using EHCache with persistent filesystem backend to recall
>>> non-Serializable objects between JVM restarts in non-Netcdf software.
>>>
>>>
>>>
>>> Jon Blower wrote:
>>>
>>>> Hi,
>>>>
>>>> My server application (ncWMS) uses the NetcdfDatasetCache as an
>>>> in-memory store of metadata to increase performance and reduce the
>>>> need to continually reload metadata from files. It would be really
>>>> useful if I could persist the cache to disk so that the metadata is
>>>> available following a server restart (saves trawling through all the
>>>> data files again).
>>>>
>>>> Is it possible to save the contents of a NetcdfDatasetCache to disk?
>>>> I notice that it isn't marked Serializable.
>>>>
>>>> Cheers, Jon
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> --------------------------------------------------------------
>> Dr Jon Blower Tel: +44 118 378 5213 (direct line)
>> Technical Director Tel: +44 118 378 8741 (ESSC)
>> Reading e-Science Centre Fax: +44 118 378 6413
>> ESSC Email: jdb at mail.nerc-essc.ac.uk
>> University of Reading
>> 3 Earley Gate
>> Reading RG6 6AL, UK
>> --------------------------------------------------------------
>>
>>
>
>
>
>
--
Regards, Nick
____________________________________
Dr. Nicholas Bower Ph.D.
Senior Software Developer/Integrator, IT
nick.bower at metoceanengineers.com <mailto:nick.bower at metoceanengineers.com>
MOELogo
*RPS Metocean Engineers*
31 Bishop Street, Jolimont WA 6014
*Phone:* +61 8 9387 7955 *Fax:* +61 8 9387 6686
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.unidata.ucar.edu/mailing_lists/archives/netcdf-java/attachments/20080218/96b55337/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metOceanHeader-small.jpg
Type: image/jpeg
Size: 4462 bytes
Desc: not available
Url : http://mailman.unidata.ucar.edu/mailing_lists/archives/netcdf-java/attachments/20080218/96b55337/attachment.jpg
More information about the netcdf-java
mailing list