]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/LevelMetaData.java
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / LevelMetaData.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).
5
6 package org.rocksdb;
7
8 import java.util.Arrays;
9 import java.util.List;
10
11 /**
12 * The metadata that describes a level.
13 */
14 public class LevelMetaData {
15 private final int level;
16 private final long size;
17 private final SstFileMetaData[] files;
18
19 /**
20 * Called from JNI C++
21 */
22 private LevelMetaData(final int level, final long size,
23 final SstFileMetaData[] files) {
24 this.level = level;
25 this.size = size;
26 this.files = files;
27 }
28
29 /**
30 * The level which this meta data describes.
31 *
32 * @return the level
33 */
34 public int level() {
35 return level;
36 }
37
38 /**
39 * The size of this level in bytes, which is equal to the sum of
40 * the file size of its {@link #files()}.
41 *
42 * @return the size
43 */
44 public long size() {
45 return size;
46 }
47
48 /**
49 * The metadata of all sst files in this level.
50 *
51 * @return the metadata of the files
52 */
53 public List<SstFileMetaData> files() {
54 return Arrays.asList(files);
55 }
56 }