public class ClusterBy extends Object
getBucketByCount() for
details about bucket keys.| Constructor and Description |
|---|
ClusterBy(List<SortColumn> columns,
int bucketByCount) |
| Modifier and Type | Method and Description |
|---|---|
Comparator<RowKey> |
bucketComparator()
Comparator that compares bucket keys for this instance.
|
Comparator<byte[]> |
byteKeyComparator()
Comparator that compares byte arrays of keys for this instance using the given signature directly.
|
boolean |
equals(Object o) |
int |
getBucketByCount()
How many fields from
getColumns() comprise the "bucket key". |
List<SortColumn> |
getColumns()
The columns that comprise this key, in order.
|
int |
hashCode() |
Comparator<RowKey> |
keyComparator()
Comparator that compares keys for this instance using the given signature.
|
RowKeyReader |
keyReader(ColumnInspector inspector)
Create a reader for keys for this instance.
|
static ClusterBy |
none()
Create an empty key.
|
String |
toString() |
public ClusterBy(List<SortColumn> columns, int bucketByCount)
public static ClusterBy none()
public List<SortColumn> getColumns()
public int getBucketByCount()
getColumns() comprise the "bucket key". Bucketing is like strict partitioning: all
rows in a given partition will have the exact same bucket key. It is most commonly used to implement
segment granularity during ingestion.
The bucket key is a prefix of the complete key.
Will always be less than, or equal to, the size of getColumns().
Not relevant when a ClusterBy instance is used as an ordering key rather than a partitioning key.public RowKeyReader keyReader(ColumnInspector inspector)
ColumnInspector is used to determine the types of fields in the keys. The provided signature
does not have to exactly match the sortColumns: it merely has to contain them all.public Comparator<RowKey> keyComparator()
public Comparator<byte[]> byteKeyComparator()
public Comparator<RowKey> bucketComparator()
RowKeyReader.trim(RowKey, int) with getBucketByCount().Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.