public boolean maybeBeginClientReauthentication(Supplier<Long> nowNanosSupplier)
            throws AuthenticationException, IOException {
        if (!ready())
            throw new IllegalStateException(
                    "KafkaChannel should always be \"ready\" when it is checked for possible re-authentication");
        if (muteState != ChannelMuteState.NOT_MUTED || midWrite
                || authenticator.clientSessionReauthenticationTimeNanos() == null)
            return false;
        /*
         * We've delayed getting the time as long as possible in case we don't need it,
         * but at this point we need it -- so get it now.
         */
        long nowNanos = nowNanosSupplier.get();
        if (nowNanos < authenticator.clientSessionReauthenticationTimeNanos())
            return false;
        swapAuthenticatorsAndBeginReauthentication(new ReauthenticationContext(authenticator, receive, nowNanos));
        receive = null;
        return true;
    }
If this is a client-side connection that is not muted, there is no
in-progress write, and there is a session expiration time defined that has
past then begin the process of re-authenticating the connection and return
true, otherwise return false

@param nowNanosSupplier
           {@code Supplier} of the current time. The value must be in
           nanoseconds as per {@code System.nanoTime()} and is therefore only
           useful when compared to such a value -- it's absolute value is
           meaningless.

@return true if this is a client-side connection that is not muted, there is
        no in-progress write, and there is a session expiration time defined
        that has past to indicate that the re-authentication process has
        begun, otherwise false
@throws AuthenticationException
            if re-authentication fails due to invalid credentials or other
            security configuration errors
@throws IOException
            if read/write fails due to an I/O error
@throws IllegalStateException
            if this channel is not "ready"
clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java