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 @@ -180,6 +180,11 @@ public class HoodieTableConfig extends HoodieConfig {
public static final String NO_OP_BOOTSTRAP_INDEX_CLASS = NoOpBootstrapIndex.class.getName();

public HoodieTableConfig(FileSystem fs, String metaPath, String payloadClassName) {
this(fs, metaPath, payloadClassName, Option.empty());
}

public HoodieTableConfig(FileSystem fs, String metaPath, String payloadClassName,
Option<String> bootstrapIndexClassName) {
super();
Path propertyPath = new Path(metaPath, HOODIE_PROPERTIES_FILE);
LOG.info("Loading table properties from " + propertyPath);
Expand All @@ -193,6 +198,11 @@ public HoodieTableConfig(FileSystem fs, String metaPath, String payloadClassName
props.store(outputStream, "Properties saved on " + new Date(System.currentTimeMillis()));
}
}
LOG.error("BOOTSTRAP_INDEX_CLASS_NAME: " + getString(BOOTSTRAP_INDEX_CLASS_NAME));
if (contains(BOOTSTRAP_INDEX_CLASS_NAME) && bootstrapIndexClassName.isPresent()
&& !getString(BOOTSTRAP_INDEX_CLASS_NAME).equals(bootstrapIndexClassName.get())) {
setValue(BOOTSTRAP_INDEX_CLASS_NAME, bootstrapIndexClassName.get());
}
} catch (IOException e) {
throw new HoodieIOException("Could not load Hoodie properties from " + propertyPath, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class HoodieTableMetaClient implements Serializable {

private HoodieTableMetaClient(Configuration conf, String basePath, boolean loadActiveTimelineOnLoad,
ConsistencyGuardConfig consistencyGuardConfig, Option<TimelineLayoutVersion> layoutVersion,
String payloadClassName) {
String payloadClassName, Option<String> bootstrapIndexClassName) {
LOG.info("Loading HoodieTableMetaClient from " + basePath);
this.consistencyGuardConfig = consistencyGuardConfig;
this.hadoopConf = new SerializableConfiguration(conf);
Expand All @@ -112,7 +112,7 @@ private HoodieTableMetaClient(Configuration conf, String basePath, boolean loadA
Path metaPathDir = new Path(this.metaPath);
this.fs = getFs();
TableNotFoundException.checkTableValidity(fs, basePathDir, metaPathDir);
this.tableConfig = new HoodieTableConfig(fs, metaPath, payloadClassName);
this.tableConfig = new HoodieTableConfig(fs, metaPath, payloadClassName, bootstrapIndexClassName);
this.tableType = tableConfig.getTableType();
Option<TimelineLayoutVersion> tableConfigVersion = tableConfig.getTimelineLayoutVersion();
if (layoutVersion.isPresent() && tableConfigVersion.isPresent()) {
Expand Down Expand Up @@ -576,6 +576,7 @@ public static class Builder {
private String basePath;
private boolean loadActiveTimelineOnLoad = false;
private String payloadClassName = null;
private String bootstrapIndexClassName = null;
private ConsistencyGuardConfig consistencyGuardConfig = ConsistencyGuardConfig.newBuilder().build();
private Option<TimelineLayoutVersion> layoutVersion = Option.of(TimelineLayoutVersion.CURR_LAYOUT_VERSION);

Expand All @@ -599,6 +600,11 @@ public Builder setPayloadClassName(String payloadClassName) {
return this;
}

public Builder setBootstrapIndexClassName(String bootstrapIndexClassName) {
this.bootstrapIndexClassName = bootstrapIndexClassName;
return this;
}

public Builder setConsistencyGuardConfig(ConsistencyGuardConfig consistencyGuardConfig) {
this.consistencyGuardConfig = consistencyGuardConfig;
return this;
Expand All @@ -612,8 +618,8 @@ public Builder setLayoutVersion(Option<TimelineLayoutVersion> layoutVersion) {
public HoodieTableMetaClient build() {
ValidationUtils.checkArgument(conf != null, "Configuration needs to be set to init HoodieTableMetaClient");
ValidationUtils.checkArgument(basePath != null, "basePath needs to be set to init HoodieTableMetaClient");
return new HoodieTableMetaClient(conf, basePath,
loadActiveTimelineOnLoad, consistencyGuardConfig, layoutVersion, payloadClassName);
return new HoodieTableMetaClient(conf, basePath, loadActiveTimelineOnLoad,
consistencyGuardConfig, layoutVersion, payloadClassName, Option.ofNullable(bootstrapIndexClassName));
}
}

Expand Down