public class FileIndex extends Object
It caches the partition paths to avoid redundant look up.
| Modifier and Type | Class and Description |
|---|---|
static class |
FileIndex.Builder
Builder for
FileIndex. |
| Modifier and Type | Method and Description |
|---|---|
static FileIndex.Builder |
builder()
Returns the builder.
|
org.apache.hadoop.fs.FileStatus[] |
getFilesInPartitions()
Returns all the file statuses under the table base path.
|
List<String> |
getOrBuildPartitionPaths()
Returns all the relative partition paths.
|
List<Map<String,String>> |
getPartitions(List<String> partitionKeys,
String defaultParName,
boolean hivePartition)
Returns the partition path key and values as a list of map, each map item in the list
is a mapping of the partition key name to its actual partition value.
|
static HoodieMetadataConfig |
metadataConfig(org.apache.flink.configuration.Configuration conf) |
void |
reset()
Reset the state of the file index.
|
public static FileIndex.Builder builder()
public List<Map<String,String>> getPartitions(List<String> partitionKeys, String defaultParName, boolean hivePartition)
-- file:/// ... key1=val1/key2=val2/key3=val3 -- file:/// ... key1=val4/key2=val5/key3=val6
The return list should be [{key1:val1, key2:val2, key3:val3}, {key1:val4, key2:val5, key3:val6}].
partitionKeys - The partition key listdefaultParName - The default partition name for nullshivePartition - Whether the partition path is in Hive stylepublic org.apache.hadoop.fs.FileStatus[] getFilesInPartitions()
@VisibleForTesting public void reset()
public List<String> getOrBuildPartitionPaths()
The partition paths are cached once invoked.
public static HoodieMetadataConfig metadataConfig(org.apache.flink.configuration.Configuration conf)
Copyright © 2023 The Apache Software Foundation. All rights reserved.