You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by jm...@apache.org on 2019/02/14 14:47:09 UTC
[samza] branch master updated: Make config immutable again (#919)
This is an automated email from the ASF dual-hosted git repository.
jmakes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git
The following commit(s) were added to refs/heads/master by this push:
new 7f6da82 Make config immutable again (#919)
7f6da82 is described below
commit 7f6da82607e16ac5cb51db881cff512a0f2a8b9c
Author: Andrei Paikin <an...@gmail.com>
AuthorDate: Thu Feb 14 17:47:05 2019 +0300
Make config immutable again (#919)
---
samza-api/src/main/java/org/apache/samza/config/Config.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/samza-api/src/main/java/org/apache/samza/config/Config.java b/samza-api/src/main/java/org/apache/samza/config/Config.java
index 68f085c..2b0d2ed 100644
--- a/samza-api/src/main/java/org/apache/samza/config/Config.java
+++ b/samza-api/src/main/java/org/apache/samza/config/Config.java
@@ -27,6 +27,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.BiFunction;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -42,7 +43,7 @@ public abstract class Config implements Map<String, String>, Serializable {
}
public Config subset(String prefix, boolean stripPrefix) {
- Map<String, String> out = new HashMap<String, String>();
+ Map<String, String> out = new HashMap<>();
for (Entry<String, String> entry : entrySet()) {
String k = entry.getKey();
@@ -59,7 +60,7 @@ public abstract class Config implements Map<String, String>, Serializable {
}
public Config regexSubset(String regex) {
- Map<String, String> out = new HashMap<String, String>();
+ Map<String, String> out = new HashMap<>();
Pattern pattern = Pattern.compile(regex);
for (Entry<String, String> entry : entrySet()) {
@@ -245,4 +246,8 @@ public abstract class Config implements Map<String, String>, Serializable {
public String remove(Object s) {
throw new ConfigException("Config is immutable.");
}
+
+ public void replaceAll(BiFunction<? super String, ? super String, ? extends String> function) {
+ throw new ConfigException("Config is immutable.");
+ }
}