File tree Expand file tree Collapse file tree 1 file changed +0
-39
lines changed
server/src/test/java/org/opensearch/index/engine Expand file tree Collapse file tree 1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -46,43 +46,4 @@ public void testCreateNRTreaderManager() throws IOException {
4646 }
4747 }
4848 }
49-
50- public void testUpdateSegmentsWhileRefreshing () throws IOException , InterruptedException {
51- try (final Store store = createStore ()) {
52- store .createEmpty (Version .LATEST );
53- final DirectoryReader reader = DirectoryReader .open (store .directory ());
54- NRTReplicationReaderManager readerManager = new NRTReplicationReaderManager (
55- OpenSearchDirectoryReader .wrap (reader , shardId ),
56- (files ) -> {},
57- (files ) -> {}
58- );
59-
60- final SegmentInfos infos_2 = readerManager .getSegmentInfos ().clone ();
61- infos_2 .changed ();
62-
63- Thread refreshThread = new Thread (() -> {
64- try {
65- readerManager .maybeRefresh ();
66- } catch (IOException e ) {
67- throw new RuntimeException (e );
68- }
69- });
70- Thread updateThread = new Thread (() -> {
71- try {
72- readerManager .updateSegments (infos_2 );
73- } catch (IOException e ) {
74- throw new RuntimeException (e );
75- }
76- });
77- refreshThread .start ();
78- updateThread .start ();
79- refreshThread .join ();
80- updateThread .join ();
81- try (final OpenSearchDirectoryReader acquire = readerManager .acquire ()) {
82- final StandardDirectoryReader standardReader = NRTReplicationReaderManager .unwrapStandardReader (acquire );
83- assertEquals (infos_2 .version , standardReader .getSegmentInfos ().version );
84- }
85- assertEquals (infos_2 , readerManager .getSegmentInfos ());
86- }
87- }
8849}
You can’t perform that action at this time.
0 commit comments