Skip to content

Comments

SPARK-37061: Fix CustomMetrics when using Inner Classes#34344

Closed
RussellSpitzer wants to merge 1 commit intoapache:masterfrom
RussellSpitzer:SPARK-37061
Closed

SPARK-37061: Fix CustomMetrics when using Inner Classes#34344
RussellSpitzer wants to merge 1 commit intoapache:masterfrom
RussellSpitzer:SPARK-37061

Conversation

@RussellSpitzer
Copy link
Member

What changes were proposed in this pull request?

Previously CustomMetrics use Class.getCanonicalName when attempting to get the
class name of CustomMetric implementations. These names replace special characters
for marking inner classes like ($) with ".". While those names are appropriate for
referring to classes within source files, they will not work during reflection where
the Class.getName output should be used.

Why are the changes needed?

InnerClasses could never be found in when they are used as Custom Metrics

Does this PR introduce any user-facing change?

No

How was this patch tested?

Tests modified so they access both an independent metric class as well as an inner class.

Previously CustomMetrics use Class.getCanonicalName when attempting to get the
class name of CustomMetric implementations. These names replace special characters
for marking inner classes like ($) with ".". While those names are appropriate for
referring to classes withing source files, they will not work during reflection where
the Class.getName output should be used.
@RussellSpitzer RussellSpitzer deleted the SPARK-37061 branch October 20, 2021 22:25
@RussellSpitzer RussellSpitzer restored the SPARK-37061 branch October 20, 2021 22:29
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants