YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/rocksdb/file.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) YugaByte, Inc.
2
//
3
// The following only applies to changes made to this file as part of YugaByte development.
4
//
5
// Portions Copyright (c) YugaByte, Inc.
6
//
7
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8
// in compliance with the License.  You may obtain a copy of the License at
9
//
10
// http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software distributed under the License
13
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14
// or implied.  See the License for the specific language governing permissions and limitations
15
// under the License.
16
//
17
#ifndef YB_ROCKSDB_FILE_H
18
#define YB_ROCKSDB_FILE_H
19
20
#include <stddef.h>
21
22
namespace rocksdb {
23
24
class File {
25
 public:
26
0
  virtual ~File() {}
27
28
  // Tries to get an unique ID for this file that will be the same each time
29
  // the file is opened (and will stay the same while the file is open).
30
  // id should have at least capacity of kPosixFileUniqueIdMaxSize to hold the result.
31
  //
32
  // This function guarantees, for IDs from a given environment, two unique ids
33
  // cannot be made equal to eachother by adding arbitrary bytes to one of
34
  // them. That is, no unique ID is the prefix of another.
35
  //
36
  // This function guarantees that the returned ID will not be interpretable as
37
  // a single varint.
38
  //
39
  // Note: these IDs are only valid for the duration of the process.
40
  virtual size_t GetUniqueId(char *id) const = 0;
41
};
42
43
}  // namespace rocksdb
44
45
#endif  // YB_ROCKSDB_FILE_H