protected void advanceToken(RemoteReplicaInfo remoteReplicaInfo, ExchangeMetadataResponse exchangeMetadataResponse) {
    remoteReplicaInfo.resetReplicationRetryCount();
    remoteReplicaInfo.setToken(exchangeMetadataResponse.remoteToken);
    remoteReplicaInfo.setLocalLagFromRemoteInBytes(exchangeMetadataResponse.localLagFromRemoteInBytes);
    // reset stored metadata response for this replica
    remoteReplicaInfo.setExchangeMetadataResponse(new ExchangeMetadataResponse(ServerErrorCode.NoError));
    logger.trace("Thread name: {}, updating token {} and lag {} for partition {} for Remote replica {}", threadName,
        remoteReplicaInfo.getToken(), remoteReplicaInfo.getLocalLagFromRemoteInBytes(),
        remoteReplicaInfo.getReplicaId().getPartitionId().toString(), remoteReplicaInfo.getReplicaId());
  }
Advances local token to make progress on replication
@param remoteReplicaInfo Remote replica info object
@param exchangeMetadataResponse Metadata object exchanged between replicas
ambry-replication/src/main/java/com/github/ambry/replication/ReplicaThread.java