[ https://issues.apache.org/jira/browse/HDFS-7017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14207524#comment-14207524 ]
Colin Patrick McCabe commented on HDFS-7017: -------------------------------------------- Any update on this one? I agree with the idea of combining {{LeaseManager}} and {{LeaseManagerImpl}}. I think perhaps you might have separated them to provide a way to inject behavior in unit tests. However, we can always come up with fault injectors, or tweak the configuration settings to induce timeouts, like we do in the Java code. Having all this indirection makes the code hard to follow. In general, I am not keen on the idea of singletons. They're really just globals with a different name and all of the same problems. I think if possible we should have the {{LeaseManager}} owned by the {{hdfsFS}} instance. Then we can create it after the user calls {{hdfsConnect}} + {{hdfsOpen}} (for write), and destroy it when the user calls {{hdfsDisconnect}}. In contrast, if we make it a singleton, the application has no way to stop it once the library creates it. Using a singleton here also creates a lot of inconvenience during unit tests. If this is too much trouble to do in this patch, we can do it in a follow-on JIRA. I also agree with the idea of punting the packet memory pool to a follow-on JIRA. > Implement OutputStream for libhdfs3 > ----------------------------------- > > Key: HDFS-7017 > URL: https://issues.apache.org/jira/browse/HDFS-7017 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: hdfs-client > Reporter: Zhanwei Wang > Assignee: Zhanwei Wang > Attachments: HDFS-7017-pnative.002.patch, > HDFS-7017-pnative.003.patch, HDFS-7017-pnative.004.patch, HDFS-7017.patch > > > Implement pipeline and OutputStream C++ interface -- This message was sent by Atlassian JIRA (v6.3.4#6332)