Thanks for the patch Akshay!
I think we should allow a user to specify his custom IndexDeletionPolicy too. We can provide a default implementation with all the options specified in the issue description. So I propose that we have the following syntax:
<deletionPolicy class="com.MyDeletionPolicy" />
The default implementation will be SolrIndexDeletionPolicy which can be configured through a NamedList. Any custom deletion policy will be initialized with a NamedList if it implements NamedListInitializedPlugin.
<!-- Store only the commits with optimize.Non optimized commits will get deleted by lucene when
the last IndexWriter/IndexReader using this commit point is closed -->
To facilitate replication, we can have a wrapper over the IndexDeletionPolicy which can provide us the features needed for replication (
SOLR-561). We need access to a list of non-deleted IndexCommit instances, a way to lookup IndexCommit given a version as well as the latest commit point.