mirror of https://github.com/apache/lucene.git
LUCENE-811: make SegmentInfos class package-private again
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@511384 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
64449841ed
commit
1486b19a4f
|
@ -16,6 +16,10 @@ API Changes
|
||||||
This was done to better call out the possible root causes of an
|
This was done to better call out the possible root causes of an
|
||||||
IOException from these methods. (Mike McCandless)
|
IOException from these methods. (Mike McCandless)
|
||||||
|
|
||||||
|
2. LUCENE-811: make SegmentInfos class, plus a few methods from related
|
||||||
|
classes, package-private again (they were unnecessarily made public
|
||||||
|
as part of LUCENE-701). (Mike McCandless)
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
|
|
||||||
1. LUCENE-804: Fixed build.xml to pack a fully compilable src dist. (Doron Cohen)
|
1. LUCENE-804: Fixed build.xml to pack a fully compilable src dist. (Doron Cohen)
|
||||||
|
|
|
@ -71,7 +71,7 @@ final class IndexFileNames {
|
||||||
* @param extension -- extension of the filename (including .)
|
* @param extension -- extension of the filename (including .)
|
||||||
* @param gen -- generation
|
* @param gen -- generation
|
||||||
*/
|
*/
|
||||||
public static final String fileNameFromGeneration(String base, String extension, long gen) {
|
static final String fileNameFromGeneration(String base, String extension, long gen) {
|
||||||
if (gen == -1) {
|
if (gen == -1) {
|
||||||
return null;
|
return null;
|
||||||
} else if (gen == 0) {
|
} else if (gen == 0) {
|
||||||
|
|
|
@ -157,7 +157,7 @@ public abstract class IndexReader {
|
||||||
|
|
||||||
return (IndexReader) new SegmentInfos.FindSegmentsFile(directory) {
|
return (IndexReader) new SegmentInfos.FindSegmentsFile(directory) {
|
||||||
|
|
||||||
public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
||||||
|
|
||||||
SegmentInfos infos = new SegmentInfos();
|
SegmentInfos infos = new SegmentInfos();
|
||||||
infos.read(directory, segmentFileName);
|
infos.read(directory, segmentFileName);
|
||||||
|
|
|
@ -94,7 +94,7 @@ final class SegmentInfo {
|
||||||
* @param format format of the segments info file
|
* @param format format of the segments info file
|
||||||
* @param input input handle to read segment info from
|
* @param input input handle to read segment info from
|
||||||
*/
|
*/
|
||||||
public SegmentInfo(Directory dir, int format, IndexInput input) throws IOException {
|
SegmentInfo(Directory dir, int format, IndexInput input) throws IOException {
|
||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
name = input.readString();
|
name = input.readString();
|
||||||
docCount = input.readInt();
|
docCount = input.readInt();
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
public final class SegmentInfos extends Vector {
|
final class SegmentInfos extends Vector {
|
||||||
|
|
||||||
/** The file format version, a negative number. */
|
/** The file format version, a negative number. */
|
||||||
/* Works since counter, the old 1st entry, is always >= 0 */
|
/* Works since counter, the old 1st entry, is always >= 0 */
|
||||||
|
@ -235,7 +235,7 @@ public final class SegmentInfos extends Vector {
|
||||||
|
|
||||||
new FindSegmentsFile(directory) {
|
new FindSegmentsFile(directory) {
|
||||||
|
|
||||||
public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
||||||
read(directory, segmentFileName);
|
read(directory, segmentFileName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ public final class SegmentInfos extends Vector {
|
||||||
throws CorruptIndexException, IOException {
|
throws CorruptIndexException, IOException {
|
||||||
|
|
||||||
return ((Long) new FindSegmentsFile(directory) {
|
return ((Long) new FindSegmentsFile(directory) {
|
||||||
public Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {
|
||||||
|
|
||||||
IndexInput input = directory.openInput(segmentFileName);
|
IndexInput input = directory.openInput(segmentFileName);
|
||||||
|
|
||||||
|
@ -630,5 +630,6 @@ public final class SegmentInfos extends Vector {
|
||||||
* during the processing that could have been caused by
|
* during the processing that could have been caused by
|
||||||
* a writer committing.
|
* a writer committing.
|
||||||
*/
|
*/
|
||||||
protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;}
|
protected abstract Object doBody(String segmentFileName) throws CorruptIndexException, IOException;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue