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

Method Read

be/src/kudu/util/env_posix.cc:976–997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974 }
975
976 virtual Status Read(Slice* result) OVERRIDE {
977 MAYBE_RETURN_EIO(filename_, IOError(Env::kInjectedFailureStatusMsg, EIO));
978 ThreadRestrictions::AssertIOAllowed();
979 size_t r;
980 STREAM_RETRY_ON_EINTR(r, file_, fread_unlocked(result->mutable_data(), 1,
981 result->size(), file_));
982 if (r < result->size()) {
983 if (feof(file_)) {
984 // We leave status as ok if we hit the end of the file.
985 // We need to adjust the slice size.
986 result->truncate(r);
987 } else {
988 // A partial read with an error: return a non-ok status.
989 return IOError(filename_, errno);
990 }
991 }
992 if (encrypted_) {
993 RETURN_NOT_OK(DoDecryptV(&encryption_header_, offset_, ArrayView<Slice>(result, 1)));
994 }
995 offset_ += r;
996 return Status::OK();
997 }
998
999 virtual Status Skip(uint64_t n) OVERRIDE {
1000 MAYBE_RETURN_EIO(filename_, IOError(Env::kInjectedFailureStatusMsg, EIO));

Callers

nothing calls this directly

Calls 6

DoDecryptVFunction · 0.85
OKFunction · 0.85
mutable_dataMethod · 0.80
IOErrorFunction · 0.70
sizeMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected