You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by bo...@apache.org on 2018/12/06 17:55:02 UTC
samza git commit: SAMZA-2030: Config mock
Repository: samza
Updated Branches:
refs/heads/master e2adf8f99 -> b126683ae
SAMZA-2030: Config mock
Fix getOption of ScalaMapConfig to support mocking.
Author: Boris S <bs...@linkedin.com>
Author: Boris S <bo...@apache.org>
Author: Boris Shkolnik <bs...@linkedin.com>
Reviewers: Shanthoosh Venkataraman <sv...@linkedin.com>
Closes #847 from sborya/ConfigMock
Project: http://git-wip-us.apache.org/repos/asf/samza/repo
Commit: http://git-wip-us.apache.org/repos/asf/samza/commit/b126683a
Tree: http://git-wip-us.apache.org/repos/asf/samza/tree/b126683a
Diff: http://git-wip-us.apache.org/repos/asf/samza/diff/b126683a
Branch: refs/heads/master
Commit: b126683ae9c4d81aeca7b8bc72bf5afd00cd57fe
Parents: e2adf8f
Author: Boris S <bs...@linkedin.com>
Authored: Thu Dec 6 09:54:55 2018 -0800
Committer: Boris S <bs...@linkedin.com>
Committed: Thu Dec 6 09:54:55 2018 -0800
----------------------------------------------------------------------
.../main/scala/org/apache/samza/config/ScalaMapConfig.scala | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/samza/blob/b126683a/samza-core/src/main/scala/org/apache/samza/config/ScalaMapConfig.scala
----------------------------------------------------------------------
diff --git a/samza-core/src/main/scala/org/apache/samza/config/ScalaMapConfig.scala b/samza-core/src/main/scala/org/apache/samza/config/ScalaMapConfig.scala
index f648ced..ca1979d 100644
--- a/samza-core/src/main/scala/org/apache/samza/config/ScalaMapConfig.scala
+++ b/samza-core/src/main/scala/org/apache/samza/config/ScalaMapConfig.scala
@@ -23,7 +23,7 @@ import org.apache.samza.SamzaException
class ScalaMapConfig(config: Config) extends MapConfig(config) {
def getOrElse(k: String, els: String) = getOption(k).getOrElse(els)
- def getOption(k: String): Option[String] = if (containsKey(k)) Some(config.get(k)) else None
+ def getOption(k: String): Option[String] = if (config.containsKey(k)) Some(config.get(k)) else None
def getNonEmptyOption(k: String): Option[String] = {
getOption(k) match {
@@ -33,11 +33,11 @@ class ScalaMapConfig(config: Config) extends MapConfig(config) {
}
- def getExcept(k: String, msg: String = null): String =
+ def getExcept(k: String, msg: String = null): String =
getOption(k) match {
case Some(s) => s
case _ =>
- val error =
+ val error =
if(msg == null) "Missing required configuration '%s'".format(k)
else "Missing required configuration '%s': %s".format(k, msg)
throw new SamzaException(error)