boolean maybeSetState(ClientTelemetryState newState) {
            lock.writeLock().lock();
            try {
                ClientTelemetryState oldState = state;
                state = oldState.validateTransition(newState);
                log.debug("Setting telemetry state from {} to {}", oldState, newState);

                if (newState == ClientTelemetryState.TERMINATING_PUSH_IN_PROGRESS) {
                    terminalPushInProgress.signalAll();
                }
                return true;
            } catch (IllegalStateException e) {
                log.warn("Error updating client telemetry state, disabled telemetry", e);
                enabled = false;
                return false;
            } finally {
                lock.writeLock().unlock();
            }
        }
Updates the {@link #intervalMs}, {@link #lastRequestMs} and {@link #enabled}.
<p>
The contents of the method are guarded by the {@link #lock}.
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryReporter.java