]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/ExternalFileIngestionInfo.java
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / ExternalFileIngestionInfo.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.Objects;
9
10 public class ExternalFileIngestionInfo {
11 private final String columnFamilyName;
12 private final String externalFilePath;
13 private final String internalFilePath;
14 private final long globalSeqno;
15 private final TableProperties tableProperties;
16
17 /**
18 * Access is package private as this will only be constructed from
19 * C++ via JNI and for testing.
20 */
21 ExternalFileIngestionInfo(final String columnFamilyName, final String externalFilePath,
22 final String internalFilePath, final long globalSeqno,
23 final TableProperties tableProperties) {
24 this.columnFamilyName = columnFamilyName;
25 this.externalFilePath = externalFilePath;
26 this.internalFilePath = internalFilePath;
27 this.globalSeqno = globalSeqno;
28 this.tableProperties = tableProperties;
29 }
30
31 /**
32 * Get the name of the column family.
33 *
34 * @return the name of the column family.
35 */
36 public String getColumnFamilyName() {
37 return columnFamilyName;
38 }
39
40 /**
41 * Get the path of the file outside the DB.
42 *
43 * @return the path of the file outside the DB.
44 */
45 public String getExternalFilePath() {
46 return externalFilePath;
47 }
48
49 /**
50 * Get the path of the file inside the DB.
51 *
52 * @return the path of the file inside the DB.
53 */
54 public String getInternalFilePath() {
55 return internalFilePath;
56 }
57
58 /**
59 * Get the global sequence number assigned to keys in this file.
60 *
61 * @return the global sequence number.
62 */
63 public long getGlobalSeqno() {
64 return globalSeqno;
65 }
66
67 /**
68 * Get the Table properties of the table being flushed.
69 *
70 * @return the table properties.
71 */
72 public TableProperties getTableProperties() {
73 return tableProperties;
74 }
75
76 @Override
77 public boolean equals(Object o) {
78 if (this == o)
79 return true;
80 if (o == null || getClass() != o.getClass())
81 return false;
82 ExternalFileIngestionInfo that = (ExternalFileIngestionInfo) o;
83 return globalSeqno == that.globalSeqno
84 && Objects.equals(columnFamilyName, that.columnFamilyName)
85 && Objects.equals(externalFilePath, that.externalFilePath)
86 && Objects.equals(internalFilePath, that.internalFilePath)
87 && Objects.equals(tableProperties, that.tableProperties);
88 }
89
90 @Override
91 public int hashCode() {
92 return Objects.hash(
93 columnFamilyName, externalFilePath, internalFilePath, globalSeqno, tableProperties);
94 }
95
96 @Override
97 public String toString() {
98 return "ExternalFileIngestionInfo{"
99 + "columnFamilyName='" + columnFamilyName + '\'' + ", externalFilePath='" + externalFilePath
100 + '\'' + ", internalFilePath='" + internalFilePath + '\'' + ", globalSeqno=" + globalSeqno
101 + ", tableProperties=" + tableProperties + '}';
102 }
103 }