[jira] [Updated] (AVRO-1238) Avro-C better end of file detection
[ https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Douglas Creager updated AVRO-1238: -- Resolution: Fixed Status: Resolved (was: Patch Available) Committed to SVN > Avro-C better end of file detection > --- > > Key: AVRO-1238 > URL: https://issues.apache.org/jira/browse/AVRO-1238 > Project: Avro > Issue Type: Improvement > Components: c >Reporter: Michael Cooper > Attachments: > 0001-AVRO-1238.-C-Check-for-EOF-when-reading-from-Avro-fi.patch, > 0001-Sane-EOF-checking.patch, 0001-Test-case-for-AVRO-1238.patch, > avro-1238-good.avro, avro-1238-truncated.avro > > > Currently in the C library, avro_file_reader_read_value will error out when > it hits the end of a file. > I propose we make it detect when it has hit the end of file, and return -1. > This means that we can differentiate between errors in opening the next block > versus actually having finished the file. > I have attached the proposed changes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AVRO-1238) Avro-C better end of file detection
[ https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Douglas Creager updated AVRO-1238: -- Attachment: 0001-AVRO-1238.-C-Check-for-EOF-when-reading-from-Avro-fi.patch I made a couple of modifications to Michael's patch. First, I think we should use {{EOF}} (defined in stdio.h) as the return file that indicates end-of-file. Second, there were a couple of places where the underlying file reading code was using -1 to signal a non-EOF error, which would conflict with the new EOF return value. The updated patch has the file I/O code return {{EILSEQ}} if it encounters truncated or malformed files. > Avro-C better end of file detection > --- > > Key: AVRO-1238 > URL: https://issues.apache.org/jira/browse/AVRO-1238 > Project: Avro > Issue Type: Improvement > Components: c >Reporter: Michael Cooper > Attachments: > 0001-AVRO-1238.-C-Check-for-EOF-when-reading-from-Avro-fi.patch, > 0001-Sane-EOF-checking.patch, 0001-Test-case-for-AVRO-1238.patch, > avro-1238-good.avro, avro-1238-truncated.avro > > > Currently in the C library, avro_file_reader_read_value will error out when > it hits the end of a file. > I propose we make it detect when it has hit the end of file, and return -1. > This means that we can differentiate between errors in opening the next block > versus actually having finished the file. > I have attached the proposed changes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AVRO-1238) Avro-C better end of file detection
[ https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Douglas Creager updated AVRO-1238: -- Attachment: 0001-Test-case-for-AVRO-1238.patch avro-1238-truncated.avro avro-1238-good.avro Here's a test case. Like with AVRO-1237, the patch only adds/updated text files; you also need to place the two avro data files into lang/c/tests. > Avro-C better end of file detection > --- > > Key: AVRO-1238 > URL: https://issues.apache.org/jira/browse/AVRO-1238 > Project: Avro > Issue Type: Improvement > Components: c >Reporter: Michael Cooper > Attachments: 0001-Sane-EOF-checking.patch, > 0001-Test-case-for-AVRO-1238.patch, avro-1238-good.avro, > avro-1238-truncated.avro > > > Currently in the C library, avro_file_reader_read_value will error out when > it hits the end of a file. > I propose we make it detect when it has hit the end of file, and return -1. > This means that we can differentiate between errors in opening the next block > versus actually having finished the file. > I have attached the proposed changes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AVRO-1238) Avro-C better end of file detection
[ https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Cooper updated AVRO-1238: - Status: Patch Available (was: Open) > Avro-C better end of file detection > --- > > Key: AVRO-1238 > URL: https://issues.apache.org/jira/browse/AVRO-1238 > Project: Avro > Issue Type: Improvement > Components: c >Reporter: Michael Cooper > Attachments: 0001-Sane-EOF-checking.patch > > > Currently in the C library, avro_file_reader_read_value will error out when > it hits the end of a file. > I propose we make it detect when it has hit the end of file, and return -1. > This means that we can differentiate between errors in opening the next block > versus actually having finished the file. > I have attached the proposed changes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (AVRO-1238) Avro-C better end of file detection
[ https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Cooper updated AVRO-1238: - Attachment: 0001-Sane-EOF-checking.patch > Avro-C better end of file detection > --- > > Key: AVRO-1238 > URL: https://issues.apache.org/jira/browse/AVRO-1238 > Project: Avro > Issue Type: Improvement > Components: c >Reporter: Michael Cooper > Attachments: 0001-Sane-EOF-checking.patch > > > Currently in the C library, avro_file_reader_read_value will error out when > it hits the end of a file. > I propose we make it detect when it has hit the end of file, and return -1. > This means that we can differentiate between errors in opening the next block > versus actually having finished the file. > I have attached the proposed changes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira