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).
8 import java
.util
.Objects
;
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
;
18 * Access is package private as this will only be constructed from
19 * C++ via JNI and for testing.
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
;
32 * Get the name of the column family.
34 * @return the name of the column family.
36 public String
getColumnFamilyName() {
37 return columnFamilyName
;
41 * Get the path of the file outside the DB.
43 * @return the path of the file outside the DB.
45 public String
getExternalFilePath() {
46 return externalFilePath
;
50 * Get the path of the file inside the DB.
52 * @return the path of the file inside the DB.
54 public String
getInternalFilePath() {
55 return internalFilePath
;
59 * Get the global sequence number assigned to keys in this file.
61 * @return the global sequence number.
63 public long getGlobalSeqno() {
68 * Get the Table properties of the table being flushed.
70 * @return the table properties.
72 public TableProperties
getTableProperties() {
73 return tableProperties
;
77 public boolean equals(Object o
) {
80 if (o
== null || getClass() != o
.getClass())
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
);
91 public int hashCode() {
93 columnFamilyName
, externalFilePath
, internalFilePath
, globalSeqno
, tableProperties
);
97 public String
toString() {
98 return "ExternalFileIngestionInfo{"
99 + "columnFamilyName='" + columnFamilyName
+ '\'' + ", externalFilePath='" + externalFilePath
100 + '\'' + ", internalFilePath='" + internalFilePath
+ '\'' + ", globalSeqno=" + globalSeqno
101 + ", tableProperties=" + tableProperties
+ '}';