[HUDI-1276] [HUDI-1459] Make Clustering/ReplaceCommit and Metadata table be compatible (#2422)
* [HUDI-1276] [HUDI-1459] Make Clustering/ReplaceCommit and Metadata table be compatible * Use filesystemview and json format from metadata. Add tests Co-authored-by: Satish Kotha <satishkotha@uber.com>
This commit is contained in:
@@ -299,6 +299,21 @@ public class FileSystemViewHandler {
|
||||
writeValueAsString(ctx, dtos);
|
||||
}, true));
|
||||
|
||||
app.get(RemoteHoodieTableFileSystemView.ALL_REPLACED_FILEGROUPS_BEFORE, new ViewHandler(ctx -> {
|
||||
List<FileGroupDTO> dtos = sliceHandler.getReplacedFileGroupsBefore(
|
||||
ctx.validatedQueryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM).getOrThrow(),
|
||||
ctx.queryParam(RemoteHoodieTableFileSystemView.MAX_INSTANT_PARAM,""),
|
||||
ctx.queryParam(RemoteHoodieTableFileSystemView.PARTITION_PARAM,""));
|
||||
writeValueAsString(ctx, dtos);
|
||||
}, true));
|
||||
|
||||
app.get(RemoteHoodieTableFileSystemView.ALL_REPLACED_FILEGROUPS_PARTITION, new ViewHandler(ctx -> {
|
||||
List<FileGroupDTO> dtos = sliceHandler.getAllReplacedFileGroups(
|
||||
ctx.validatedQueryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM).getOrThrow(),
|
||||
ctx.queryParam(RemoteHoodieTableFileSystemView.PARTITION_PARAM,""));
|
||||
writeValueAsString(ctx, dtos);
|
||||
}, true));
|
||||
|
||||
app.get(RemoteHoodieTableFileSystemView.PENDING_CLUSTERING_FILEGROUPS, new ViewHandler(ctx -> {
|
||||
List<ClusteringOpDTO> dtos = sliceHandler.getFileGroupsInPendingClustering(
|
||||
ctx.validatedQueryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM).getOrThrow());
|
||||
|
||||
@@ -94,6 +94,16 @@ public class FileSliceHandler extends Handler {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<FileGroupDTO> getReplacedFileGroupsBefore(String basePath, String maxCommitTime, String partitionPath) {
|
||||
return viewManager.getFileSystemView(basePath).getReplacedFileGroupsBefore(maxCommitTime, partitionPath).map(FileGroupDTO::fromFileGroup)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<FileGroupDTO> getAllReplacedFileGroups(String basePath, String partitionPath) {
|
||||
return viewManager.getFileSystemView(basePath).getAllReplacedFileGroups(partitionPath).map(FileGroupDTO::fromFileGroup)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<ClusteringOpDTO> getFileGroupsInPendingClustering(String basePath) {
|
||||
return viewManager.getFileSystemView(basePath).getFileGroupsInPendingClustering()
|
||||
.map(fgInstant -> ClusteringOpDTO.fromClusteringOp(fgInstant.getLeft(), fgInstant.getRight()))
|
||||
|
||||
Reference in New Issue
Block a user