| 43 | } |
| 44 | |
| 45 | Status HdfsTableWriter::Write(const uint8_t* data, int32_t len) { |
| 46 | DCHECK_GE(len, 0); |
| 47 | DCHECK(output_->tmp_hdfs_file != nullptr); |
| 48 | int ret = hdfsWrite(output_->hdfs_connection, output_->tmp_hdfs_file, data, len); |
| 49 | if (ret == -1) { |
| 50 | string error_msg = GetHdfsErrorMsg(""); |
| 51 | stringstream msg; |
| 52 | msg << "Failed to write data (length: " << len |
| 53 | << ") to Hdfs file: " << output_->current_file_name |
| 54 | << " " << error_msg; |
| 55 | return Status(msg.str()); |
| 56 | } |
| 57 | COUNTER_ADD(parent_->bytes_written_counter(), len); |
| 58 | stats_.set_bytes_written(stats_.bytes_written() + len); |
| 59 | return Status::OK(); |
| 60 | } |
| 61 | } |
nothing calls this directly
no test coverage detected