LuciferYang opened a new pull request #35780:
URL: https://github.com/apache/spark/pull/35780
### What changes were proposed in this pull request?
`initLayout` method in `LogDivertAppender` as follows:
```java
private static StringLayout initLayout(OperationLog.LoggingLevel
loggingMode) {
...
for (Map.Entry<String, Appender> entry : appenders.entrySet()) {
Appender ap = entry.getValue();
if (ap.getClass().equals(ConsoleAppender.class)) {
Layout l = ap.getLayout();
if (l.getClass().equals(StringLayout.class)) {
layout = (StringLayout) l;
break;
}
}
}
return getLayout(isVerbose, layout);
}
```
`l.getClass().equals(StringLayout.class)` in above method is always return
`false` because `StringLayout` is an interface,
for example, `JsonLayout` is an implementation of `StringLayout`, but
`JsonLayout.class.equals(StringLayout.class)` will return false.
This pr change to use `instanceof` to fix the issue.
### Why are the changes needed?
Bug fix
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass GA
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]