-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
HADOOP-16488 Deprecated JsonSerialization and move it out of hadoop-c… #1222
base: trunk
Are you sure you want to change the base?
Conversation
Ping @steveloughran @jojochuang . This is the first try. Not finished yet. The approach is to introduce a GsonSerialization, and use it to replace the JsonSerialization. And now the difficulty is that, we use the jackson annotation in many places, so I still need sometime to find out how to deal with these annotations. And for hadoop-aws, maybe we can just move copy some code for JsonSerialization there, as the java sdk for aws depends on jackson so it is useless to purge the jackson dependency for it. |
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
|
||
import static org.apache.commons.lang3.StringUtils.isBlank; | ||
import static org.apache.commons.lang3.StringUtils.isNotBlank; | ||
|
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.
your IDE is moving imports around which is shouldn't; this always makes backporting of patches to a key class harder. Can you leave out all changes to the imports except for those classes added/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.
Is there an import order rule? I checked several files but can not find the pattern, static import can be anywhere, and no alphabetical order...
dumpGenerator.writeStartArray(); | ||
dumpGenerator.flush(); | ||
JsonWriter jsonWriter = new JsonWriter(out); | ||
jsonWriter.beginObject().name("properties").beginArray().flush(); |
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.
do we have tests for this writing of configs? If not, they're needed first
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.
We have, but as you said below, if we purge jackson completely, there is no way to ensure that the json format is not changed, as in tests we also use gson...
AWS SDK is shaded; their problem. We need to get hadoop-aws off it, which is doable. Hadoop-registry is the origin of this code; need to review that to make sure the records persistet can be marshalled without problems For all the changes, I think we should add tests verifying consistent loading of existing classes first. That is: we save the current .json files as test resources and verify that they can be loaded with the new code. That's a good practise anyway, isn't it? |
This seems to be a good idea. Will have a try after I finish purging the jackson stuff. Thanks. |
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
💔 -1 overall
This message was automatically generated. |
@@ -18,14 +18,18 @@ | |||
|
|||
package org.apache.hadoop.conf; | |||
|
|||
import static org.apache.commons.lang3.StringUtils.isBlank; |
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.
these should go at the bottom; imports should be as unchanged as possible
|
||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
import java.util.regex.PatternSyntaxException; |
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.
and similarly, dont reorder stuff even when its wrong...it makes backporting too hard
@@ -57,9 +57,13 @@ | |||
* {@code org.apache.hadoop.registry.client.binding.JsonSerDeser}, | |||
* which is now a subclass of this class. | |||
* @param <T> Type to marshal. | |||
* @deprecated Avoid using this class any more, as jackson has |
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.
whitespace:end of line
💔 -1 overall
This message was automatically generated. |
…ommon