hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sameer Paranjpye (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1470) Rework FSInputChecker and FSOutputSummer to support checksum code sharing between ChecksumFileSystem and block level crc dfs
Date Tue, 19 Jun 2007 09:58:26 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506110

Sameer Paranjpye commented on HADOOP-1470:

Maybe I'm missing something, but this approach bothers me.

The early discussion on this issue suggests that the goal was to generate a simple implementation
template with a couple of degrees of freedom (bytes per checksum, checksum type) that could
be used in the ChecksumFileSystem and HDFS. This can be achieved by pretty much using the
FSInputChecker as is with a couple of tweaks.

Instead, we've ended up with an additional abstract class/interface ChecksumInputChecker with
readChunk, readChecksum etc. methods. This class seems unnecessary. A filtering stream which
contains and interprets an underlying stream(s) is the design pattern used almost everywhere
(compression implementations in particular), and appears to be sufficient for this scenario.

The comments on the 'readChunk' etc. methods seem to imply single threaded access, for instance:

  /* returns Checksum of the last chunk read.
     If we want to support something like MD5, we could change this
     to fill a buffer instead of returning a long.
     This class gurantees that readChecksum() is invoked only once
     and only after readChunk() was successful */

How will 'pread' be supported? We could have lots of threads making concurrent calls to 'pread'.
We could introduce explicit offsets into the readChunk etc. method signatures or do some per
thread bookkeeping in the implementation. Again 'pread' is present in the existing FSInputStream
interface, adding additional methods with the same functionality doesn't feel like it adds

> Rework FSInputChecker and FSOutputSummer to support checksum code sharing between ChecksumFileSystem
and block level crc dfs
> ----------------------------------------------------------------------------------------------------------------------------
>                 Key: HADOOP-1470
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1470
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.12.3
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: 0.14.0
>         Attachments: genericChecksum.patch, InputChecker-01.java
> Comment from Doug in HADOOP-1134:
> I'd prefer it if the CRC code could be shared with CheckSumFileSystem. In particular,
it seems to me that FSInputChecker and FSOutputSummer could be extended to support pluggable
sources and sinks for checksums, respectively, and DFSDataInputStream and DFSDataOutputStream
could use these. Advantages of this are: (a) single implementation of checksum logic to debug
and maintain; (b) keeps checksumming as close to possible to data generation and use. This
patch computes checksums after data has been buffered, and validates them before it is buffered.
We sometimes use large buffers and would like to guard against in-memory errors. The current
checksum code catches a lot of such errors. So we should compute checksums after minimal buffering
(just bytesPerChecksum, ideally) and validate them at the last possible moment (e.g., through
the use of a small final buffer with a larger buffer behind it). I do not think this will
significantly affect performance, and data integrity is a high priority. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message