Refactor CallerContext's constructor to eliminate duplicate code (#5070)

Reviewed-by: Tao Li <tomscut@apache.org>
Reviewed-by: Zander Xu <zanderxu@apache.org>
This commit is contained in:
Wang Yu 2022-10-26 06:40:31 +08:00 committed by GitHub
parent f140506d67
commit 37bff63c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -140,12 +140,8 @@ public final class CallerContext {
}
public Builder(String context, Configuration conf) {
if (isValid(context)) {
sb.append(context);
}
fieldSeparator = conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY,
HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT);
checkFieldSeparator(fieldSeparator);
this(context, conf.get(HADOOP_CALLER_CONTEXT_SEPARATOR_KEY,
HADOOP_CALLER_CONTEXT_SEPARATOR_DEFAULT));
}
public Builder(String context, String separator) {