httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Darroch <chr...@pearsoncmg.com>
Subject Re: svn commit: r724745 - in /httpd/httpd/trunk: include/ap_socache.h modules/ssl/ssl_scache.c
Date Tue, 09 Dec 2008 18:30:51 GMT
Joe Orton wrote:

> * include/ap_socache.h: Use C++ safety wrappers, and rename ->delete
>   to ->remove since the former is a C++ reserved word.

   Thanks again for the socache refactoring!  I've been trying to
keep these two modules up-to-date with both the socache stuff and
Apache ZooKeeper (http://hadoop.apache.org/zookeeper/) releases:

http://people.apache.org/~chrisd/projects/shared_map/

   These were conceived as a way to set up a simple test harness for
all the socache providers, and also to write one for something interesting
outside of the standard SSL cache providers.  With a config like this:

LoadModule shmap_module       modules/mod_shmap.so
LoadModule socache_zookeeper_module modules/mod_socache_zookeeper.so

SharedMapProvider zookeeper localhost:7000
SetHandler shmap-handler

and ZooKeeper listening on localhost:7000 one can get and put stuff
into ZK with simple GET/PUT/DELETE commands.  Other providers can
be swapped in or mapped to various sub-directories:

<Location /shm>
    SharedMapProvider shmcb /home/chrisd/work/install/dlm1/var/httpd/shm
</Location>


   A couple of things came up while I was writing these modules
which I think it would be great to tackle before the socache API is
locked for 2.4:

- have all providers consistently return APR_NOTFOUND from retrieve()
  when an item is not found

- pass a pool argument for temporary allocations to store() and remove()

- return an apr_status_t instead of void from remove() and maybe
  also destroy()


   And -- I know, I know, I'm a glutton for punishment when it comes
to naming issues -- I still feel that "socache" as a name for this
API does it an injustice, since it can be used for a lot more than
just a small-object cache.  The ZK module, at a minimum, I think shows
how you could use it for something that's not a cache at all, and
not necessarily for small objects either.

   Something more generic to the idea of a common, shared key/value
storage API seems like a good idea to me.  But if no one sees this as
a concern, I'll shut up forever about it.  I promise.  :-)

Chris.

-- 
GPG Key ID: 366A375B
GPG Key Fingerprint: 485E 5041 17E1 E2BB C263  E4DE C8E3 FA36 366A 375B

Mime
View raw message