/Users/deen/code/yugabyte-db/src/yb/util/file_system.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #include "yb/util/file_system.h" |
15 | | |
16 | | #include "yb/util/result.h" |
17 | | |
18 | | namespace yb { |
19 | | |
20 | | const FileSystemOptions FileSystemOptions::kDefault; |
21 | | |
22 | 0 | Status SequentialFile::InvalidateCache(size_t offset, size_t length) { |
23 | 0 | return STATUS(NotSupported, "InvalidateCache not supported."); |
24 | 0 | } |
25 | | |
26 | | Status RandomAccessFile::ReadAndValidate( |
27 | 3.88M | uint64_t offset, size_t n, Slice* result, char* scratch, const ReadValidator& validator) { |
28 | 3.88M | RETURN_NOT_OK(Read(offset, n, result, scratch)); |
29 | 3.88M | return validator.Validate(*result); |
30 | 3.88M | } |
31 | | |
32 | 4.48M | Status RandomAccessFile::Read(uint64_t offset, size_t n, Slice* result, char* scratch) { |
33 | 4.48M | return Read(offset, n, result, reinterpret_cast<uint8_t*>(scratch)); |
34 | 4.48M | } |
35 | | |
36 | 0 | Status RandomAccessFile::InvalidateCache(size_t offset, size_t length) { |
37 | 0 | return STATUS(NotSupported, "InvalidateCache not supported."); |
38 | 0 | } |
39 | | |
40 | 0 | Status SequentialFileWrapper::InvalidateCache(size_t offset, size_t length) { |
41 | 0 | return target_->InvalidateCache(offset, length); |
42 | 0 | } |
43 | | |
44 | 28 | Status SequentialFileWrapper::Read(size_t n, Slice* result, uint8_t* scratch) { |
45 | 28 | return target_->Read(n, result, scratch); |
46 | 28 | } |
47 | | |
48 | 0 | Status SequentialFileWrapper::Skip(uint64_t n) { |
49 | 0 | return target_->Skip(n); |
50 | 0 | } |
51 | | |
52 | | Status RandomAccessFileWrapper::Read( |
53 | 154k | uint64_t offset, size_t n, Slice* result, uint8_t* scratch) const { |
54 | 154k | return target_->Read(offset, n , result, scratch); |
55 | 154k | } |
56 | | |
57 | 4 | Result<uint64_t> RandomAccessFileWrapper::Size() const { |
58 | 4 | return target_->Size(); |
59 | 4 | } |
60 | | |
61 | 0 | Result<uint64_t> RandomAccessFileWrapper::INode() const { |
62 | 0 | return target_->INode(); |
63 | 0 | } |
64 | | |
65 | 0 | Status RandomAccessFileWrapper::InvalidateCache(size_t offset, size_t length) { |
66 | 0 | return target_->InvalidateCache(offset, length); |
67 | 0 | } |
68 | | |
69 | | } // namespace yb |