[
https://issues.apache.org/jira/browse/HDDS-1496?focusedWorklogId=253466&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-253466
]
ASF GitHub Bot logged work on HDDS-1496:
----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jun/19 23:27
Start Date: 03/Jun/19 23:27
Worklog Time Spent: 10m
Work Description: hanishakoneru commented on pull request #804:
HDDS-1496. Support partial chunk reads and checksum verification
URL: https://github.com/apache/hadoop/pull/804#discussion_r290076333
##########
File path:
hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/storage/TestBlockInputStream.java
##########
@@ -174,20 +188,18 @@ public void testSeek() throws Exception {
}
@Test
- public void testBlockEOF() throws Exception {
- // Seek to some position < blockSize and verify EOF is not reached.
- seekAndVerify(CHUNK_SIZE);
- Assert.assertFalse(blockInputStream.blockStreamEOF());
-
- // Seek to blockSize-1 and verify that EOF is not reached as the chunk
- // has not been read from container yet.
- seekAndVerify(blockSize-1);
- Assert.assertFalse(blockInputStream.blockStreamEOF());
- }
-
- private void seekAndVerify(int pos) throws Exception {
- blockInputStream.seek(pos);
- Assert.assertEquals("Current position of buffer does not match with the " +
- "seeked position", pos, blockInputStream.getPos());
+ public void testRead() throws Exception {
+ // read 200 bytes of data starting from position 50. Chunk0 contains
+ // indices 0 to 99, chunk1 from 100 to 199 and chunk3 from 200 to 299. So
+ // the read should result in 3 ChunkInputStream reads
+ seekAndVerify(50);
+ byte[] b = new byte[200];
+ blockStream.read(b, 0, 200);
+ matchWithInputData(b, 50, 250);
Review comment:
Added a new test testSeekAndRead()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 253466)
Time Spent: 6h 40m (was: 6.5h)
> Support partial chunk reads and checksum verification
> -----------------------------------------------------
>
> Key: HDDS-1496
> URL: https://issues.apache.org/jira/browse/HDDS-1496
> Project: Hadoop Distributed Data Store
> Issue Type: Improvement
> Reporter: Hanisha Koneru
> Assignee: Hanisha Koneru
> Priority: Major
> Labels: pull-request-available
> Time Spent: 6h 40m
> Remaining Estimate: 0h
>
> BlockInputStream#readChunkFromContainer() reads the whole chunk from disk
> even if we need to read only a part of the chunk.
> This Jira aims to improve readChunkFromContainer so that only that part of
> the chunk file is read which is needed by client plus the part of chunk file
> which is required to verify the checksum.
> For example, lets say the client is reading from index 120 to 450 in the
> chunk. And let's say checksum is stored for every 100 bytes in the chunk i.e.
> the first checksum is for bytes from index 0 to 99, the next for bytes from
> index 100 to 199 and so on. To verify bytes from 120 to 450, we would need to
> read from bytes 100 to 499 so that checksum verification can be done.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]