MCPcopy Create free account
hub / github.com/apache/impala / WriteValidateCallback

Method WriteValidateCallback

be/src/runtime/io/disk-io-mgr-test.cc:125–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 }
124
125 void WriteValidateCallback(int num_writes, WriteRange** written_range,
126 DiskIoMgr* io_mgr, RequestContext* reader, BufferPool::ClientHandle* client,
127 int32_t* data, const Status& expected_status, const Status& status) {
128 if (expected_status.code() == TErrorCode::CANCELLED_INTERNALLY) {
129 EXPECT_TRUE(status.ok() || status.IsCancelled()) << "Error: " << status.GetDetail();
130 } else {
131 EXPECT_EQ(status.code(), expected_status.code());
132 }
133 if (status.ok()) {
134 ScanRange* scan_range = pool_.Add(new ScanRange());
135 scan_range->Reset(ScanRange::FileInfo{(*written_range)->file()},
136 (*written_range)->len(), (*written_range)->offset(), 0, false,
137 BufferOpts::Uncached());
138 ValidateSyncRead(io_mgr, reader, client, scan_range,
139 reinterpret_cast<const char*>(data), sizeof(int32_t));
140 }
141
142 if (!status.ok()) {
143 EXPECT_EQ(expected_status.GetDetail(), status.GetDetail());
144 }
145
146 {
147 lock_guard<mutex> l(written_mutex_);
148 ++num_ranges_written_;
149 if (num_ranges_written_ == num_writes) writes_done_.NotifyOne();
150 }
151 }
152
153 void WriteCompleteCallback(int num_writes, const Status& status) {
154 EXPECT_OK(status);

Callers

nothing calls this directly

Calls 10

codeMethod · 0.80
GetDetailMethod · 0.80
NotifyOneMethod · 0.80
okMethod · 0.45
IsCancelledMethod · 0.45
AddMethod · 0.45
ResetMethod · 0.45
fileMethod · 0.45
lenMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected