-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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-19231. Add JacksonUtil #6953
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
8edf3db
to
7e1efdc
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
86dfb30
to
a4befb7
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@ayushtkn @slfan1989 @steveloughran Would any of you have time to review this? |
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.
Looks good. My main concern is about to get that import placement right; we should move it into the org.apache block now. The fact we didn't do this for the Preconditions migration is it something I have mixed feelings about.
bad: keep putting new entries in the wrong place
good: marginally easier to cherrypick into branches which have not moved to the shaded stuff.
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JacksonUtil.java
Show resolved
Hide resolved
import com.fasterxml.jackson.core.JsonGenerator; | ||
import org.apache.hadoop.util.JacksonUtil; |
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.
move into org.apache block
...ommon-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/MetricsJsonBuilder.java
Outdated
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JacksonUtil.java
Outdated
Show resolved
Hide resolved
...ct/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/util/CombinedHostsFileReader.java
Show resolved
Hide resolved
import com.fasterxml.jackson.databind.ObjectReader; | ||
import org.apache.hadoop.util.JacksonUtil; |
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 should go below. that Preconditions entry is in the wrong place due to the move off guava being a search and replace
@@ -22,7 +22,7 @@ | |||
import java.nio.charset.StandardCharsets; | |||
import java.util.Map; | |||
|
|||
import com.fasterxml.jackson.databind.ObjectMapper; | |||
import org.apache.hadoop.util.JacksonUtil; |
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.
to the block below
@@ -29,9 +29,9 @@ | |||
import java.util.Hashtable; | |||
import java.util.Map; | |||
|
|||
import org.apache.hadoop.util.JacksonUtil; |
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.
how about moving both of these?
@@ -46,6 +47,19 @@ | |||
public class YarnServiceClient { | |||
|
|||
private static final Logger LOG = LoggerFactory.getLogger(YarnServiceClient.class); | |||
|
|||
/** | |||
* It is more performant to reuse ObjectMapper instances but keeping the instance |
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.
not 100% sure about that performant: isn't there some synchronisation locking going on so performance with a single mapper across many threads worse than 1 mapper per thread?
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 am a committer on the Jackson project. There is minimal synchronisation and I am actively removing many of the remaining cases. Even today, it is more performant to reuse ObjectMapper instead of creating multiple instances.
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.
are you? never knew that.
fix checkstyle
checkstyle issues
a8c72f9
to
da58faf
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
code looks good
- yarn spotbugs failure is being fixed elewhere
- HttpFS one is ancient. Does need fixing at some point though, here on an independent PR.
one little nit about imports
...p-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/RemoteSASKeyGeneratorImpl.java
Show resolved
Hide resolved
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JacksonUtil.java
Show resolved
Hide resolved
@@ -46,6 +47,19 @@ | |||
public class YarnServiceClient { | |||
|
|||
private static final Logger LOG = LoggerFactory.getLogger(YarnServiceClient.class); | |||
|
|||
/** | |||
* It is more performant to reuse ObjectMapper instances but keeping the instance |
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.
are you? never knew that.
💔 -1 overall
This message was automatically generated. |
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
+1
merged to trunk...can you do a branch-3.4 PR? |
New class org.apache.hadoop.util.JacksonUtil centralizes construction of Jackson ObjectMappers and JsonFactories. Contributed by PJ Fanning merge issues
#6998 created |
@steveloughran / @pjfanning is bit misleading, since it looses the actual exception, because we of a NPE during cleanup, but if you comment that NPE line & related ones, the exception seems to be this:
|
@ayushtkn The strange thing is that org.apache.hadoop.yarn.util.timeline.TimelineUtils imports another class from the same hadoop-common package as JacksonUtil. import org.apache.hadoop.util.VersionInfo; Is it possible that this CI task is another an older copy of hadoop-common jar? |
The HBase stuff is bit tricky, for the HBase test we use the older Hadoop version, which is compatible with the HBase release we are using. It is hardcoded here:
I think this problem is bit similar to YARN-8856 |
so what to do? revert?
|
The failing tests run with hadoop-common 3.3.6 and the JacksonUtil is not in 3.3.6. |
@pjfanning This pr brought some unit test errors. HBaseTimelineWriterImpl#testDomainIdTable
TestTimelineReaderWebServicesHBaseStorage#setup
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6977/10/testReport/ |
Have readed the context and understood the relevant reasons. Continuously encountering errors is not a good option; perhaps we should roll back first? |
I created #7010 |
I think we don't have an agreement on how to proceed here, we should most probably rollback considering the failing tests and rework later. lemme know if anyone has objections doing so, else will revert tmrw |
New class org.apache.hadoop.util.JacksonUtil centralizes construction of Jackson ObjectMappers and JsonFactories. Contributed by PJ Fanning
New class org.apache.hadoop.util.JacksonUtil centralizes construction of Jackson ObjectMappers and JsonFactories. Contributed by PJ Fanning
Description of PR
HADOOP-19231
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?