result.dir = dir; String[] files = dir.listAll(); String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + dir + ": files: " + Arrays.toString(files));
String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + directory + ": files: " + Arrays.toString(files));
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
assert SegmentInfos.getLastCommitSegmentsFileName(directory).equals(segmentsFileName); if (foundSegmentFiles == 0) { throw new IllegalStateException("no commit found in the directory");
private void upgradeIndex(Directory dir) throws IOException { boolean doUpgrade = false; String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(dir.listAll()); SegmentInfos sis = SegmentInfos.readCommit(dir, lastSegmentsFile); for (SegmentCommitInfo commit : sis) { if (!commit.info.getVersion().equals(Version.LATEST)) { logInfo("Found Index version %s", commit.info.getVersion().toString()); doUpgrade = true; break; } } if (doUpgrade) { logInfo("Upgrading index to %s", Version.LATEST.toString()); IndexWriterConfig iwc = new IndexWriterConfig(null); new IndexUpgrader(dir, iwc, false).upgrade(); this.writerUpdateTimeMicros = Utils.getNowMicrosUtc(); } }
result.dir = dir; String[] files = dir.listAll(); String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + dir + ": files: " + Arrays.toString(files));
result.dir = dir; String[] files = dir.listAll(); String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + dir + ": files: " + Arrays.toString(files));
result.dir = dir; String[] files = dir.listAll(); String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + dir + ": files: " + Arrays.toString(files));
String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + directory + ": files: " + Arrays.toString(files));
String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + directory + ": files: " + Arrays.toString(files));
String lastSegmentsFile = SegmentInfos.getLastCommitSegmentsFileName(files); if (lastSegmentsFile == null) { throw new IndexNotFoundException("no segments* file found in " + directory + ": files: " + Arrays.toString(files));