tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Who wants my Cassandra session manager for Tomcat?
Date Tue, 03 Apr 2012 22:09:18 GMT
Morten,

On 4/3/12 5:18 PM, Morten Jorgensen wrote:
> I also have an implementation of the Map interface that stores the
> values of each entry as a session attribute. The way many developers
> write web applications is to have a "session bean" (a session attribute)
> that contains a Map that maintains the actual session attributes. This
> is OK if the entire session is persisted as a whole, but it won't
> perform very well with the Cassandra session manager (or the Delta
> Session Manager from what I understand). A developer can replace their
> session bean's HashMap with the SessionMap utility, and the session
> attributes will be treated as proper session attributes by the session
> manager.

This seems like something that is orthogonal to your Manager
implementation, though quite useful.

>> 1. Be relatively self-contained -- i.e. not require much in the way of
>> changes to existing classes
>
> There are no changes to existing classes. My session manager implements
> the existing org.apache.catalina.Manager interface.

Great.

>> 2. Not have any external dependencies (new JAR files, etc.). This might
>> be a problem, depending on whether your code uses the REST API for
>> Cassandra or a direct Java binding.
>
> This could be a problem... I use the Hector API to access Cassandra, and
> there are about 10 JARs required for this API.

Yeah, that could be a problem. I'm going to defer to the other devs for
how tolerant we might be for such a thing to happen. It's possible that
we could make this an optional module where it might be okay to have
additional dependencies.

>> 3. Include good documentation for how to set it up. See the existing
>> session-persistence documentation for a guide, and aim to do a better
>> job ;)
>
> It is extremely easy to set up:
> 1) Configure your Cassandra ring (cluster).
> 2) Copy the required Hector API JARs and the Cassandra session manager
> JAR to tomcat/lib
> 3) Configure your web application descriptor to use the Cassandra
> session manager. Parameters in the web application descriptor point the
> session manager to one or more nodes in your Cassandra ring.

Presumably, you also need to set up Cassandra to have your column family
(etc) definitions available. You'll obviously need to document what that
is (or simply provide the configuration file, which should both document
and specify at the same time).

>> 4. Include test cases and potentially instructions for setting-up a test
>> environment (i.e. you're gonna need a working Cassandra instance).
>
> This is pretty much non-existent right now, so I'll put some effort in
> there. What format do you guys use for your documentation? Do you still
> use docbook?

Look at what's currently in the webapps/docs directory in svn. It's a
fairly simple XML format that gets XSLT'd into .html files at release time.

You could probably look at the existing docs for DeltaManager and
BackupManager here
http://tomcat.apache.org/tomcat-7.0-doc/config/cluster-manager.html and
use them as a guide. Obviously, a Cassandra-based Session Manager can be
used in a non-clustered environment to improve robustness and
durability, so it might eventually go into its own separate config page
instead of being on the cluster-manager.xml page.

Go ahead and create a bugzilla entry for this and mention that a patch
is forthcoming. When you submit a patch to Bugzilla, you have to grant
rights to the ASF so that's better than just saying "here's my Git repo"
or "you can download my patch from my website". Obviously, don't include
any of the binary dependencies: just mention what they are.

-chris


Mime
View raw message