Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public FileSystemViewStorageConfig getRemoteFileSystemViewConfig() {
.withRemoteTimelineInitialRetryIntervalMs(writeConfig.getClientSpecifiedViewStorageConfig().getRemoteTimelineInitialRetryIntervalMs())
.withRemoteTimelineClientMaxRetryIntervalMs(writeConfig.getClientSpecifiedViewStorageConfig().getRemoteTimelineClientMaxRetryIntervalMs())
.withRemoteTimelineClientRetryExceptions(writeConfig.getClientSpecifiedViewStorageConfig().getRemoteTimelineClientRetryExceptions())
.withRemoteFileSystemViewFirst(writeConfig.getClientSpecifiedViewStorageConfig().isRemoteViewFirst())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ public static FileSystemViewManager createViewManager(final HoodieEngineContext
return new FileSystemViewManager(context, config, (metaClient, viewConfig) -> createRemoteFileSystemView(conf,
viewConfig, metaClient));
case REMOTE_FIRST:
LOG.info("Creating remote first table view");
return new FileSystemViewManager(context, config, (metaClient, viewConfig) -> {
RemoteHoodieTableFileSystemView remoteFileSystemView =
createRemoteFileSystemView(conf, viewConfig, metaClient);
Expand All @@ -279,7 +278,13 @@ public static FileSystemViewManager createViewManager(final HoodieEngineContext
throw new IllegalArgumentException("Secondary Storage type can only be in-memory or spillable. Was :"
+ viewConfig.getSecondaryStorageType());
}
return new PriorityBasedFileSystemView(remoteFileSystemView, secondaryView);
if (config.isRemoteViewFirst()) {
LOG.info("Creating remote table view first");
return new PriorityBasedFileSystemView(remoteFileSystemView, secondaryView);
} else {
LOG.info("Creating secondary table view first");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @zhedoubushishi , who have also encountered OOM for async cleaning.

return new PriorityBasedFileSystemView(secondaryView, remoteFileSystemView);
}
});
default:
throw new IllegalArgumentException("Unknown file system view type :" + config.getStorageType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ public class FileSystemViewStorageConfig extends HoodieConfig {
.withDocumentation("Config to control whether backup needs to be configured if clients were not able to reach"
+ " timeline service.");

public static final ConfigProperty<String> REMOTE_VIEW_FIRST = ConfigProperty
.key("hoodie.filesystem.view.remote.first")
.defaultValue("true")
.markAdvanced()
.withDocumentation("Controls whether or not the file system view is remote first or secondary first.");

public static FileSystemViewStorageConfig.Builder newBuilder() {
return new Builder();
}
Expand Down Expand Up @@ -274,6 +280,10 @@ public String getRocksdbBasePath() {
return getString(ROCKSDB_BASE_PATH);
}

public boolean isRemoteViewFirst() {
return getBoolean(REMOTE_VIEW_FIRST);
}

/**
* The builder used to build {@link FileSystemViewStorageConfig}.
*/
Expand Down Expand Up @@ -378,6 +388,11 @@ public Builder withEnableBackupForRemoteFileSystemView(boolean enable) {
return this;
}

public Builder withRemoteFileSystemViewFirst(boolean enable) {
fileSystemViewStorageConfig.setValue(REMOTE_VIEW_FIRST, Boolean.toString(enable));
return this;
}

public FileSystemViewStorageConfig build() {
fileSystemViewStorageConfig.setDefaults(FileSystemViewStorageConfig.class.getName());
// Validations
Expand Down