/** Returns if the given segment should be upgraded. The default implementation * will return {@code !Version.LATEST.equals(si.getVersion())}, * so all segments created with a different version number than this Lucene version will * get upgraded. */ protected boolean shouldUpgradeSegment(SegmentCommitInfo si) { return !Version.LATEST.equals(si.info.getVersion()); }
private static void checkLucene() { if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) { throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version [" + Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]"); } }
versionString = oldest.equals(newest) ? ( "version=" + oldest ) : ("versions=[" + oldest + " .. " + newest + "]");
private static void checkLucene() { if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) { throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version [" + Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]"); } }
private static void checkLucene() { if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) { throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version [" + Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]"); } }
private static void checkLucene() { if (Version.CURRENT.luceneVersion.equals(org.apache.lucene.util.Version.LATEST) == false) { throw new AssertionError("Lucene version mismatch this version of Elasticsearch requires lucene version [" + Version.CURRENT.luceneVersion + "] but the current lucene version is [" + org.apache.lucene.util.Version.LATEST + "]"); } }
/** Returns if the given segment should be upgraded. The default implementation * will return {@code !Version.LATEST.equals(si.getVersion())}, * so all segments created with a different version number than this Lucene version will * get upgraded. */ protected boolean shouldUpgradeSegment(SegmentCommitInfo si) { return !Version.LATEST.equals(si.info.getVersion()); }
/** Returns if the given segment should be upgraded. The default implementation * will return {@code !Version.LATEST.equals(si.getVersion())}, * so all segments created with a different version number than this Lucene version will * get upgraded. */ protected boolean shouldUpgradeSegment(SegmentCommitInfo si) { return !Version.LATEST.equals(si.info.getVersion()); }
/** Returns if the given segment should be upgraded. The default implementation * will return {@code !Version.LATEST.equals(si.getVersion())}, * so all segments created with a different version number than this Lucene version will * get upgraded. */ protected boolean shouldUpgradeSegment(SegmentCommitInfo si) { return !Version.LATEST.equals(si.info.getVersion()); }
private void upgradeIndex(Directory dir) throws IOException { boolean doUpgrade = false; IndexWriterConfig iwc = new IndexWriterConfig(null); CheckIndex chkIndex = new CheckIndex(dir); try { for (CheckIndex.Status.SegmentInfoStatus segmentInfo : chkIndex .checkIndex().segmentInfos) { if (!segmentInfo.version.equals(Version.LATEST)) { logInfo("Found Index version %s", segmentInfo.version.toString()); doUpgrade = true; break; } } } finally { chkIndex.close(); } if (doUpgrade) { logInfo("Upgrading index to %s", Version.LATEST.toString()); new IndexUpgrader(dir, iwc, false).upgrade(); this.indexUpdateTimeMicros = Utils.getNowMicrosUtc(); } }
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(); } }
versionString = oldest.equals(newest) ? ( "version=" + oldest ) : ("versions=[" + oldest + " .. " + newest + "]");
versionString = oldest.equals(newest) ? ( "version=" + oldest ) : ("versions=[" + oldest + " .. " + newest + "]");
versionString = oldest.equals(newest) ? ( "version=" + oldest ) : ("versions=[" + oldest + " .. " + newest + "]");