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

Method WriteAt

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

Source from the content-addressed store, hash-verified

745bool MemoryMappedFile::supports_zero_copy() const { return true; }
746
747Status MemoryMappedFile::WriteAt(int64_t position, const void* data, int64_t nbytes) {
748 RETURN_NOT_OK(memory_map_->CheckClosed());
749 std::lock_guard<std::mutex> guard(memory_map_->write_lock());
750
751 if (!memory_map_->opened() || !memory_map_->writable()) {
752 return Status::IOError("Unable to write");
753 }
754 RETURN_NOT_OK(internal::ValidateWriteRange(position, nbytes, memory_map_->size()));
755
756 RETURN_NOT_OK(memory_map_->Seek(position));
757 return WriteInternal(data, nbytes);
758}
759
760Status MemoryMappedFile::Write(const void* data, int64_t nbytes) {
761 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