public class ConsistentBucketIdentifier extends BucketIdentifier
| Constructor and Description |
|---|
ConsistentBucketIdentifier(HoodieConsistentHashingMetadata metadata) |
| Modifier and Type | Method and Description |
|---|---|
ConsistentHashingNode |
getBucket(HoodieKey hoodieKey,
List<String> indexKeyFields) |
protected ConsistentHashingNode |
getBucket(int hashValue) |
protected ConsistentHashingNode |
getBucket(List<String> hashKeys) |
ConsistentHashingNode |
getBucket(String hoodieKey,
String indexKeyFields) |
ConsistentHashingNode |
getBucketByFileId(String fileId)
Get bucket of the given file group
|
ConsistentHashingNode |
getFormerBucket(int hashValue)
Get the former node of the given node (inferred from hash value).
|
ConsistentHashingNode |
getFormerBucket(String fileId)
Get the former node of the given node (inferred from file id).
|
HoodieConsistentHashingMetadata |
getMetadata() |
Collection<ConsistentHashingNode> |
getNodes() |
int |
getNumBuckets() |
List<ConsistentHashingNode> |
mergeBucket(List<String> fileIds) |
Option<List<ConsistentHashingNode>> |
splitBucket(ConsistentHashingNode bucket)
Split bucket in the range middle, also generate the corresponding file ids
TODO support different split criteria, e.g., distribute records evenly using statistics
|
Option<List<ConsistentHashingNode>> |
splitBucket(String fileId) |
bucketIdFromFileId, bucketIdStr, bucketIdStrFromFileId, getBucketId, getBucketId, getBucketId, getBucketId, getBucketId, getHashKeys, getHashKeys, getHashKeys, isBucketFileName, mod, newBucketFileIdPrefix, newBucketFileIdPrefix, newBucketFileIdPrefix, partitionBucketIdStrpublic ConsistentBucketIdentifier(HoodieConsistentHashingMetadata metadata)
public Collection<ConsistentHashingNode> getNodes()
public HoodieConsistentHashingMetadata getMetadata()
public int getNumBuckets()
public ConsistentHashingNode getBucketByFileId(String fileId)
fileId - the file group id. NOTE: not filePrefix (i.e., uuid)public ConsistentHashingNode getBucket(HoodieKey hoodieKey, List<String> indexKeyFields)
public ConsistentHashingNode getBucket(String hoodieKey, String indexKeyFields)
protected ConsistentHashingNode getBucket(List<String> hashKeys)
protected ConsistentHashingNode getBucket(int hashValue)
public ConsistentHashingNode getFormerBucket(String fileId)
public ConsistentHashingNode getFormerBucket(int hashValue)
public List<ConsistentHashingNode> mergeBucket(List<String> fileIds)
public Option<List<ConsistentHashingNode>> splitBucket(String fileId)
public Option<List<ConsistentHashingNode>> splitBucket(@NotNull ConsistentHashingNode bucket)
bucket - parent bucketCopyright © 2023 The Apache Software Foundation. All rights reserved.