Skip to content

Commit

Permalink
[Segment Replicaiton] Fix merge conflict. Update EngineTestCase.getTr…
Browse files Browse the repository at this point in the history
…anslog()

Signed-off-by: Suraj Singh <surajrider@gmail.com>
  • Loading branch information
dreamer-89 committed Sep 7, 2022
1 parent 62049fd commit 5467140
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1492,10 +1492,15 @@ public static MapperService createMapperService() throws IOException {
* Exposes a translog associated with the given engine for testing purpose.
*/
public static Translog getTranslog(Engine engine) {
assert engine instanceof InternalEngine || engine instanceof NRTReplicationEngine
// This is a hack for bwc for 2.x, main will use TranslogManager on Engine directly
if (engine instanceof NRTReplicationEngine) {
return ((NRTReplicationEngine)(engine)).getTranslog();
}
assert engine instanceof InternalEngine
: "only InternalEngines or NRTReplicationEngines have translogs, got: " + engine.getClass();
engine.ensureOpen();
TranslogManager translogManager = engine.translogManager();
InternalEngine internalEngine = (InternalEngine) engine;
internalEngine.ensureOpen();
TranslogManager translogManager = internalEngine.translogManager();
assert translogManager instanceof InternalTranslogManager : "only InternalTranslogManager have translogs, got: "
+ engine.getClass();
InternalTranslogManager internalTranslogManager = (InternalTranslogManager) translogManager;
Expand Down

0 comments on commit 5467140

Please sign in to comment.