Skip to content

MINOR: Avoid using a big lock in pool#getAndMaybePut#5258

Merged
ijuma merged 3 commits intoapache:trunkfrom
cmccabe:improve_pool_get_and_maybe_put
Jun 23, 2018
Merged

MINOR: Avoid using a big lock in pool#getAndMaybePut#5258
ijuma merged 3 commits intoapache:trunkfrom
cmccabe:improve_pool_get_and_maybe_put

Conversation

@cmccabe
Copy link
Copy Markdown
Contributor

@cmccabe cmccabe commented Jun 20, 2018

Avoid using a big createLock in pool#getAndMaybePut by using the
ConcurrentHashMap#computeIfAbsent function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use a lambda please :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, this is Scala code and lambdas won't work in Scala 2.11 (but will in Scala 2.12).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, I'll leave it as-is then

@ijuma ijuma added performance core Kafka Broker labels Jun 20, 2018
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please fix the formatting here? There should be a space after :.

cmccabe added 2 commits June 22, 2018 14:58
Avoid using a big createLock in pool#getAndMaybePut by using the
ConcurrentHashMap#computeIfAbsent function.
@cmccabe cmccabe force-pushed the improve_pool_get_and_maybe_put branch from fb00d8e to 1dbc5ca Compare June 22, 2018 21:58
Copy link
Copy Markdown
Member

@ijuma ijuma left a comment

Choose a reason for hiding this comment

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

I pushed minor formatting fixes, LGTM. Will merge to trunk and 2.0.

@ijuma ijuma merged commit bd216db into apache:trunk Jun 23, 2018
ijuma pushed a commit that referenced this pull request Jun 23, 2018
Use `ConcurrentHashMap#computeIfAbsent` which relies on
per key locks.

Reviewers: Ismael Juma <ismael@juma.me.uk>
ijuma pushed a commit that referenced this pull request Jun 23, 2018
Use `ConcurrentHashMap#computeIfAbsent` which relies on
per key locks.

Reviewers: Ismael Juma <ismael@juma.me.uk>
ijuma added a commit that referenced this pull request Jun 24, 2018
It requires Java 8 and 1.1 still supports Java 7.

This reverts commit dc3acb0.
ying-zheng pushed a commit to ying-zheng/kafka that referenced this pull request Jul 6, 2018
Use `ConcurrentHashMap#computeIfAbsent` which relies on
per key locks.

Reviewers: Ismael Juma <ismael@juma.me.uk>
allenxwang pushed a commit to allenxwang/kafka that referenced this pull request Aug 24, 2018
…:1.1.1-sync to 1.1-nflx

* commit '9611672e287c1a7933a78590e3f381da2ae7d136': (57 commits)
  MINOR: increase dev version from 1.1.1-SNAPSHOT to 1.1.2-SNAPSHOT (apache#5409)
  MINOR: Add thread dumps if broker node cannot be stopped (apache#5373)
  MINOR: update release.py
  MINOR: fix upgrade docs for Streams (apache#5392)
  MINOR: improve docs version numbers (apache#5372)
  Update version on the branch to 1.1.2-SNAPSHOT
  KAFKA-6292; Improve FileLogInputStream batch position checks to avoid type overflow (apache#4928)
  HOTFIX: Fix checkstyle errors in MetricsTest (apache#5345)
  KAFKA-7136: Avoid deadlocks in synchronized metrics reporters (apache#5341)
  MINOR: Close timing window in SimpleAclAuthorizer startup (apache#5318)
  MINOR: Use kill_java_processes when killing ConsoleConsumer in system tests (apache#5297)
  KAFKA-7104: More consistent leader's state in fetch response (apache#5305)
  Revert "MINOR: Avoid coarse lock in Pool#getAndMaybePut (apache#5258)"
  MINOR: Avoid coarse lock in Pool#getAndMaybePut (apache#5258)
  MINOR: bugfix streams total metrics (apache#5277)
  KAFKA-7082: Concurrent create topics may throw NodeExistsException (apache#5259)
  MINOR: Upgrade to Gradle 4.8.1
  KAFKA-7012: Don't process SSL channels without data to process (apache#5237)
  KAFKA-7058: Comparing schema default values using Objects#deepEquals()
  KAFKA-7047: Added SimpleHeaderConverter to plugin isolation whitelist
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants