kafka/checkstyle
Gardner Vickers 8cf781ef01
MINOR: Improve performance of checkpointHighWatermarks, patch 1/2 (#6741)
This PR works to improve high watermark checkpointing performance.

`ReplicaManager.checkpointHighWatermarks()` was found to be a major contributor to GC pressure, especially on Kafka clusters with high partition counts and low throughput.

Added a JMH benchmark for `checkpointHighWatermarks` which establishes a
performance baseline. The parameterized benchmark was run with 100, 1000 and
2000 topics. 

Modified `ReplicaManager.checkpointHighWatermarks()` to avoid extra copies and cached
the Log parent directory Sting to avoid frequent allocations when calculating
`File.getParent()`.

A few clean-ups:
* Changed all usages of Log.dir.getParent to Log.parentDir and Log.dir.getParentFile to
Log.parentDirFile.
* Only expose public accessor for `Log.dir` (consistent with `Log.parentDir`)
* Removed unused parameters in `Partition.makeLeader`, `Partition.makeFollower` and `Partition.createLogIfNotExists`.

Benchmark results:

| Topic Count | Ops/ms | MB/sec allocated |
|-------------|---------|------------------|
| 100               | + 51%    |  - 91% |
| 1000             | + 143% |  - 49% |
| 2000            | + 149% |   - 50% |

Reviewers: Lucas Bradstreet <lucas@confluent.io>. Ismael Juma <ismael@juma.me.uk>

Co-authored-by: Gardner Vickers <gardner@vickers.me>
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
2020-03-25 20:53:42 -07:00
..
.scalafmt.conf MINOR: Add Scalafmt to Streams Scala API (#4965) 2018-07-09 16:48:34 -07:00
checkstyle.xml KAFKA-7308: Fix rat and checkstyle config for Java 11 support (#5529) 2018-08-18 08:18:28 -07:00
import-control-core.xml KAFKA-9106 make metrics exposed via jmx configurable (#7674) 2020-02-13 10:21:14 -08:00
import-control-jmh-benchmarks.xml MINOR: Improve performance of checkpointHighWatermarks, patch 1/2 (#6741) 2020-03-25 20:53:42 -07:00
import-control.xml MINOR: Improve performance of checkpointHighWatermarks, patch 1/2 (#6741) 2020-03-25 20:53:42 -07:00
java.header MINOR: improve license header check by providing head file instead of (prefix) header regex 2017-02-28 12:35:04 -08:00
suppressions.xml KAFKA-6145: Pt 2.5 Compute overall task lag per client (#8252) 2020-03-21 13:40:34 -05:00