-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
[FLINK-20580][core] Don't support nullable value for SerializedValue #14936
[FLINK-20580][core] Don't support nullable value for SerializedValue #14936
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 3687cf9 (Sat Feb 13 05:43:59 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
3687cf9
to
1a04c87
Compare
1a04c87
to
4895ac2
Compare
4895ac2
to
69e5215
Compare
Azure FAILURE is unrelated to changes and reported to existing jira https://issues.apache.org/jira/browse/FLINK-21214. |
@flinkbot run azure |
Hi @rmetzger, |
69e5215
to
f0b807f
Compare
@flinkbot attention @tillrohrmann |
The most reliable way of triggering another Azure build is by pushing to the branch again. It seemed to have worked this time. |
f0b807f
to
ddb9314
Compare
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.
Very good work @kezhuw! The changes look good to me. I will address my own comments while merging this PR.
SerializedValue<String> saved = | ||
SerializedValue.fromBytes(Arrays.copyOf(bytes, bytes.length)); | ||
assertEquals(v, saved); | ||
assertArrayEquals(v.getByteArray(), saved.getByteArray()); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
fail(e.getMessage()); | ||
} | ||
} | ||
|
||
@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.
Might be a bit shorter:
@Test | |
@Test(expected = NullPointerException.class) |
|
||
assertNull(copy.deserializeValue(getClass().getClassLoader())); | ||
@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.
Same here with @Test(expected = ...)
.
} catch (Exception e) { | ||
e.printStackTrace(); | ||
fail(e.getMessage()); | ||
@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.
Same here with @Test(exepcted = ...)
.
import static org.hamcrest.Matchers.nullValue; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class AkkaRpcSerializedValueTest { |
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.
public class AkkaRpcSerializedValueTest { | |
public class AkkaRpcSerializedValueTest extends TestLogger { |
This makes sure that the test names are printed. This is quite helpful for CI where multiple tests are executed one after another and the names help to split the log messages from the different test cases.
@tillrohrmann Thanks for reviewing, the comments make sense to me. Then I will give up rebasing to you. |
What is the purpose of the change
Dropping nullable-value support from
SerializedValue
to simplify its usages. Callers should resort to nullabe/optional variable ofSerializedValue
if them want such behavior but just can't treatSerializedValue
as another optional container anymore.Brief change log
SerializedValue
in rpc module to its own wire value class. This make this module self-contained and resistant to rpc usages ofSerializedValue
.SerializedValue
.Verifying this change
This change is already covered by existing tests, such as (please describe tests).
SerializedValueTest.testSimpleValue
.This change added tests and can be verified as follows:
SerializedValueTest.testNullValue
,SerializedValueTest.testFromNullBytes
,SerializedValueTest.testFromEmptyBytes
AkkaRpcSerializedValueTest
AkkaRpcActorTest.canRespondWithSerializedValueLocally
,RemoteAkkaRpcActorTest.canRespondWithSerializedValueRemotely
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation
WARNING
This change will breaking tm/jm rolling update if we ever support it. I got nothing of such supporting from docs and assume no such guarantee.