MCPcopy Create free account
hub / github.com/apache/arrow / Write

Method Write

cpp/src/arrow/io/hdfs.cc:292–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290 }
291
292 Status Write(const uint8_t* buffer, int64_t nbytes) {
293 RETURN_NOT_OK(CheckClosed());
294
295 constexpr int64_t kMaxBlockSize = std::numeric_limits<int32_t>::max();
296
297 std::lock_guard<std::mutex> guard(lock_);
298 while (nbytes > 0) {
299 const auto block_size = static_cast<tSize>(std::min(kMaxBlockSize, nbytes));
300 tSize ret = driver_->Write(fs_, file_, buffer, block_size);
301 CHECK_FAILURE(ret, "Write");
302 DCHECK_LE(ret, block_size);
303 buffer += ret;
304 nbytes -= ret;
305 }
306 return Status::OK();
307 }
308
309 protected:
310 Status FlushInternal() {

Callers

nothing calls this directly

Calls 3

CheckClosedFunction · 0.70
OKFunction · 0.50
WriteMethod · 0.45

Tested by

no test coverage detected