[ 
https://issues.apache.org/jira/browse/HDFS-12977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16372125#comment-16372125
 ] 

Plamen Jeliazkov edited comment on HDFS-12977 at 2/23/18 5:34 PM:
------------------------------------------------------------------

Attached new patch.

I created two new interfaces in order to keep common and hdfs as separate 
modules:

TransactionIdProvider and TransactionIdObserver – names are subject to change 
per review of course, but their names should suggest their function. The gist 
is that the FSNamesystem implements the TransactionIdProvider and the DFSClient 
implements the TransactionIdObserver. With some additional changes to RpcEngine 
I was able to make it so that via Server constructor I can pass a 
TransactionIdProvider and via Client I can pass a TransactionIdObserver.

This makes it so we do not need to add a ton of try/finally across 
NameNodeRpcServer.

I am not really happy with my code changes in Client currently; if anyone can 
provide some guidance on how I can better pass an object into its constructor I 
would greatly appreciate it.

Regarding (1) I was also able to pass in HdfsServerConstants.INVALID_TXID by 
delegating it to the TransactionIdProvider via a method 
"getInvalidTransactionId" that is used to initialize the RpcResponse 
transactionId until it gets a valid txid.


was (Author: zero45):
Attached new patch.

I created two new interfaces in order to keep common and hdfs as separate 
modules:

TransactionIdProvider and TransactionIdObserver – names are subject to change 
per review of course, but their names should suggest their function. The gist 
is that the FSNamesystem implements the TransactionIdProvider and the DFSClient 
implements the TransactionIdObserver. With some additional changes to RpcEngine 
I was able to make it so that via Server constructor I can pass a 
TransactionIdProvider and via Client I can pass a TransactionIdObserver.

This makes it so we do not need to add a ton of try/finally across 
NameNodeRpcServer.

I am not really happy with the code in Client currently; if anyone can provide 
some guidance on how I can better pass an object into its constructor I would 
greatly appreciate it.

Regarding (1) I was also able to pass in HdfsServerConstants.INVALID_TXID by 
delegating it to the TransactionIdProvider via a method 
"getInvalidTransactionId" that is used to initialize the RpcResponse 
transactionId until it gets a valid txid.

> Add stateId to RPC headers.
> ---------------------------
>
>                 Key: HDFS-12977
>                 URL: https://issues.apache.org/jira/browse/HDFS-12977
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ipc, namenode
>            Reporter: Konstantin Shvachko
>            Assignee: Plamen Jeliazkov
>            Priority: Major
>         Attachments: HDFS_12977.trunk.001.patch, HDFS_12977.trunk.002.patch
>
>
> stateId is a new field in the RPC headers of NameNode proto calls.
> stateId is the journal transaction Id, which represents LastSeenId for the 
> clients and LastWrittenId for NameNodes. See more in [reads from Standby 
> design 
> doc|https://issues.apache.org/jira/secure/attachment/12902925/ConsistentReadsFromStandbyNode.pdf].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to