Skip to content

Commit

Permalink
Change visibility of createWriter to allow tests from a different pac…
Browse files Browse the repository at this point in the history
…kage to override it (elastic#111234)
  • Loading branch information
ldematte authored Jul 24, 2024
1 parent 5ce265a commit 0b9b2a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2676,8 +2676,8 @@ private IndexWriter createWriter() throws IOException {
}
}

// pkg-private for testing
IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
// protected for testing
protected IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
if (Assertions.ENABLED) {
return new AssertingIndexWriter(directory, iwc);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ public static InternalEngine createInternalEngine(
if (localCheckpointTrackerSupplier == null) {
return new InternalTestEngine(config) {
@Override
IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
protected IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
return (indexWriterFactory != null)
? indexWriterFactory.createWriter(directory, iwc)
: super.createWriter(directory, iwc);
Expand All @@ -686,7 +686,7 @@ protected long doGenerateSeqNoForOperation(final Operation operation) {
} else {
return new InternalTestEngine(config, IndexWriter.MAX_DOCS, localCheckpointTrackerSupplier) {
@Override
IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
protected IndexWriter createWriter(Directory directory, IndexWriterConfig iwc) throws IOException {
return (indexWriterFactory != null)
? indexWriterFactory.createWriter(directory, iwc)
: super.createWriter(directory, iwc);
Expand Down

0 comments on commit 0b9b2a9

Please sign in to comment.