aeron-cluster/src/main/java/io/aeron/cluster/RecordingLog.java
public void appendTerm(
        final long recordingId, final long leadershipTermId, final long termBaseLogPosition, final long timestamp)
    {
        final int size = entries.size();
        if (size > 0)
        {
            final Entry lastEntry = entries.get(size - 1);

            if (lastEntry.type != NULL_VALUE && lastEntry.leadershipTermId >= leadershipTermId)
            {
                throw new ClusterException("leadershipTermId out of sequence: previous " +
                    lastEntry.leadershipTermId + " this " + leadershipTermId);
            }
        }

        indexByLeadershipTermIdMap.put(leadershipTermId, nextEntryIndex);

        append(
            ENTRY_TYPE_TERM,
            recordingId,
            leadershipTermId,
            termBaseLogPosition,
            NULL_POSITION,
            timestamp,
            NULL_VALUE);
    }
public void appendTerm(
        final long recordingId, final long leadershipTermId, final long termBaseLogPosition, final long timestamp)
    {
        final int size = entries.size();
        if (size > 0)
        {
            final Entry lastEntry = entries.get(size - 1);

            if (lastEntry.type != NULL_VALUE && lastEntry.leadershipTermId >= leadershipTermId)
            {
                throw new ClusterException("leadershipTermId out of sequence: previous " +
                    lastEntry.leadershipTermId + " this " + leadershipTermId);
            }
        }

        indexByLeadershipTermIdMap.put(leadershipTermId, nextEntryIndex);

        append(
            ENTRY_TYPE_TERM,
            recordingId,
            leadershipTermId,
            termBaseLogPosition,
            NULL_POSITION,
            timestamp,
            NULL_VALUE);
    }
public void appendTerm ( final long recordingId , final long leadershipTermId , final long termBaseLogPosition , final long timestamp ) { final int size = entries . size ( ) ; if ( size > 0 ) { final Entry lastEntry = entries . get ( size - 1 ) ; if ( lastEntry . type != NULL_VALUE && lastEntry . leadershipTermId >= leadershipTermId ) { throw new ClusterException ( "leadershipTermId out of sequence: previous " + lastEntry . leadershipTermId + " this " + leadershipTermId ) ; } } indexByLeadershipTermIdMap . put ( leadershipTermId , nextEntryIndex ) ; append ( ENTRY_TYPE_TERM , recordingId , leadershipTermId , termBaseLogPosition , NULL_POSITION , timestamp , NULL_VALUE ) ; }
Append a log entry for a leadership term.

@param recordingId         of the log.
@param leadershipTermId    for the current term.
@param termBaseLogPosition reached at the beginning of the term.
@param timestamp           at the beginning of the term.
Append a log entry for a leadership term .