public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxoWriter)throws IOException {IndexDeletionPolicy delPolicy = indexWriter.getConfig().getIndexDeletionPolicy();if (!(delPolicy instanceof SnapshotDeletionPolicy)) {throw new IllegalArgumentException("IndexWriter must be created with SnapshotDeletionPolicy");}this.indexWriter = indexWriter;this.taxoWriter = taxoWriter;this.indexSDP = (SnapshotDeletionPolicy) delPolicy;this.taxoSDP = taxoWriter.getDeletionPolicy();this.indexCommit = indexSDP.snapshot();this.taxoCommit = taxoSDP.snapshot();this.version = revisionVersion(indexCommit, taxoCommit);this.sourceFiles = revisionFiles(indexCommit, taxoCommit);}
public IndexAndTaxonomyRevision(IndexWriter indexWriter, SnapshotDirectoryTaxonomyWriter taxonomyWriter){this.indexSdp = indexWriter.Config.IndexDeletionPolicy as SnapshotDeletionPolicy;if (indexSdp == null)throw new ArgumentException("IndexWriter must be created with SnapshotDeletionPolicy", "indexWriter");this.indexWriter = indexWriter;this.taxonomyWriter = taxonomyWriter;this.taxonomySdp = taxonomyWriter.DeletionPolicy;this.indexCommit = indexSdp.Snapshot();this.taxonomyCommit = taxonomySdp.Snapshot();this.version = RevisionVersion(indexCommit, taxonomyCommit);this.sourceFiles = RevisionFiles(indexCommit, taxonomyCommit);}