@After public void tearDown() throws Exception { super.tearDown(); replicaEngine.close(); storeReplica.close(); engine.close(); store.close(); if (threadPool != null) { threadPool.shutdownNow(); } }
@Before public void setUp() throws Exception { super.setUp(); defaultSettings = ImmutableSettings.builder() .put(RobinEngine.INDEX_COMPOUND_ON_FLUSH, getRandom().nextBoolean()) .build(); // TODO randomize more settings threadPool = new ThreadPool(); store = createStore(); store.deleteContent(); storeReplica = createStoreReplica(); storeReplica.deleteContent(); engineSettingsService = new IndexSettingsService(shardId.index(), EMPTY_SETTINGS); engine = createEngine(engineSettingsService, store, createTranslog()); engine.start(); replicaSettingsService = new IndexSettingsService(shardId.index(), EMPTY_SETTINGS); replicaEngine = createEngine(replicaSettingsService, storeReplica, createTranslogReplica()); replicaEngine.start(); }