setChecksumsOnly(opts.doChecksumsOnly); setInfoStream(opts.out, opts.verbose);
public Tuple<RemoveCorruptedShardDataCommand.CleanStatus, String> getCleanStatus(ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { if (RemoveCorruptedShardDataCommand.isCorruptMarkerFileIsPresent(indexDirectory) == false) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN, null); } final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.UNRECOVERABLE, "Index is unrecoverable - there are missing segments"); } return status.clean ? Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN_WITH_CORRUPTED_MARKER, null) : Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CORRUPTED, "Corrupted Lucene index segments found - " + status.totLoseDocCount + " documents will be lost."); } }
public void execute(Terminal terminal, ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { checkCorruptMarkerFileIsPresent(indexDirectory); final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments == false) { if (status.clean == false) { terminal.println("Writing..."); checker.exorciseIndex(status); terminal.println("OK"); terminal.println("Wrote new segments file \"" + status.segmentsFileName + "\""); } } else { throw new ElasticsearchException("Index is unrecoverable - there are missing segments"); } } }
setChecksumsOnly(opts.doChecksumsOnly); setInfoStream(opts.out, opts.verbose);
setChecksumsOnly(opts.doChecksumsOnly); setInfoStream(opts.out, opts.verbose);
setChecksumsOnly(opts.doChecksumsOnly); setInfoStream(opts.out, opts.verbose);
public Tuple<RemoveCorruptedShardDataCommand.CleanStatus, String> getCleanStatus(ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { if (RemoveCorruptedShardDataCommand.isCorruptMarkerFileIsPresent(indexDirectory) == false) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN, null); } final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.UNRECOVERABLE, "Index is unrecoverable - there are missing segments"); } return status.clean ? Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN_WITH_CORRUPTED_MARKER, null) : Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CORRUPTED, "Corrupted Lucene index segments found - " + status.totLoseDocCount + " documents will be lost."); } }
public Tuple<RemoveCorruptedShardDataCommand.CleanStatus, String> getCleanStatus(ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { if (RemoveCorruptedShardDataCommand.isCorruptMarkerFileIsPresent(indexDirectory) == false) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN, null); } final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments) { return Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.UNRECOVERABLE, "Index is unrecoverable - there are missing segments"); } return status.clean ? Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CLEAN_WITH_CORRUPTED_MARKER, null) : Tuple.tuple(RemoveCorruptedShardDataCommand.CleanStatus.CORRUPTED, "Corrupted Lucene index segments found - " + status.totLoseDocCount + " documents will be lost."); } }
public void execute(Terminal terminal, ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { checkCorruptMarkerFileIsPresent(indexDirectory); final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments == false) { if (status.clean == false) { terminal.println("Writing..."); checker.exorciseIndex(status); terminal.println("OK"); terminal.println("Wrote new segments file \"" + status.segmentsFileName + "\""); } } else { throw new ElasticsearchException("Index is unrecoverable - there are missing segments"); } } }
public void execute(Terminal terminal, ShardPath shardPath, Directory indexDirectory, Lock writeLock, PrintStream printStream, boolean verbose) throws IOException { checkCorruptMarkerFileIsPresent(indexDirectory); final CheckIndex.Status status; try (CheckIndex checker = new CheckIndex(indexDirectory, writeLock)) { checker.setChecksumsOnly(true); checker.setInfoStream(printStream, verbose); status = checker.checkIndex(null); if (status.missingSegments == false) { if (status.clean == false) { terminal.println("Writing..."); checker.exorciseIndex(status); terminal.println("OK"); terminal.println("Wrote new segments file \"" + status.segmentsFileName + "\""); } } else { throw new ElasticsearchException("Index is unrecoverable - there are missing segments"); } } }