private ReplicaState getOrCreateReplicaState(ReplicaKey replicaKey) {
        ReplicaState state = voterStates.get(replicaKey.id());
        if (state == null || !state.matchesKey(replicaKey)) {
            observerStates.putIfAbsent(replicaKey, new ReplicaState(replicaKey, false, Endpoints.empty()));
            return observerStates.get(replicaKey);
        }
        return state;
    }
Update the replica state in terms of fetch time and log end offsets.

@param replicaKey replica key
@param currentTimeMs current time in milliseconds
@param fetchOffsetMetadata new log offset and metadata
@return true if the high watermark is updated as a result of this call
raft/src/main/java/org/apache/kafka/raft/LeaderState.java