Skip to content

Commit 676e265

Browse files
committed
Removed unwanted tests and comments
Signed-off-by: Sriram Ganesh <[email protected]>
1 parent 635fd3f commit 676e265

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

server/src/test/java/org/opensearch/index/engine/LeafSorterOptimizationTests.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
import org.apache.lucene.index.LeafReader;
1313
import org.apache.lucene.index.NoMergePolicy;
1414
import org.apache.lucene.search.IndexSearcher;
15-
import org.apache.lucene.search.MatchAllDocsQuery;
16-
import org.apache.lucene.search.Sort;
17-
import org.apache.lucene.search.SortField;
18-
import org.apache.lucene.search.TopDocs;
1915
import org.opensearch.Version;
2016
import org.opensearch.common.lucene.uid.Versions;
2117
import org.opensearch.common.unit.TimeValue;
@@ -54,7 +50,6 @@ public void testReadOnlyEngineUsesLeafSorter() throws IOException {
5450
store.associateIndexWithNewTranslog(translogUUID);
5551
Comparator<LeafReader> leafSorter = Comparator.comparingInt(LeafReader::maxDoc);
5652

57-
// Use NoMergePolicy to prevent aggressive merging and ensure multiple segments
5853
EngineConfig config = new EngineConfig.Builder().shardId(shardId)
5954
.threadPool(threadPool)
6055
.indexSettings(defaultSettings)
@@ -322,22 +317,4 @@ public void testTimestampSortOptimizationWorksOnAllEngineTypes() throws IOExcept
322317
}
323318
}
324319

325-
private void testSortPerformance(Engine engine, String engineType) throws IOException {
326-
try (Engine.Searcher searcher = engine.acquireSearcher("test", Engine.SearcherScope.EXTERNAL)) {
327-
DirectoryReader reader = searcher.getDirectoryReader();
328-
IndexSearcher indexSearcher = new IndexSearcher(reader);
329-
330-
// Create a sort by timestamp (descending)
331-
Sort timestampSort = new Sort(new SortField("@timestamp", SortField.Type.LONG, true));
332-
333-
// Perform a sorted search
334-
TopDocs topDocs = indexSearcher.search(new MatchAllDocsQuery(), 10, timestampSort);
335-
336-
// Verify that the search completed successfully
337-
assertThat("Search should complete successfully on " + engineType, topDocs.totalHits.value(), greaterThan(0L));
338-
339-
// Verify that the engine has leafSorter configured
340-
assertThat("Engine " + engineType + " should have leafSorter configured", engine.config().getLeafSorter(), notNullValue());
341-
}
342-
}
343320
}

0 commit comments

Comments
 (0)