view lucene/src/luan/modules/lucene/LuceneSnapshot.java @ 498:ee55be414a34

Http.response is now mostly luan
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 18 May 2015 00:25:35 -0600
parents ef39bc4d3f70
children
line wrap: on
line source

package luan.modules.lucene;

import java.io.IOException;
import java.util.Collection;
import org.apache.lucene.index.IndexCommit;


public final class LuceneSnapshot {
	private final LuceneIndex index;
	private final IndexCommit ic;

	LuceneSnapshot(LuceneIndex index) throws IOException {
		this.index = index;
		this.ic = index.snapshotDeletionPolicy.snapshot();
	}

	// call in finally block
	public void close() throws IOException {
		index.snapshotDeletionPolicy.release(ic);
	}

	public Collection<String> getFileNames() throws IOException {
		return ic.getFileNames();
	}

}