org.apache.lucene.index

Class SegmentInfos.FindSegmentsFile

Enclosing Class:
SegmentInfos

public static abstract class SegmentInfos.FindSegmentsFile
extends Object

Utility class for executing code that needs to do something with the current segments file. This is necessary with lock-less commits because from the time you locate the current segments file name, until you actually open it, read its contents, or check modified time, etc., it could have been deleted due to a writer commit finishing.

Constructor Summary

FindSegmentsFile(File directory)
FindSegmentsFile(Directory directory)

Method Summary

protected abstract Object
doBody(String segmentFileName)
Subclass must implement this.
Object
run()

Constructor Details

FindSegmentsFile

public FindSegmentsFile(File directory)

FindSegmentsFile

public FindSegmentsFile(Directory directory)

Method Details

doBody

protected abstract Object doBody(String segmentFileName)
            throws IOException
Subclass must implement this. The assumption is an IOException will be thrown if something goes wrong during the processing that could have been caused by a writer committing.

run

public Object run()
            throws IOException

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.