4141import static org .hamcrest .Matchers .equalTo ;
4242import static org .hamcrest .Matchers .instanceOf ;
4343
44- public class NoopEngineTests extends EngineTestCase {
44+ public class NoOpEngineTests extends EngineTestCase {
4545 private static final IndexSettings INDEX_SETTINGS = IndexSettingsModule .newIndexSettings ("index" , Settings .EMPTY );
4646
4747 public void testNoopEngine () throws IOException {
4848 engine .close ();
49- final NoopEngine engine = new NoopEngine ( noopConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
49+ final NoOpEngine engine = new NoOpEngine ( noOpConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
5050 expectThrows (UnsupportedOperationException .class , () -> engine .index (null ));
5151 expectThrows (UnsupportedOperationException .class , () -> engine .delete (null ));
5252 expectThrows (UnsupportedOperationException .class , () -> engine .noOp (null ));
@@ -63,11 +63,11 @@ public void testNoopEngine() throws IOException {
6363
6464 public void testTwoNoopEngines () throws IOException {
6565 engine .close ();
66- // It's so noop you can even open two engines for the same store without tripping anything,
66+ // It's so noOp you can even open two engines for the same store without tripping anything,
6767 // this ensures we're not doing any kind of locking on the store or filesystem level in
68- // the noop engine
69- final NoopEngine engine1 = new NoopEngine ( noopConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
70- final NoopEngine engine2 = new NoopEngine ( noopConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
68+ // the noOp engine
69+ final NoOpEngine engine1 = new NoOpEngine ( noOpConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
70+ final NoOpEngine engine2 = new NoOpEngine ( noOpConfig (INDEX_SETTINGS , store , primaryTranslogDir ));
7171 engine1 .close ();
7272 engine2 .close ();
7373 }
@@ -97,24 +97,24 @@ public void testNoopAfterRegularEngine() throws IOException {
9797 long maxSeqNo = engine .getSeqNoStats (100L ).getMaxSeqNo ();
9898 engine .close ();
9999
100- final NoopEngine noopEngine = new NoopEngine ( noopConfig (INDEX_SETTINGS , store , primaryTranslogDir , tracker ));
101- assertThat (noopEngine .getLocalCheckpoint (), equalTo (localCheckpoint ));
102- assertThat (noopEngine .getSeqNoStats (100L ).getMaxSeqNo (), equalTo (maxSeqNo ));
103- try (Engine .IndexCommitRef ref = noopEngine .acquireLastIndexCommit (false )) {
100+ final NoOpEngine noOpEngine = new NoOpEngine ( noOpConfig (INDEX_SETTINGS , store , primaryTranslogDir , tracker ));
101+ assertThat (noOpEngine .getLocalCheckpoint (), equalTo (localCheckpoint ));
102+ assertThat (noOpEngine .getSeqNoStats (100L ).getMaxSeqNo (), equalTo (maxSeqNo ));
103+ try (Engine .IndexCommitRef ref = noOpEngine .acquireLastIndexCommit (false )) {
104104 try (IndexReader reader = DirectoryReader .open (ref .getIndexCommit ())) {
105105 assertThat (reader .numDocs (), equalTo (docs ));
106106 }
107107 }
108- noopEngine .close ();
108+ noOpEngine .close ();
109109 }
110110
111111 public void testNoopEngineWithInvalidTranslogUUID () throws IOException {
112112 Path newTranslogDir = createTempDir ();
113- // A new translog will have a different UUID than the existing store/noop engine does
113+ // A new translog will have a different UUID than the existing store/noOp engine does
114114 Translog newTranslog = createTranslog (newTranslogDir , () -> 1L );
115115 newTranslog .close ();
116116 EngineCreationFailureException e = expectThrows (EngineCreationFailureException .class ,
117- () -> new NoopEngine ( noopConfig (INDEX_SETTINGS , store , newTranslogDir )));
117+ () -> new NoOpEngine ( noOpConfig (INDEX_SETTINGS , store , newTranslogDir )));
118118 assertThat (e .getCause (), instanceOf (TranslogCorruptedException .class ));
119119 }
120120}
0 commit comments