> > |
%META:TOPICINFO{author="honicky" date="1069179300" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="DLibraryDesign"}%
The proxy server (RabbIT) currently stores meta-data and data seperately: there is a single file which contains cache data, plus the header of each of the request which resulted in the object being cached. This file is managed by the NCache and NCacheEntry objects. This is great, since it provides a single class through which all the metadata.
Data, however, is managed by several classes since it is streamed, rather than read and then written (a good design for a proxy cache, but which complicates things for us). The relevant classes are
- handler.BaseHandler
- proxy.PartialCacher
- ...
Both interfaces (lucene and rabbit) want to deal with streams, so I have defined a set of classes that allow you to pass references to streams across process boundaries. RemoteIO, I define a detailed interface for remote streams. The code is in CVS under the package remoteio.
With remote streams, the interface to the RemoteRepository will work as follows
- Somebody adds a cache entry, based on the HTTP header. I think this is
BaseHandler
- Adding an
NCacheEntry to the NCache causes the cache to send an RMI call to the RemoteRepository which creates a pending entry, and returns a RemoteOutputStream
- The
RemoteOutputStream is added to the NCacheEntry
- Next,
BaseHandler adds the stream from the cache to the MultiStream that it maintains to multiplex the data from the HTTP response to the client and a file. The RemoteOutputStream replaces that file.
- Finally, when the stream is closed, the
RemoteRepository is notified, and the new cache data is indexed.
|