[osg-users] Move write cache file from databasepager.cpp tocurl?

Lilinx lilinx at 21cn.com
Tue Nov 24 07:22:54 PST 2009


hi, Robert Osfield
              Sorry my english.
     My meaning is that, for example:
             On server, it exists three files:
                       1.ive
                       image1.dds
                       image2.dds
            where imag1.dds and image2.dds were used by 1.ive.
    when we use osgDB::readNodeFile( "http://xxx.yyy.com/1.ive"), the curl plugin will
    downloads 1.ive to a stream, then reads this stream.  In reading progess, the curl plugin
    will download imag1.dds and image2.dds.  If downloading image1.dds failed,  the 
     "osgDB::readNodeFile( "http://xxx.yyy.com/1.ive")"    will still success.  Now , we get a
     node for 1.ive missing image1.dds. Then we use osgDB::WriteNodeFile(node,"...") to 
     write node to cache file.  The cache file will miss all infomation for image1.dds also. 

	I change  three file to solve this.
        1. In header file "FileCache", move "removeFileFromBlackListed" from protected to public.
        2. In DatabasePager.cpp, if find some file need to write to cache,  we add a " writetocachefile" 
            flags to option string.  (near line 572)
        3. In curl plugin, if find "writetocachefile" in option string, we write the stream to cachefile. (near line 395)
        4. In DatabasePager.cpp, if find cachefile in local cache dir(meaning write to cache file sucess), we do  "removeFileFromBlackListed".
  
        The attach is "FileCache" , "DatabasePager.cpp" and "ReaderWriterCURL.cpp".

                                     Thanks.
                                                                                     Lilin Xiong

	

======= 2009-11-24 19:39:40 =======

>Hi Xlll? Lilinx?  Could you please sign with your name so we don't
>have to guess who we are addressing.
>
>On Tue, Nov 24, 2009 at 10:01 AM, xll <lilinx at 21cn.com> wrote:
>> hi, all
>>
>>         I want to move write cache file from databasepager.cpp to curl.
>> Maybe it is better.
>
>The DatabasePager now uses osgDB::FileCache to manage the local file
>cache.  The DatabasePager has to know about the FileCache as it has to
>decide which database thread to use to read it - as it needs to avoid
>using the http database thread for reading local tiles as doing so
>stalls paging unnecessarily.
>
>>
>>        for example:   There are some files on server:
>>
>>                     1.ive   image1.dds  image2.dds.  Image1.dds and
>> image2.dds were used by 1.ive.
>>
>>         when downloading,  1.ive  is ok,  image1.dds is failed, image2.dds
>> is ok.  when we using writeNodeFile for 1.ive,  the result will be wrong.
>>
>> But if  we use curl to write stream indirectly,  the result will be ok.
>
>I'm afraid I can't work out what the issue is here.  Could you explain
>why the result will be wrong, and how use of curl to write the stream
>would solve anything.
>
>Robert.
>_______________________________________________
>osg-users mailing list
>osg-users at lists.openscenegraph.org
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

= = = = = = = = = = = = = = = = = = = =

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DatabasePager.cpp
Type: application/octet-stream
Size: 81857 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091124/ff145916/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileCache
Type: application/octet-stream
Size: 3388 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091124/ff145916/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReaderWriterCURL.cpp
Type: application/octet-stream
Size: 17666 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091124/ff145916/attachment-0005.obj>


More information about the osg-users mailing list