| 81 | } |
| 82 | |
| 83 | Status HdfsMonitor::OpenHdfsFileWithTimeout(const hdfsFS& fs, const std::string* fname, |
| 84 | int flags, uint64_t blocksize, hdfsFile* fid_out) { |
| 85 | std::shared_ptr<OpenHdfsFileOp> op(new OpenHdfsFileOp(fs, fname, flags, blocksize)); |
| 86 | |
| 87 | // Submit the operation to the synchronous thread pool. If this times out, it returns |
| 88 | // an error status. |
| 89 | Status status = hdfs_worker_pool_->SynchronousOffer(op, |
| 90 | FLAGS_hdfs_operation_timeout_sec * MILLIS_PER_SEC); |
| 91 | RETURN_IF_ERROR(status); |
| 92 | |
| 93 | // The operation didn't time out, and there wasn't an error. Get the handle. |
| 94 | *fid_out = op->GetFileHandle(); |
| 95 | return Status::OK(); |
| 96 | } |
| 97 | |
| 98 | } |
| 99 |
no test coverage detected