[HUDI-1072] Introduce REPLACE top level action. Implement insert_overwrite operation on top of replace action (#2048)
This commit is contained in:
@@ -289,6 +289,14 @@ public class FileSystemViewHandler {
|
||||
.refreshTable(ctx.validatedQueryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM).getOrThrow());
|
||||
writeValueAsString(ctx, success);
|
||||
}, false));
|
||||
|
||||
app.get(RemoteHoodieTableFileSystemView.ALL_REPLACED_FILEGROUPS_BEFORE_OR_ON, new ViewHandler(ctx -> {
|
||||
List<FileGroupDTO> dtos = sliceHandler.getReplacedFileGroupsBeforeOrOn(
|
||||
ctx.validatedQueryParam(RemoteHoodieTableFileSystemView.BASEPATH_PARAM).getOrThrow(),
|
||||
ctx.queryParam(RemoteHoodieTableFileSystemView.MAX_INSTANT_PARAM,""),
|
||||
ctx.queryParam(RemoteHoodieTableFileSystemView.PARTITION_PARAM,""));
|
||||
writeValueAsString(ctx, dtos);
|
||||
}, true));
|
||||
}
|
||||
|
||||
private static boolean isRefreshCheckDisabledInQuery(Context ctxt) {
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
|
||||
package org.apache.hudi.timeline.service.handlers;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hudi.common.table.timeline.dto.CompactionOpDTO;
|
||||
import org.apache.hudi.common.table.timeline.dto.FileGroupDTO;
|
||||
import org.apache.hudi.common.table.timeline.dto.FileSliceDTO;
|
||||
import org.apache.hudi.common.table.view.FileSystemViewManager;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -89,6 +88,11 @@ public class FileSliceHandler extends Handler {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<FileGroupDTO> getReplacedFileGroupsBeforeOrOn(String basePath, String maxCommitTime, String partitionPath) {
|
||||
return viewManager.getFileSystemView(basePath).getReplacedFileGroupsBeforeOrOn(maxCommitTime, partitionPath).map(FileGroupDTO::fromFileGroup)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public boolean refreshTable(String basePath) {
|
||||
viewManager.clearFileSystemView(basePath);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user