-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathDataPageV2.java
118 lines (104 loc) · 3.31 KB
/
DataPageV2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.parquet;
import io.airlift.slice.Slice;
import org.apache.parquet.column.statistics.Statistics;
import java.util.OptionalLong;
import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.requireNonNull;
public final class DataPageV2
extends DataPage
{
private final int rowCount;
private final int nullCount;
private final Slice repetitionLevels;
private final Slice definitionLevels;
private final ParquetEncoding dataEncoding;
private final Slice slice;
private final Statistics<?> statistics;
private final boolean isCompressed;
public DataPageV2(
int rowCount,
int nullCount,
int valueCount,
Slice repetitionLevels,
Slice definitionLevels,
ParquetEncoding dataEncoding,
Slice slice,
int uncompressedSize,
OptionalLong firstRowIndex,
Statistics<?> statistics,
boolean isCompressed,
int pageIndex)
{
super(uncompressedSize, valueCount, firstRowIndex, pageIndex);
this.rowCount = rowCount;
this.nullCount = nullCount;
this.repetitionLevels = requireNonNull(repetitionLevels, "repetitionLevels slice is null");
this.definitionLevels = requireNonNull(definitionLevels, "definitionLevels slice is null");
this.dataEncoding = dataEncoding;
this.slice = requireNonNull(slice, "slice is null");
this.statistics = statistics;
this.isCompressed = isCompressed;
}
public int getRowCount()
{
return rowCount;
}
public int getNullCount()
{
return nullCount;
}
public Slice getRepetitionLevels()
{
return repetitionLevels;
}
public Slice getDefinitionLevels()
{
return definitionLevels;
}
public ParquetEncoding getDataEncoding()
{
return dataEncoding;
}
@Override
public Slice getSlice()
{
return slice;
}
public Statistics<?> getStatistics()
{
return statistics;
}
public boolean isCompressed()
{
return isCompressed;
}
@Override
public String toString()
{
return toStringHelper(this)
.add("rowCount", rowCount)
.add("nullCount", nullCount)
.add("repetitionLevels", repetitionLevels)
.add("definitionLevels", definitionLevels)
.add("dataEncoding", dataEncoding)
.add("slice", slice)
.add("statistics", statistics)
.add("isCompressed", isCompressed)
.add("valueCount", valueCount)
.add("uncompressedSize", uncompressedSize)
.toString();
}
}