MINOR: trivial cleanups, javadoc errors, omitted StateStore tests, etc.#8130
MINOR: trivial cleanups, javadoc errors, omitted StateStore tests, etc.#8130mjsax merged 18 commits intoapache:trunkfrom
Conversation
|
Retest this please. |
4647690 to
2fd4010
Compare
|
Rebased onto the latest trunk & remove one more unused import. cc/ @hachikuji @omkreddy |
b05cd4a to
68d3f13
Compare
68d3f13 to
99fc213
Compare
|
Rebased onto the latest trunk, with removing duplicated entity in |
|
retest this please |
There was a problem hiding this comment.
Just to clarify. To put two blanks between two sentences is a writing style that goes back to classic type writers -- having a larger space between sentences makes it easier to read. Hence, removing all those double-blanks (to correct writing style) is just a lot of "noise" with no real value...
We can still merge this PR (as you put a lot of work into it already), however, I would encourage you to not do such PRs in the future. It's just additional review load (and committers already cannot handle the current load...) with no real value and thus a "waste" of your own time as well as the reviewer's time.
There was a problem hiding this comment.
@mjsax I see. I’ll be more careful from now on. Thanks for the detailed explanation.
There was a problem hiding this comment.
This is public API and cannot just be removed. Why do you think it should be removed?
There was a problem hiding this comment.
I'm sorry, it was a mistake; So reverted.
There was a problem hiding this comment.
@dongjinleekr Seems you did not revert this change yet.
There was a problem hiding this comment.
Where do we pass a null value? Also, where is the MetricScope in this test?
There was a problem hiding this comment.
supplier#metricsScope() returns null, for its setUp() configuration. It is same to [KeyValueStoreBuilderTest, TimestampedKeyValueStoreBuilderTest]#shouldThrowNullPointerIfMetricsScopeIsNull. SessionStoreBuilderTest#shouldThrowNullPointerIfMetricsScopeIsNull does same, but it also validates Exception message. (Wait, is this way more recommended?)
There was a problem hiding this comment.
Thanks for the clarification. However, I am still not sure if I understand this test. The constructor TimestampedWindowStoreBuilder does not call supplier.metricsScope() -- hence, it am still puzzled why this test would throw a NPE? To test metricScope() we would need to call build() method. In fact, following the call trace, we would never check if metricScope() returns null or not. Seems worth to fix... (maybe add a check in MeteredWindowStore constructor? -- not sure if the other MeteredXxxStore have a similar check. If not, would be good to add one.)
Seems it comes from supplier.name() -- for this case, the test setup is incorrect -- also in the test above actually, that would also fail with supplier.name() NPE, but not with the NPE they want to test.
does same, but it also validates Exception message. (Wait, is this way more recommended?)
Yes, it's always recommended to verify the exception message to make sure we test the right think. Using (expected = NullPointerException.class) annotation is not ideal.
There was a problem hiding this comment.
@mjsax I reviewed the problem more carefully and concluded that you are right - the NullPointerException here is not related to MetricScope. We need to rewrite the series of tests.
Let's review TimestampedWindowStoreBuilderTest#shouldThrowNullPointerIfMetricsScopeIsNull as an example. Here, supplier#name is null so when instantiating TimestampedWindowStoreBuilder, it fails in its parent class's constructor, AbstractStoreBuilder line 41 - Objects.requireNonNull(name, "name cannot be null");. It is also why SessionStoreBuilderTest#shouldThrowNullPointerIfMetricsScopeIsNull ends with a error message "name cannot be null" - obviously, it also has nothing to do with MetricScope.
Here is the debugger status; As you can see, supplier#name is null here.
I am now rewriting the tests. Stay tuned! 😄
There was a problem hiding this comment.
Same answer as above. 😓
|
The build is currently broker. There is already a PR to fix it: #8424 No need to retest until |
|
@dongjinleekr -- this PR needs a rebase. Might be nice to get it into 2.6? |
7077050 to
24b2515
Compare
|
@mjsax Here is the fix. I investigated the problem and found the following. The root of the problem is: the consturctors of As a evidence, if we give the To fix this problem, I added a validation method to each of the constructor of +1. I removed the 'two space' removal while rebasing onto the latest trunk; You are right, it is worthless. Instead, I added the other trivial fixes I found during reading the code. |
24b2515 to
382cbcb
Compare
382cbcb to
60ae960
Compare
|
@mjsax Could this PR get it into 2.7? 😃 |
There was a problem hiding this comment.
@guozhangwang Is this ok? I am not familiar with this part of the code. If false the default anyway?
There was a problem hiding this comment.
LGTM, since the method definition also has isRecoveredSwapFile: Boolean = false by default.
mjsax
left a comment
There was a problem hiding this comment.
Overall LGTM.
I am not familiar with core code so I hope @guozhangwang helps out. One comment though that needs to be resolved.
There was a problem hiding this comment.
@dongjinleekr Seems you did not revert this change yet.
|
It also seems that some test failed due to NPE. Those seems to need updates. |
…t]#shouldThrowNullPointerIfMetricsScopeIsNull: Other StateStores has it.
1. Fix javadoc typo: Stores#timestampedWindowStoreBuilder, windows-store -> window-store (Compare with Stores#timestampedKeyValueStoreBuilder) 2. Add omitted IllegalArgumentException condition in Stores#lruMap. 3. Add omitted IllegalArgumentException condition in WindowBytesStoreSupplier methods.
1. Remove unused method: TimeWindowedSerde#timeWindowedSerdeFrom(Class, long) 2. Remove duplicated parameter: Log#splitOverflowedSegment
…viderTest, StreamThreadStateStoreProviderTest (Note: compare with KeyValueStore cases.)
…re]BuilderTest#shouldThrowNullPointerIfMetricsScopeIsNull: now checks Exception message.
…ue,WindowStore,TimestampedWindowStore]BuilderTest#shouldThrowNullPointerIfMetricsScopeIsNull; No exceptions are thrown now.
…w,TimestampedWindow,Session]StoreBuilder constructors
…th 'TimestampedWindowStoreBuilder', 'SessionStoreBuilder', etc.)
- `KeyValueStoreBuilder`: `bytesStoreSupplier` → `storeSupplier` - `TimestampedKeyValueStoreBuilder`: `bytesStoreSupplier` → `storeSupplier` - `TimestampedWindowStoreBuilder`: `bytesStoreSupplier` → `storeSupplier` - `SessionStoreBuilder`: `supplier` → `storeSupplier`
…ppressScenarioTest
…shouldCreateKeyValueStoreWithTheProvidedInnerStore to return metricScope: without it, NullPointerExcepion is thrown during TimestampedKeyValueStore instance creation.
60ae960 to
9f7a73f
Compare
|
@mjsax The failing test is now fixed with commit 9f7a73f and mistakenly removed method is reverted in commit 6972309. Also, rebased onto the latest trunk. |
|
Thanks for the PR @dongjinleekr! Merged to |
…c. (apache#8130) Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Guozhang Wang <guozhang@confluent.io>, Matthias J. Sax <matthias@confluent.io>
* commit '2804257fe221f37e5098bd': (67 commits) KAFKA-10562: Properly invoke new StateStoreContext init (apache#9388) MINOR: trivial cleanups, javadoc errors, omitted StateStore tests, etc. (apache#8130) KAFKA-10564: only process non-empty task directories when internally cleaning obsolete state stores (apache#9373) KAFKA-9274: fix incorrect default value for `task.timeout.ms` config (apache#9385) KAFKA-10362: When resuming Streams active task with EOS, the checkpoint file is deleted (apache#9247) KAFKA-10028: Implement write path for feature versioning system (KIP-584) (apache#9001) KAFKA-10402: Upgrade system tests to python3 (apache#9196) KAFKA-10186; Abort transaction with pending data with TransactionAbortedException (apache#9280) MINOR: Remove `TargetVoters` from `DescribeQuorum` (apache#9376) Revert "KAFKA-10469: Resolve logger levels hierarchically (apache#9266)" MINOR: Don't publish javadocs for raft module (apache#9336) KAFKA-9929: fix: add missing default implementations (apache#9321) KAFKA-10188: Prevent SinkTask::preCommit from being called after SinkTask::stop (apache#8910) KAFKA-10338; Support PEM format for SSL key and trust stores (KIP-651) (apache#9345) KAFKA-10527; Voters should not reinitialize as leader in same epoch (apache#9348) MINOR: Refactor unit tests around RocksDBConfigSetter (apache#9358) KAFKA-6733: Printing additional ConsumerRecord fields in DefaultMessageFormatter (apache#9099) MINOR: Annotate test BlockingConnectorTest as integration test (apache#9379) MINOR: Fix failing test due to KAFKA-10556 PR (apache#9372) KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale. (apache#9320) ...

[WindowStoreBuilderTest, TimestampedWindowStoreBuilderTest]#shouldThrowNullPointerIfMetricsScopeIsNull: OtherStateStores has it.StoresJavadocExceptions + align javadoc parameterspublicfrom[Sink,Source]TaskContextWindowStore,SessionStoretest cases:GlobalStateStoreProviderTest,StreamThreadStateStoreProviderTest(Compare it withKeyValueStorecounterpart cases.)MeteredTimestampedWindowStorejavadocCommitter Checklist (excluded from commit message)