You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2019/03/06 21:14:16 UTC
[incubator-pinot] branch master updated: Log actual configurations
for SegmentCreationMapper (#3914)
This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 06da717 Log actual configurations for SegmentCreationMapper (#3914)
06da717 is described below
commit 06da717acac9ce6f63842195e4cd85d561fdf9c4
Author: Xiaotian (Jackie) Jiang <17...@users.noreply.github.com>
AuthorDate: Wed Mar 6 13:14:10 2019 -0800
Log actual configurations for SegmentCreationMapper (#3914)
---
.../hadoop/job/mapper/SegmentCreationMapper.java | 27 +++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/mapper/SegmentCreationMapper.java b/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/mapper/SegmentCreationMapper.java
index 4258e96..705e1ad 100644
--- a/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/mapper/SegmentCreationMapper.java
+++ b/pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/mapper/SegmentCreationMapper.java
@@ -22,6 +22,7 @@ import com.google.common.base.Preconditions;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Map;
import javax.annotation.Nullable;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
@@ -85,9 +86,7 @@ public class SegmentCreationMapper extends Mapper<LongWritable, Text, LongWritab
public void setup(Context context)
throws IOException, InterruptedException {
_jobConf = context.getConfiguration();
- _logger.info("*********************************************************************");
- _logger.info("Job Configurations: {}", _jobConf);
- _logger.info("*********************************************************************");
+ logConfigurations();
_rawTableName = Preconditions.checkNotNull(_jobConf.get(JobConfigConstants.SEGMENT_TABLE_NAME));
_schema = Schema.fromString(_jobConf.get(JobConfigConstants.SCHEMA));
@@ -162,6 +161,28 @@ public class SegmentCreationMapper extends Mapper<LongWritable, Text, LongWritab
_logger.info("*********************************************************************");
}
+ protected void logConfigurations() {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append('{');
+ boolean firstEntry = true;
+ for (Map.Entry<String, String> entry : _jobConf) {
+ if (!firstEntry) {
+ stringBuilder.append(", ");
+ } else {
+ firstEntry = false;
+ }
+
+ stringBuilder.append(entry.getKey());
+ stringBuilder.append('=');
+ stringBuilder.append(entry.getValue());
+ }
+ stringBuilder.append('}');
+
+ _logger.info("*********************************************************************");
+ _logger.info("Job Configurations: {}", stringBuilder.toString());
+ _logger.info("*********************************************************************");
+ }
+
@Override
protected void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org