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

Colin Patrick McCabe commented on HDFS-6097:
--------------------------------------------

bq. \[try-finally\]

That's a good point, I guess.  I had been assuming that the cleanup wasn't 
really required after a test failure, but that might not be a good assumption.  
In particular, we'd like to know if the subsequent tests succeeded or failed...

bq. FWIW, my current favorite way to do this is cluster initialization in a 
BeforeClass method, cluster shutdown in an AfterClass method, and sometimes 
close of individual streams or file systems in an After method depending on 
what the test is doing. This reigns in the code clutter of try-finally. It's 
not always convenient though if you need to change Configuration in each test 
or if you need per-test isolation for some other reason.

It does feel natural to use the Before method, but it also can be inflexible, 
like you mentioned.  I think on balance I usually prefer creating a common 
function or class that I can have several test functions share.  But it does 
require a try... finally and some extra boilerplate.  I wish there were a way 
to make Before methods apply to only some test methods, or at least modify the 
configuration they use.

bq. Thanks for posting v4. Were you also going to put in the comment that 
copying pos to curPos is an optimization? +1 after that, pending Jenkins run.

added, thanks

> zero-copy reads are incorrectly disabled on file offsets above 2GB
> ------------------------------------------------------------------
>
>                 Key: HDFS-6097
>                 URL: https://issues.apache.org/jira/browse/HDFS-6097
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 2.4.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-6097.003.patch, HDFS-6097.004.patch, 
> HDFS-6097.005.patch
>
>
> Zero-copy reads are incorrectly disabled on file offsets above 2GB due to 
> some code that is supposed to disable zero-copy reads on offsets in block 
> files greater than 2GB (because MappedByteBuffer segments are limited to that 
> size).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to