Incorporating code review feedback for finalizeWrite for COW #2
This commit is contained in:
@@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.Serializable;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
|
||||
/**
|
||||
* Statistics about a single Hoodie write operation.
|
||||
@@ -212,6 +213,16 @@ public class HoodieWriteStat implements Serializable {
|
||||
return this.tempPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set path and tempPath relative to the given basePath.
|
||||
*/
|
||||
public void setPaths(Path basePath, Path path, Path tempPath) {
|
||||
this.path = path.toString().replace(basePath + "/", "");
|
||||
if (tempPath != null) {
|
||||
this.tempPath = tempPath.toString().replace(basePath + "/", "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder()
|
||||
|
||||
@@ -233,6 +233,11 @@ public class HoodieTableMetaClient implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
// Always create temporaryFolder which is needed for finalizeWrite for Hoodie tables
|
||||
final Path temporaryFolder = new Path(basePath, HoodieTableMetaClient.TEMPFOLDER_NAME);
|
||||
if (!fs.exists(temporaryFolder)) {
|
||||
fs.mkdirs(temporaryFolder);
|
||||
}
|
||||
HoodieTableConfig.createHoodieProperties(fs, metaPathDir, props);
|
||||
HoodieTableMetaClient metaClient = new HoodieTableMetaClient(fs.getConf(), basePath);
|
||||
log.info("Finished initializing Table of type " + metaClient.getTableConfig().getTableType()
|
||||
|
||||
Reference in New Issue
Block a user