| 497 | } |
| 498 | |
| 499 | Status HdfsSequenceScanner::ReadBlockHeader() { |
| 500 | RETURN_IF_FALSE(stream_->ReadInt(¤t_block_length_, &parse_status_)); |
| 501 | if (current_block_length_ < 0) { |
| 502 | stringstream ss; |
| 503 | int64_t position = stream_->file_offset(); |
| 504 | position -= sizeof(int32_t); |
| 505 | ss << stream_->filename() << " Bad block length: " << current_block_length_ |
| 506 | << " at offset " << position; |
| 507 | return Status(ss.str()); |
| 508 | } |
| 509 | |
| 510 | RETURN_IF_FALSE(stream_->ReadInt(¤t_key_length_, &parse_status_)); |
| 511 | if (current_key_length_ < 0) { |
| 512 | stringstream ss; |
| 513 | int64_t position = stream_->file_offset(); |
| 514 | position -= sizeof(int32_t); |
| 515 | ss << stream_->filename() << " Bad key length: " << current_key_length_ |
| 516 | << " at offset " << position; |
| 517 | return Status(ss.str()); |
| 518 | } |
| 519 | |
| 520 | return Status::OK(); |
| 521 | } |
| 522 | |
| 523 | Status HdfsSequenceScanner::ReadCompressedBlock() { |
| 524 | int64_t num_buffered_records; |