[ 
https://issues.apache.org/jira/browse/HADOOP-17276?focusedWorklogId=492092&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-492092
 ]

ASF GitHub Bot logged work on HADOOP-17276:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Sep/20 17:45
            Start Date: 28/Sep/20 17:45
    Worklog Time Spent: 10m 
      Work Description: liuml07 commented on a change in pull request #2327:
URL: https://github.com/apache/hadoop/pull/2327#discussion_r496126898



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java
##########
@@ -123,6 +140,37 @@ public Builder setSignature(byte[] signature) {
       return this;
     }
 
+    /**
+     * Append new item to the context.
+     * @param item
+     * @return builder
+     */
+    public Builder append(String item) {
+      if (isValid(item)) {
+        if (sb.length() > 0) {
+          sb.append(separator);
+        }
+        sb.append(item);
+      }
+      return this;
+    }
+
+    /**
+     * Append new item which contains key and value to the context.
+     * @param key
+     * @param value
+     * @return builder
+     */
+    public Builder append(String key, String value) {
+      if (isValid(key) && isValid(value)) {
+        if (sb.length() > 0) {
+          sb.append(separator);
+        }
+        sb.append(key + ":" + value);

Review comment:
       I was proposing fixed `:` for two reasons:
   1. We have too many Hadoop configurations and I was thinking we add one more 
only when necessary. Using `:` seems most popular choice to me
   1. There are not many choices I imagine and users have to know they can not 
use `\t`, `\n`, `=` etc. So I prefer simplicity. 
   
   But I'm also fine if we go with a new config for this, +0 on that.
   
   Thank you @goiri 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 492092)
    Time Spent: 4.5h  (was: 4h 20m)

> Extend CallerContext to make it include many items
> --------------------------------------------------
>
>                 Key: HADOOP-17276
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17276
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Hui Fei
>            Assignee: Hui Fei
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> Now context is string. We need to extend the CallerContext because context 
> may contains many items.
> Items include 
> * router ip
> * MR or CLI
> * etc



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to