hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7585) TestEnhancedByteBufferAccess hard code the block size
Date Thu, 08 Jan 2015 20:03:35 GMT

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

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

Hi Sam,

Thanks for this patch.

{code}
     conf.setLong(DFS_DATANODE_MAX_LOCKED_MEMORY_KEY,
-        DFSTestUtil.roundUpToMultiple(TEST_FILE_LENGTH, 4096));
+        DFSTestUtil.roundUpToMultiple(TEST_FILE_LENGTH, 
+          (int) NativeIO.POSIX.getCacheManipulator().getOperatingSystemPageSize()));
{code}

This part is definitely correct!

{code}
@@ -630,9 +631,9 @@ public void testZeroCopyReadOfCachedData() throws Exception {
         setReplication((short)1).
         setPool("pool1").
         build());
-    int numBlocks = (int)Math.ceil((double)TEST_FILE_LENGTH / BLOCK_SIZE);
+    int numBlocks = (int)Math.ceil((double)TEST_FILE_LENGTH / NativeIO.POSIX.getCacheManipulator().getOperatingSystemPageSize());
     DFSTestUtil.verifyExpectedCacheUsage(
-        DFSTestUtil.roundUpToMultiple(TEST_FILE_LENGTH, BLOCK_SIZE),
+        DFSTestUtil.roundUpToMultiple(TEST_FILE_LENGTH, (int) NativeIO.POSIX.getCacheManipulator().getOperatingSystemPageSize()),
         numBlocks, cluster.getDataNodes().get(0).getFSDataset());
     try {
       result = fsIn.read(null, TEST_FILE_LENGTH,
{code}

I'm having trouble with this part.  The number of blocks should be the file length divided
by the block size, right?  We shouldn't fudge this.

Instead of this, how about replacing 
{code}
  private static final int BLOCK_SIZE = 4096;
{code}

with 
{code}
  private static final int BLOCK_SIZE = NativeIO.POSIX.getCacheManipulator().getOperatingSystemPageSize();
{code}

> TestEnhancedByteBufferAccess hard code the block size
> -----------------------------------------------------
>
>                 Key: HDFS-7585
>                 URL: https://issues.apache.org/jira/browse/HDFS-7585
>             Project: Hadoop HDFS
>          Issue Type: Test
>          Components: test
>    Affects Versions: 2.6.0
>            Reporter: sam liu
>            Assignee: sam liu
>            Priority: Blocker
>         Attachments: HDFS-7585.001.patch
>
>
> The test TestEnhancedByteBufferAccess hard code the block size, and it fails with exceptions
on power linux.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message