]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/LogFile.java
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
9 private final String pathName
;
10 private final long logNumber
;
11 private final WalFileType type
;
12 private final long startSequence
;
13 private final long sizeFileBytes
;
18 private LogFile(final String pathName
, final long logNumber
,
19 final byte walFileTypeValue
, final long startSequence
,
20 final long sizeFileBytes
) {
21 this.pathName
= pathName
;
22 this.logNumber
= logNumber
;
23 this.type
= WalFileType
.fromValue(walFileTypeValue
);
24 this.startSequence
= startSequence
;
25 this.sizeFileBytes
= sizeFileBytes
;
29 * Returns log file's pathname relative to the main db dir
30 * Eg. For a live-log-file = /000003.log
31 * For an archived-log-file = /archive/000003.log
33 * @return log file's pathname
35 public String
pathName() {
40 * Primary identifier for log file.
41 * This is directly proportional to creation time of the log file
43 * @return the log number
45 public long logNumber() {
50 * Log file can be either alive or archived.
52 * @return the type of the log file.
54 public WalFileType
type() {
59 * Starting sequence number of writebatch written in this log file.
61 * @return the stating sequence number
63 public long startSequence() {
68 * Size of log file on disk in Bytes.
70 * @return size of log file
72 public long sizeFileBytes() {