Skip to content
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

MINOR: Update Scala to 2.13.3 #8931

Merged
merged 5 commits into from
Jun 26, 2020
Merged

MINOR: Update Scala to 2.13.3 #8931

merged 5 commits into from
Jun 26, 2020

Conversation

ijuma
Copy link
Contributor

@ijuma ijuma commented Jun 25, 2020

I had to fix several compiler errors due to deprecation of auto application of (). A related
Xlint config (-Xlint:nullary-override) is no longer valid in 2.13, so we now only enable it
for 2.12. The compiler flagged two new inliner warnings that required suppression and
the semantics of & in @nowarn annotations changed, requiring a small change in
one of the warning suppressions.

I also removed the deprecation of a number of methods in KafkaZkClient as
they should not have been deprecated in the first place since KafkaZkClient is an
internal class and we still use these methods in the Controller and so on. This
became visible because the Scala compiler now respects Java's @Deprecated
annotation.

Finally, I included a few minor clean-ups (eg using toBuffer instead toList) when fixing
the compilation warnings.

Noteworthy bug fixes in Scala 2.13.3:

  • Fix 2.13-only bug in Java collection converters that caused some operations to perform an extra pass
  • Fix 2.13.2 performance regression in Vector: restore special cases for small operands in appendedAll and prependedAll
  • Increase laziness of #:: for LazyList
  • Fixes related to annotation parsing of @deprecated from Java sources in mixed compilation

Full release notes:
https://github.com/scala/scala/releases/tag/v2.13.3

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@ijuma ijuma requested a review from omkreddy June 26, 2020 04:01
@ijuma
Copy link
Contributor Author

ijuma commented Jun 26, 2020

Two jobs passed, one failed with a seemingly unrelated issue.

@ijuma
Copy link
Contributor Author

ijuma commented Jun 26, 2020

retest this please

@@ -548,9 +550,9 @@ class AclAuthorizer extends Authorizer with Logging {

private def updateCache(resource: ResourcePattern, versionedAcls: VersionedAcls): Unit = {
if (versionedAcls.acls.nonEmpty) {
aclCache = aclCache + (resource -> versionedAcls)
aclCache = aclCache.updated(resource, versionedAcls)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids the tuple creation.

@@ -367,7 +367,8 @@ class AclAuthorizer extends Authorizer with Logging {
} else false
}

@nowarn("cat=deprecation&cat=optimizer")
@nowarn("cat=deprecation")
@nowarn("cat=optimizer")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior of & was changed so that both conditions have to evaluate to true for a warning to match the exclusion.

@@ -538,6 +539,7 @@ class AclAuthorizer extends Authorizer with Logging {
}
}

@nowarn("cat=optimizer")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New warning flagged by the compiler.

@@ -566,6 +568,7 @@ object ConsumerGroupCommand extends Logging {
/**
* Returns the state of the specified consumer group and partition assignment states
*/
@nowarn("cat=optimizer")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New warning flagged by the compiler.

@@ -1210,7 +1210,7 @@ object KafkaConfig {
.define(PasswordEncoderIterationsProp, INT, Defaults.PasswordEncoderIterations, atLeast(1024), LOW, PasswordEncoderIterationsDoc)
}

def configNames() = configDef.names().asScala.toList.sorted
def configNames: Seq[String] = configDef.names.asScala.toBuffer.sorted
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toBuffer is more efficient than toList and sorted returns a copy anyway.

*/
@Deprecated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to deprecate a method in an internal class that is still needed by our code. Removed the deprecation of various KafkaZkClient classes. cc @stanislavkozlovski

Copy link
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ijuma Thanks for the PR. LGTM.

@ijuma ijuma merged commit 7f90a58 into apache:trunk Jun 26, 2020
@ijuma ijuma deleted the scala-2.13.3 branch June 26, 2020 17:19
@ijuma
Copy link
Contributor Author

ijuma commented Jun 26, 2020

One job passed, two had a single unrelated test failure.

Kvicii pushed a commit to Kvicii/kafka that referenced this pull request Jun 27, 2020
* 'trunk' of github.com:apache/kafka:
  KAFKA-10180: Fix security_config caching in system tests (apache#8917)
  KAFKA-10173: Fix suppress changelog binary schema compatibility (apache#8905)
  KAFKA-10166: always write checkpoint before closing an (initialized) task (apache#8926)
  MINOR: Rename SslTransportLayer.State."NOT_INITALIZED" enum value to "NOT_INITIALIZED"
  MINOR: Update Scala to 2.13.3 (apache#8931)
  KAFKA-9076: support consumer sync across clusters in MM 2.0 (apache#7577)
  MINOR: Remove Diamond and code code Alignment (apache#8107)
  KAFKA-10198: guard against recycling dirty state (apache#8924)
udaynpusa pushed a commit to mapr/kafka that referenced this pull request Apr 25, 2024
This change bumps scala version to 2.13.12 and cherry-picks squashed combination of the following commits (only scala-related changes):
dfaae31 MINOR: Upgrade Scala for Java 20/21 support (apache#13840)
6ae08c4 KAFKA-14256: Upgrade from Scala 2.13.8 to 2.13.10 (apache#12675)
7c2d672 MINOR: Update library dependencies (Q1 2022) (apache#11306)
a8bd649 MINOR: Update Scala to 2.13.6 (apache#10711)
dd34e40 MINOR: Update Scala to 2.13.5 (apache#10169)
cbf8ad2 MINOR: Upgrade to Scala 2.13.4 (apache#9643)
7f90a58 MINOR: Update Scala to 2.13.3 (apache#8931)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants