@@ -407,7 +407,7 @@ public void updateShardState(final ShardRouting newRouting,
407407 final Engine engine = getEngine ();
408408 if (currentRouting .isRelocationTarget () == false || recoverySourceNode .getVersion ().before (Version .V_6_0_0_alpha1 )) {
409409 // there was no primary context hand-off in < 6.0.0, need to manually activate the shard
410- replicationTracker .activatePrimaryMode (getEngine ().getLocalCheckpointTracker (). getCheckpoint ());
410+ replicationTracker .activatePrimaryMode (getEngine ().getLocalCheckpoint ());
411411 }
412412 if (currentRouting .isRelocationTarget () == true && recoverySourceNode .getVersion ().before (Version .V_6_0_0_alpha1 )) {
413413 // Flush the translog as it may contain operations with no sequence numbers. We want to make sure those
@@ -497,8 +497,7 @@ public void updateShardState(final ShardRouting newRouting,
497497 */
498498 engine .rollTranslogGeneration ();
499499 engine .fillSeqNoGaps (newPrimaryTerm );
500- replicationTracker .updateLocalCheckpoint (currentRouting .allocationId ().getId (),
501- getEngine ().getLocalCheckpointTracker ().getCheckpoint ());
500+ replicationTracker .updateLocalCheckpoint (currentRouting .allocationId ().getId (), getLocalCheckpoint ());
502501 primaryReplicaSyncer .accept (this , new ActionListener <ResyncTask >() {
503502 @ Override
504503 public void onResponse (ResyncTask resyncTask ) {
@@ -524,7 +523,7 @@ public void onFailure(Exception e) {
524523 }
525524 },
526525 e -> failShard ("exception during primary term transition" , e ));
527- replicationTracker .activatePrimaryMode (getEngine (). getLocalCheckpointTracker (). getCheckpoint ());
526+ replicationTracker .activatePrimaryMode (getLocalCheckpoint ());
528527 primaryTerm = newPrimaryTerm ;
529528 }
530529 }
@@ -905,7 +904,7 @@ public CommitStats commitStats() {
905904 @ Nullable
906905 public SeqNoStats seqNoStats () {
907906 Engine engine = getEngineOrNull ();
908- return engine == null ? null : engine .getLocalCheckpointTracker (). getStats (replicationTracker .getGlobalCheckpoint ());
907+ return engine == null ? null : engine .getSeqNoStats (replicationTracker .getGlobalCheckpoint ());
909908 }
910909
911910 public IndexingStats indexingStats (String ... types ) {
@@ -1742,7 +1741,7 @@ public void updateGlobalCheckpointForShard(final String allocationId, final long
17421741 * @throws InterruptedException if the thread was interrupted while blocking on the condition
17431742 */
17441743 public void waitForOpsToComplete (final long seqNo ) throws InterruptedException {
1745- getEngine ().getLocalCheckpointTracker (). waitForOpsToComplete (seqNo );
1744+ getEngine ().waitForOpsToComplete (seqNo );
17461745 }
17471746
17481747 /**
@@ -1775,7 +1774,7 @@ public void markAllocationIdAsInSync(final String allocationId, final long local
17751774 * @return the local checkpoint
17761775 */
17771776 public long getLocalCheckpoint () {
1778- return getEngine ().getLocalCheckpointTracker (). getCheckpoint ();
1777+ return getEngine ().getLocalCheckpoint ();
17791778 }
17801779
17811780 /**
@@ -1816,7 +1815,7 @@ public void maybeSyncGlobalCheckpoint(final String reason) {
18161815 return ;
18171816 }
18181817 // only sync if there are not operations in flight
1819- final SeqNoStats stats = getEngine ().getLocalCheckpointTracker (). getStats (replicationTracker .getGlobalCheckpoint ());
1818+ final SeqNoStats stats = getEngine ().getSeqNoStats (replicationTracker .getGlobalCheckpoint ());
18201819 if (stats .getMaxSeqNo () == stats .getGlobalCheckpoint ()) {
18211820 final ObjectLongMap <String > globalCheckpoints = getInSyncGlobalCheckpoints ();
18221821 final String allocationId = routingEntry ().allocationId ().getId ();
@@ -1853,7 +1852,7 @@ public ReplicationGroup getReplicationGroup() {
18531852 */
18541853 public void updateGlobalCheckpointOnReplica (final long globalCheckpoint , final String reason ) {
18551854 verifyReplicationTarget ();
1856- final long localCheckpoint = getEngine (). getLocalCheckpointTracker (). getCheckpoint ();
1855+ final long localCheckpoint = getLocalCheckpoint ();
18571856 if (globalCheckpoint > localCheckpoint ) {
18581857 /*
18591858 * This can happen during recovery when the shard has started its engine but recovery is not finalized and is receiving global
@@ -1882,8 +1881,7 @@ public void activateWithPrimaryContext(final ReplicationTracker.PrimaryContext p
18821881 verifyPrimary ();
18831882 assert shardRouting .isRelocationTarget () : "only relocation target can update allocation IDs from primary context: " + shardRouting ;
18841883 assert primaryContext .getCheckpointStates ().containsKey (routingEntry ().allocationId ().getId ()) &&
1885- getEngine ().getLocalCheckpointTracker ().getCheckpoint () ==
1886- primaryContext .getCheckpointStates ().get (routingEntry ().allocationId ().getId ()).getLocalCheckpoint ();
1884+ getLocalCheckpoint () == primaryContext .getCheckpointStates ().get (routingEntry ().allocationId ().getId ()).getLocalCheckpoint ();
18871885 synchronized (mutex ) {
18881886 replicationTracker .activateWithPrimaryContext (primaryContext ); // make changes to primaryMode flag only under mutex
18891887 }
@@ -2269,7 +2267,7 @@ public void acquireReplicaOperationPermit(final long operationPrimaryTerm, final
22692267 operationPrimaryTerm ,
22702268 getLocalCheckpoint (),
22712269 localCheckpoint );
2272- getEngine ().getLocalCheckpointTracker (). resetCheckpoint (localCheckpoint );
2270+ getEngine ().resetLocalCheckpoint (localCheckpoint );
22732271 getEngine ().rollTranslogGeneration ();
22742272 });
22752273 globalCheckpointUpdated = true ;
0 commit comments