@Override
        public boolean equals(Object o) {
            if (this == o)
                return true;
            if (o == null || getClass() != o.getClass())
                return false;

            LogOffsetPosition that = (LogOffsetPosition) o;

            return offset == that.offset &&
                    position == that.position &&
                    size == that.size;

        }
Open a channel for the given file
For windows NTFS and some old LINUX file system, set preallocate to true and initFileSize
with one value (for example 512 * 1025 *1024 ) can improve the kafka produce performance.
@param file File path
@param mutable mutable
@param fileAlreadyExists File already exists or not
@param initFileSize The size used for pre allocate file, for example 512 * 1025 *1024
@param preallocate Pre-allocate file or not, gotten from configuration.
clients/src/main/java/org/apache/kafka/common/record/FileRecords.java