MINOR: Kafka Streams code samples formating unification#10651
MINOR: Kafka Streams code samples formating unification#10651cadonna merged 4 commits intoapache:trunkfrom
Conversation
Code samples are now unified and correctly formatted. Samples under Streams use consistently the prism library.
|
The test failures in this PR should be unrelated to the changes introduced (docs). Is there anything I should do to move the PR forward? |
|
For the record: |
|
Thank for the PR! For the next time, I would recommend to open smaller PRs. Almost 2000 additions is a lot even for docs. In my experience smaller PRs tend to be merged faster. |
|
Do not worry about the test failures. First of all, your PR does not touch any code, so there is no reason a test would fail due to your PR. Additionally, the failing tests are all known to be flaky. You can find known flaky tests in the JIRA by searching for the test name. |
|
@cadonna I'll do it next time. I was doubting between providing a PR per file or a PR per folder. (ended up doing PR for the Streams folder). |
|
Most of the changes are purely cosmetic:
|
|
@cadonna Would you like me to split this PR into several ones? One per file, for example? |
| <pre class="line-numbers"><code class="language-bash"><path-to-kafka>/bin/kafka-streams-application-reset</code></pre> | ||
| <p>The tool accepts the following parameters:</p> | ||
| <div class="highlight-bash"><div class="highlight"><pre><span>Option</span><code> <span class="o">(</span>* <span class="o">=</span> required<span class="o">)</span> Description | ||
| <pre class="line-numbers"><code class="language-bash">Option (* = required) Description |
There was a problem hiding this comment.
Class language-bash renders the text with strange colors, e.g., the keyword "file" which is not a keyword here. Since this is actually not a bash script code, I think we leave it as plain monospaced text.
There was a problem hiding this comment.
Fixed, and also aligned the spaces, so it fit's to the 2 column printing.
|
|
||
| // Java 8+ example, using lambda expressions | ||
| KTable<String, String> joined = left.join(right, | ||
| foreignKeyExtractor, |
There was a problem hiding this comment.
Could you please put foreignKeyExtractor on the previous line or indent it so that it is at the same column as right?
|
|
||
| // Java 8+ example, using lambda expressions | ||
| KTable<String, String> joined = left.join(right, | ||
| foreignKeyExtractor, |
There was a problem hiding this comment.
Could you please put foreignKeyExtractor on the previous line or indent it so that it is at the same column as right?
| // A hopping time window with a size of 5 minutes and an advance interval of 1 minute. | ||
| // The window's name -- the string parameter -- is used to e.g. name the backing state store. | ||
| Duration windowSizeMs = Duration.ofMinutes(5); | ||
| Duration advanceMs = Duration.ofMinutes(1); |
There was a problem hiding this comment.
Could you fix the indentation here to Duration advanceMs = Duration.ofMinutes(1);?
|
Thanks @cadonna, all good points. I'll address the feedback later |
|
|
||
| <span class="kd">private</span> <span class="kt">static</span> <span class="n">org.rocksdb.Cache</span> <span class="n">cache</span> <span class="o">=</span> <span class="k">new</span> <span class="n">org</span><span class="o">.</span><span class="na">rocksdb</span><span class="o">.</span><span class="na">LRUCache</span><span class="o">(</span><span class="mi">TOTAL_OFF_HEAP_MEMORY</span><span class="o">,</span> <span class="n">-1</span><span class="o">,</span> <span class="n">false</span><span class="o">,</span> <span class="n">INDEX_FILTER_BLOCK_RATIO</span><span class="o">);</span><sup><a href="#fn1" id="ref1">1</a></sup> | ||
| <span class="kd">private</span> <span class="kt">static</span> <span class="n">org.rocksdb.WriteBufferManager</span> <span class="n">writeBufferManager</span> <span class="o">=</span> <span class="k">new</span> <span class="n">org</span><span class="o">.</span><span class="na">rocksdb</span><span class="o">.</span><span class="na">WriteBufferManager</span><span class="o">(</span><span class="mi">TOTAL_MEMTABLE_MEMORY</span><span class="o">,</span> cache<span class="o">);</span> | ||
| private static org.rocksdb.Cache cache = new org.rocksdb.LRUCache(TOTAL_OFF_HEAP_MEMORY, -1, false, INDEX_FILTER_BLOCK_RATIO);1 |
There was a problem hiding this comment.
The 1 at the end should be a superscript reference to a footnote. Is there a way to get again a superscript here? If not what would be the alternatives?
| <span class="n">options</span><span class="o">.</span><span class="na">setMaxWriteBufferNumber</span><span class="o">(</span><span class="mi">N_MEMTABLES</span><span class="o">);</span> | ||
| <span class="n">options</span><span class="o">.</span><span class="na">setWriteBufferSize</span><span class="o">(</span><span class="mi">MEMTABLE_SIZE</span><span class="o">);</span> | ||
| // These options are recommended to be set when bounding the total memory | ||
| tableConfig.setCacheIndexAndFilterBlocksWithHighPriority(true);2 |
There was a problem hiding this comment.
See my comment above for the 2 at the end.
| // These options are recommended to be set when bounding the total memory | ||
| tableConfig.setCacheIndexAndFilterBlocksWithHighPriority(true);2 | ||
| tableConfig.setPinTopLevelIndexAndFilter(true); | ||
| tableConfig.setBlockSize(BLOCK_SIZE);3 |
There was a problem hiding this comment.
See my comment above for the 3 at the end.
|
Thanks @cadonna that one slipped through. I modified the code and brought back the foot notes with the hyperlink. |
| <p> | ||
| The mock will capture any values that your processor forwards. You can make assertions on them: | ||
| <pre class="line-numbers"><code class="language-text">processorUnderTest.process("key", "value"); | ||
| <pre class="line-numbers"><code class="language-java">processorUnderTest.process("key", "value"); |
There was a problem hiding this comment.
On line 304 and line 306 are two code snippets that slipped through.
|
Hi @cadonna I'll fix that in a couple of hours, thanks for your thorough review! |
|
Thanks for the review, I know it was long and tricky! |
…e-allocations-lz4 * apache-github/trunk: (43 commits) KAFKA-12800: Configure generator to fail on trailing JSON tokens (apache#10717) MINOR: clarify message ordering with max in-flight requests and idempotent producer (apache#10690) MINOR: Add log identifier/prefix printing in Log layer static functions (apache#10742) MINOR: update java doc for deprecated methods (apache#10722) MINOR: Fix deprecation warnings in SlidingWindowedCogroupedKStreamImplTest (apache#10703) KAFKA-12499: add transaction timeout verification (apache#10482) KAFKA-12620 Allocate producer ids on the controller (apache#10504) MINOR: Kafka Streams code samples formating unification (apache#10651) KAFKA-12808: Remove Deprecated Methods under StreamsMetrics (apache#10724) KAFKA-12522: Cast SMT should allow null value records to pass through (apache#10375) KAFKA-12820: Upgrade maven-artifact dependency to resolve CVE-2021-26291 HOTFIX: fix checkstyle issue in KAFKA-12697 KAFKA-12697: Add OfflinePartitionCount and PreferredReplicaImbalanceCount metrics to Quorum Controller (apache#10572) KAFKA-12342: Remove MetaLogShim and use RaftClient directly (apache#10705) KAFKA-12779: KIP-740, Clean up public API in TaskId and fix TaskMetadata#taskId() (apache#10735) KAFKA-12814: Remove Deprecated Method StreamsConfig getConsumerConfigs (apache#10737) MINOR: Eliminate redundant functions in LogTest suite (apache#10732) MINOR: Remove unused maxProducerIdExpirationMs parameter in Log constructor (apache#10723) MINOR: Updating files with release 2.7.1 (apache#10660) KAFKA-12809: Remove deprecated methods of Stores factory (apache#10729) ...
We have updated the memory-mgmt.html in kafka repo in this PR: apache/kafka#10651. So, this pr, just simply fix the missing pre closing tag issue.
Code samples are now correctly formatted.
Samples under Streams use consistently the prism library to be displayed.
Committer Checklist (excluded from commit message)