Repository: apache/kafka
File: coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java (Java)

Code before:
         * The high watermark listener registered to all the partitions
         * backing the coordinators.
         */
        HighWatermarkListener highWatermarklistener;

        /**
         * The buffer supplier used to write records to the log.
         */
        BufferSupplier bufferSupplier;

        /**
         * The current (or pending) batch.
         */
        CoordinatorBatch currentBatch;

        /**
         * The batch epoch. Incremented every time a new batch is started.
         * Only valid for the lifetime of the CoordinatorContext. The first batch has an epoch of 1.
         */
        int batchEpoch;

        /**
         * The cached buffer size.
         */
        AtomicLong cachedBufferSize;

        /**
         * Constructor.
         *
         * @param tp The topic partition of the coordinator.
         */
        private CoordinatorContext(
            TopicPartition tp
        ) {
            this.lock = new ReentrantLock();
            this.tp = tp;
            this.logContext = new LogContext(String.format("[%s topic=%s partition=%d] ",
                logPrefix,
                tp.topic(),
                tp.partition()
            ));
            this.state = CoordinatorState.INITIAL;
            this.epoch = -1;
            this.deferredEventQueue = new DeferredEventQueue(logContext);
            this.timer = new EventBasedCoordinatorTimer(tp, logContext);
            this.executor = new CoordinatorExecutorImpl<>(
                logContext,
                tp,
                CoordinatorRuntime.this,
                executorService,
                defaultWriteTimeout

Review comment (refactor):
nit: Could we move this just after `bufferSupplier`? Since they're related.

Code after:
         * The high watermark listener registered to all the partitions
         * backing the coordinators.
         */
        HighWatermarkListener highWatermarklistener;

        /**
         * The buffer supplier used to write records to the log.
         */
        BufferSupplier bufferSupplier;

        /**
         * The cached buffer size.
         */
        AtomicLong cachedBufferSize;

        /**
         * The current (or pending) batch.
         */
        CoordinatorBatch currentBatch;

        /**
         * The batch epoch. Incremented every time a new batch is started.
         * Only valid for the lifetime of the CoordinatorContext. The first batch has an epoch of 1.
         */
        int batchEpoch;

        /**
         * Constructor.
         *
         * @param tp The topic partition of the coordinator.
         */
        private CoordinatorContext(
            TopicPartition tp
        ) {
            this.lock = new ReentrantLock();
            this.tp = tp;
            this.logContext = new LogContext(String.format("[%s topic=%s partition=%d] ",
                logPrefix,
                tp.topic(),
                tp.partition()
            ));
            this.state = CoordinatorState.INITIAL;
            this.epoch = -1;
            this.deferredEventQueue = new DeferredEventQueue(logContext);
            this.timer = new EventBasedCoordinatorTimer(tp, logContext);
            this.executor = new CoordinatorExecutorImpl<>(
                logContext,
                tp,
                CoordinatorRuntime.this,
                executorService,
                defaultWriteTimeout