lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <>
Subject Enhance SnapshotDeletionPolicy to allow taking multiple snapshots
Date Tue, 27 Apr 2010 13:59:35 GMT

Today, SnapshotDeletionPolicy (SDP) allows taking only one snapshot. I need
to be able to take multiple snapshots. Consider multiple processes doing
several things on the index - each needs a snapshot of the index so that
commit it needs doesn't get deleted under the covers. SDP is perfect, only
it allows for only one snapshot. So I was thinking to extend it to a
MultiSDP which adds an 'id' parameter to snapshot() and release(). But then,
I was thinking - why shouldn't that exist in SDP? It won't make the API
anymore complicated, and in addition won't introduce yet another DP class.

This can be done in two ways:
1) snapshot() and release() get the extra parameter. For convenience we can
allow for a null id, in which case only one snapshot w/ a null id can be
taken (until it's released). To avoid making up an id if you really need a
single snapshot.
2) add variants snapshot() and release() which take an id as argument. Or
... extend SDP to MultiSDP.

I'd prefer if we keep that functionality in SDP, but if you prefer an
extension to it, then we'll need to allow for easier extension of SDP (I
think we should do that anyway).

What do you think?


View raw message