-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINOR: trivial cleanups, javadoc errors, omitted StateStore tests, etc. #8130
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 |
@@ -807,7 +807,7 @@ public void abortTransaction() throws ProducerFencedException { | |||
* data. | |||
* </p> | |||
* <p> | |||
* Some transactional send errors cannot be resolved with a call to {@link #abortTransaction()}. In particular, | |||
* Some transactional send errors cannot be resolved with a call to {@link #abortTransaction()}. n particular, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n -> "In"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! 😃
retest this please |
@@ -47,7 +47,7 @@ | |||
* and over, without explicitly enumerating all the partitions in the request and the | |||
* response. | |||
* | |||
* FetchSessionHandler tracks the partitions which are in the session. It also | |||
* FetchSessionHandler tracks the partitions which are in the session. It also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjsax I see. I’ll be more careful from now on. Thanks for the detailed explanation.
* Construct a {@code TimeWindowedSerde} object to deserialize changelog topic | ||
* for the specified inner class type and window size. | ||
*/ | ||
static public <T> Serde<Windowed<T>> timeWindowedSerdeFrom(final Class<T> type, final long windowSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is public API and cannot just be removed. Why do you think it should be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, it was a mistake; So reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dongjinleekr Seems you did not revert this change yet.
@@ -179,4 +179,9 @@ public void shouldThrowNullPointerIfTimeIsNull() { | |||
new TimestampedWindowStoreBuilder<>(supplier, Serdes.String(), Serdes.String(), null); | |||
} | |||
|
|||
@Test(expected = NullPointerException.class) | |||
public void shouldThrowNullPointerIfMetricsScopeIsNull() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we pass a null
value? Also, where is the MetricScope
in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Highly appreciated!
@@ -134,4 +134,9 @@ public void shouldThrowNullPointerIfTimeIsNull() { | |||
new WindowStoreBuilder<>(supplier, Serdes.String(), Serdes.String(), null); | |||
} | |||
|
|||
@Test(expected = NullPointerException.class) | |||
public void shouldThrowNullPointerIfMetricsScopeIsNull() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? 😃 |
@@ -2419,7 +2419,7 @@ class Log(@volatile private var _dir: File, | |||
|
|||
// replace old segment with new ones | |||
info(s"Replacing overflowed segment $segment with split segments $newSegments") | |||
replaceSegments(newSegments.toList, List(segment), isRecoveredSwapFile = false) | |||
replaceSegments(newSegments.toList, List(segment)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, since the method definition also has isRecoveredSwapFile: Boolean = false
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @guozhangwang for verifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM.
I am not familiar with core
code so I hope @guozhangwang helps out. One comment though that needs to be resolved.
* Construct a {@code TimeWindowedSerde} object to deserialize changelog topic | ||
* for the specified inner class type and window size. | ||
*/ | ||
static public <T> Serde<Windowed<T>> timeWindowedSerdeFrom(final Class<T> type, final long windowSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 <[email protected]>, Guozhang Wang <[email protected]>, Matthias J. Sax <[email protected]>
* 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
: OtherStateStore
s has it.Stores
JavadocException
s + align javadoc parameterspublic
from[Sink,Source]TaskContext
WindowStore
,SessionStore
test cases:GlobalStateStoreProviderTest
,StreamThreadStateStoreProviderTest
(Compare it withKeyValueStore
counterpart cases.)MeteredTimestampedWindowStore
javadocCommitter Checklist (excluded from commit message)