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
KAFKA-13270: Set JUTE_MAXBUFFER to 4 MB by default #11295
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,7 +336,7 @@ object KafkaConfig { | |
ZkSslCrlEnableProp -> "zookeeper.ssl.crl", | ||
ZkSslOcspEnableProp -> "zookeeper.ssl.ocsp") | ||
|
||
private[kafka] def getZooKeeperClientProperty(clientConfig: ZKClientConfig, kafkaPropName: String): Option[String] = { | ||
private[kafka] def zooKeeperClientProperty(clientConfig: ZKClientConfig, kafkaPropName: String): Option[String] = { | ||
Option(clientConfig.getProperty(ZkSslConfigToSystemPropertyMap(kafkaPropName))) | ||
} | ||
|
||
|
@@ -345,7 +345,7 @@ object KafkaConfig { | |
kafkaPropName match { | ||
case ZkSslEndpointIdentificationAlgorithmProp => (kafkaPropValue.toString.toUpperCase == "HTTPS").toString | ||
case ZkSslEnabledProtocolsProp | ZkSslCipherSuitesProp => kafkaPropValue match { | ||
case list: java.util.List[_] => list.asInstanceOf[java.util.List[_]].asScala.mkString(",") | ||
case list: java.util.List[_] => list.asScala.mkString(",") | ||
case _ => kafkaPropValue.toString | ||
} | ||
case _ => kafkaPropValue.toString | ||
|
@@ -354,10 +354,10 @@ object KafkaConfig { | |
|
||
// For ZooKeeper TLS client authentication to be enabled the client must (at a minimum) configure itself as using TLS | ||
// with both a client connection socket and a key store location explicitly set. | ||
private[kafka] def zkTlsClientAuthEnabled(zkClientConfig: ZKClientConfig) = { | ||
getZooKeeperClientProperty(zkClientConfig, ZkSslClientEnableProp).getOrElse("false") == "true" && | ||
getZooKeeperClientProperty(zkClientConfig, ZkClientCnxnSocketProp).isDefined && | ||
getZooKeeperClientProperty(zkClientConfig, ZkSslKeyStoreLocationProp).isDefined | ||
private[kafka] def zkTlsClientAuthEnabled(zkClientConfig: ZKClientConfig): Boolean = { | ||
zooKeeperClientProperty(zkClientConfig, ZkSslClientEnableProp).map(_ == "true").getOrElse(false) && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: We could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, even better: |
||
zooKeeperClientProperty(zkClientConfig, ZkClientCnxnSocketProp).isDefined && | ||
zooKeeperClientProperty(zkClientConfig, ZkSslKeyStoreLocationProp).isDefined | ||
} | ||
|
||
/** ********* General Configuration ***********/ | ||
|
@@ -1443,7 +1443,7 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: Boolean, dynamicConfigO | |
// Need to translate any system property value from true/false (String) to true/false (Boolean) | ||
val actuallyProvided = originals.containsKey(propKey) | ||
if (actuallyProvided) getBoolean(propKey) else { | ||
val sysPropValue = KafkaConfig.getZooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
val sysPropValue = KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
sysPropValue match { | ||
case Some("true") => true | ||
case Some(_) => false | ||
|
@@ -1456,35 +1456,27 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: Boolean, dynamicConfigO | |
// Use the system property if it exists and the Kafka config value was defaulted rather than actually provided | ||
val actuallyProvided = originals.containsKey(propKey) | ||
if (actuallyProvided) getString(propKey) else { | ||
val sysPropValue = KafkaConfig.getZooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
sysPropValue match { | ||
case Some(_) => sysPropValue.get | ||
KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) match { | ||
case Some(v) => v | ||
case _ => getString(propKey) // not specified so use the default value | ||
} | ||
} | ||
} | ||
|
||
private def zkOptionalStringConfigOrSystemProperty(propKey: String): Option[String] = { | ||
Option(getString(propKey)) match { | ||
case config: Some[String] => config | ||
case _ => KafkaConfig.getZooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
Option(getString(propKey)).orElse { | ||
KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
} | ||
} | ||
private def zkPasswordConfigOrSystemProperty(propKey: String): Option[Password] = { | ||
Option(getPassword(propKey)) match { | ||
case config: Some[Password] => config | ||
case _ => { | ||
val sysProp = KafkaConfig.getZooKeeperClientProperty (zkClientConfigViaSystemProperties, propKey) | ||
if (sysProp.isDefined) Some (new Password (sysProp.get) ) else None | ||
} | ||
Option(getPassword(propKey)).orElse { | ||
KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey).map(new Password(_)) | ||
} | ||
} | ||
private def zkListConfigOrSystemProperty(propKey: String): Option[util.List[String]] = { | ||
Option(getList(propKey)) match { | ||
case config: Some[util.List[String]] => config | ||
case _ => { | ||
val sysProp = KafkaConfig.getZooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey) | ||
if (sysProp.isDefined) Some(sysProp.get.split("\\s*,\\s*").toList.asJava) else None | ||
Option(getList(propKey)).orElse { | ||
KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, propKey).map { sysProp => | ||
sysProp.split("\\s*,\\s*").toBuffer.asJava | ||
} | ||
} | ||
} | ||
|
@@ -1505,12 +1497,13 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: Boolean, dynamicConfigO | |
// Need to translate any system property value from true/false to HTTPS/<blank> | ||
val kafkaProp = KafkaConfig.ZkSslEndpointIdentificationAlgorithmProp | ||
val actuallyProvided = originals.containsKey(kafkaProp) | ||
if (actuallyProvided) getString(kafkaProp) else { | ||
val sysPropValue = KafkaConfig.getZooKeeperClientProperty(zkClientConfigViaSystemProperties, kafkaProp) | ||
sysPropValue match { | ||
if (actuallyProvided) | ||
getString(kafkaProp) | ||
else { | ||
KafkaConfig.zooKeeperClientProperty(zkClientConfigViaSystemProperties, kafkaProp) match { | ||
case Some("true") => "HTTPS" | ||
case Some(_) => "" | ||
case _ => getString(kafkaProp) // not specified so use the default value | ||
case None => getString(kafkaProp) // not specified so use the default value | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: We could remove the extra block defined by the last
{
on this line.