Skip to content

Commit 65076f4

Browse files
Use InfoStream.NO_OUTPUT in PersistedClusterStateService (#112941)
We can save some allocations and speedup tests some more by using `InfoStream.NO_OUTPUT` instead of the default `NullInfoStream` that does not log but causes signals enabled to its users and thus causes large strings to needlessly be setup.
1 parent 8e9e653 commit 65076f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.apache.lucene.store.NIOFSDirectory;
4040
import org.apache.lucene.util.Bits;
4141
import org.apache.lucene.util.BytesRef;
42+
import org.apache.lucene.util.InfoStream;
4243
import org.apache.lucene.util.SetOnce;
4344
import org.elasticsearch.Version;
4445
import org.elasticsearch.cluster.ClusterState;
@@ -261,6 +262,7 @@ CheckedBiConsumer<Path, DirectoryReader, IOException> getAssertOnCommit() {
261262

262263
private static IndexWriter createIndexWriter(Directory directory, boolean openExisting) throws IOException {
263264
final IndexWriterConfig indexWriterConfig = new IndexWriterConfig(new KeywordAnalyzer());
265+
indexWriterConfig.setInfoStream(InfoStream.NO_OUTPUT);
264266
// start empty since we re-write the whole cluster state to ensure it is all using the same format version
265267
indexWriterConfig.setOpenMode(openExisting ? IndexWriterConfig.OpenMode.APPEND : IndexWriterConfig.OpenMode.CREATE);
266268
// only commit when specifically instructed, we must not write any intermediate states

0 commit comments

Comments
 (0)