[
https://issues.apache.org/jira/browse/HDFS-13248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415358#comment-16415358
]
Yiqun Lin edited comment on HDFS-13248 at 3/27/18 9:58 AM:
-----------------------------------------------------------
One comment for this: I would suggest to move following codes into rbf and be
called in {{NameNodeRpcServer}}.
{code}
+ // The Router may add the original source of the query
+ CallerContext ctx = CallerContext.getCurrent();
+ if (ctx != null) {
+ String content = ctx.getContext();
+ if (content.startsWith("Router")) {
+ String[] contextSplit = content.split("\\$");
+ if (contextSplit.length >= 2) {
+ clientMachine = contextSplit[1];
+ LOG.debug("Router request from {}", clientMachine);
+ }
+ }
+ }
+
{code}
{quote}
I tested checking the logs and it works..
{quote}
Does this mean we have tested in real cluster and it will return client ip
address rather than router ip?
was (Author: linyiqun):
One comment for this: I would suggest to move following codes into rbf and be
called in {{NameNodeRpcServer}}.
{code}
+ // The Router may add the original source of the query
+ CallerContext ctx = CallerContext.getCurrent();
+ if (ctx != null) {
+ String content = ctx.getContext();
+ if (content.startsWith("Router")) {
+ String[] contextSplit = content.split("\\$");
+ if (contextSplit.length >= 2) {
+ clientMachine = contextSplit[1];
+ LOG.debug("Router request from {}", clientMachine);
+ }
+ }
+ }
+
{code}
> RBF: Namenode need to choose block location for the client
> ----------------------------------------------------------
>
> Key: HDFS-13248
> URL: https://issues.apache.org/jira/browse/HDFS-13248
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Weiwei Wu
> Assignee: Íñigo Goiri
> Priority: Major
> Attachments: HDFS-13248.000.patch, HDFS-13248.001.patch,
> clientMachine-call-path.jpeg, debug-info-1.jpeg, debug-info-2.jpeg
>
>
> When execute a put operation via router, the NameNode will choose block
> location for the router, not for the real client. This will affect the file's
> locality.
> I think on both NameNode and Router, we should add a new addBlock method, or
> add a parameter for the current addBlock method, to pass the real client
> information.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]