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 19:45:49 UTC

[incubator-pinot] branch segment_creation_configurations created (now 9bda103)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a change to branch segment_creation_configurations
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 9bda103  Log actual configurations for SegmentCreationMapper

This branch includes the following new commits:

     new 9bda103  Log actual configurations for SegmentCreationMapper

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[incubator-pinot] 01/01: Log actual configurations for SegmentCreationMapper

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch segment_creation_configurations
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 9bda1034697bfa16bbddcace7f32337bc89b90ab
Author: Jackie (Xiaotian) Jiang <xa...@linkedin.com>
AuthorDate: Wed Mar 6 11:45:00 2019 -0800

    Log actual configurations for SegmentCreationMapper
---
 .../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