You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2017/02/23 16:29:04 UTC
kafka git commit: KAFKA-4788: Revert "KAFKA-4092: retention.bytes
should not be allowed to be less than segment.bytes"
Repository: kafka
Updated Branches:
refs/heads/trunk 015f1d738 -> 5a2abc518
KAFKA-4788: Revert "KAFKA-4092: retention.bytes should not be allowed to be less than segment.bytes"
The intent is good, but it needs to take into account broker configs as well.
See KAFKA-4788 for more details.
This reverts commit 4ca5abe8ee7578f602fb7653cb8a09640607ea85.
Author: Ismael Juma <is...@juma.me.uk>
Reviewers: Jun Rao <ju...@gmail.com>
Closes #2588 from ijuma/kafka-4788
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/5a2abc51
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/5a2abc51
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/5a2abc51
Branch: refs/heads/trunk
Commit: 5a2abc51821fab4d3834b615e577d97e0f0e6494
Parents: 015f1d7
Author: Ismael Juma <is...@juma.me.uk>
Authored: Thu Feb 23 16:28:38 2017 +0000
Committer: Ismael Juma <is...@juma.me.uk>
Committed: Thu Feb 23 16:28:38 2017 +0000
----------------------------------------------------------------------
core/src/main/scala/kafka/log/LogConfig.scala | 11 -----------
core/src/test/scala/unit/kafka/log/LogConfigTest.scala | 10 ----------
2 files changed, 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/5a2abc51/core/src/main/scala/kafka/log/LogConfig.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/LogConfig.scala b/core/src/main/scala/kafka/log/LogConfig.scala
index eaa6016..55669c0 100755
--- a/core/src/main/scala/kafka/log/LogConfig.scala
+++ b/core/src/main/scala/kafka/log/LogConfig.scala
@@ -324,22 +324,11 @@ object LogConfig {
}
/**
- * Check that the property values are valid relative to each other
- */
- def validateValues(props: Properties) {
- val segmentBytes = if (props.getProperty(SegmentBytesProp) == null) Defaults.SegmentSize else props.getProperty(SegmentBytesProp).toLong
- val retentionBytes = if (props.getProperty(RetentionBytesProp) == null) Defaults.RetentionSize else props.getProperty(RetentionBytesProp).toLong
- if (segmentBytes > retentionBytes && retentionBytes != -1)
- throw new InvalidConfigurationException(s"segment.bytes ${segmentBytes} is not less than or equal to retention.bytes ${retentionBytes}")
- }
-
- /**
* Check that the given properties contain only valid log config names and that all values can be parsed and are valid
*/
def validate(props: Properties) {
validateNames(props)
configDef.parse(props)
- validateValues(props)
}
}
http://git-wip-us.apache.org/repos/asf/kafka/blob/5a2abc51/core/src/test/scala/unit/kafka/log/LogConfigTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/log/LogConfigTest.scala b/core/src/test/scala/unit/kafka/log/LogConfigTest.scala
index 5df76bc..66702d6 100644
--- a/core/src/test/scala/unit/kafka/log/LogConfigTest.scala
+++ b/core/src/test/scala/unit/kafka/log/LogConfigTest.scala
@@ -111,16 +111,6 @@ class LogConfigTest {
case _: ConfigException => false
}
}
- def testValueValidator() {
- val p = new Properties()
- p.setProperty(LogConfig.SegmentBytesProp, "100")
- p.setProperty(LogConfig.RetentionBytesProp, "100")
- LogConfig.validate(p)
- p.setProperty(LogConfig.RetentionBytesProp, "90")
- intercept[IllegalArgumentException] {
- LogConfig.validate(p)
- }
- }
private def assertPropertyInvalid(name: String, values: AnyRef*) {
values.foreach((value) => {