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

Method WriteAt

cpp/src/arrow/io/file.cc:739–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737bool MemoryMappedFile::supports_zero_copy() const { return true; }
738
739Status MemoryMappedFile::WriteAt(int64_t position, const void* data, int64_t nbytes) {
740 RETURN_NOT_OK(memory_map_->CheckClosed());
741 std::lock_guard<std::mutex> guard(memory_map_->write_lock());
742
743 if (!memory_map_->opened() || !memory_map_->writable()) {
744 return Status::IOError("Unable to write");
745 }
746 RETURN_NOT_OK(internal::ValidateWriteRange(position, nbytes, memory_map_->size()));
747
748 RETURN_NOT_OK(memory_map_->Seek(position));
749 return WriteInternal(data, nbytes);
750}
751
752Status MemoryMappedFile::Write(const void* data, int64_t nbytes) {
753 RETURN_NOT_OK(memory_map_->CheckClosed());

Callers 3

TEST_FFunction · 0.45
TESTFunction · 0.45

Calls 7

IOErrorFunction · 0.85
ValidateWriteRangeFunction · 0.85
openedMethod · 0.80
writableMethod · 0.80
CheckClosedMethod · 0.45
sizeMethod · 0.45
SeekMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TESTFunction · 0.36