fix(command): 补充hoodie.properties文件的升降级
This commit is contained in:
@@ -40,9 +40,8 @@ public class ToolCommand {
|
|||||||
if (hudiService.existsPath(hdfs)) {
|
if (hudiService.existsPath(hdfs)) {
|
||||||
String propertiesPath = StrUtil.format("{}/.hoodie/hoodie.properties", hdfs);
|
String propertiesPath = StrUtil.format("{}/.hoodie/hoodie.properties", hdfs);
|
||||||
String content = hudiService.read(propertiesPath);
|
String content = hudiService.read(propertiesPath);
|
||||||
if (content.contains("org.apache.hudi.common.model.OverwriteWithLatestAvroPayload") && content.contains("org.apache.hudi.keygen.SimpleKeyGenerator")) {
|
if (content.contains("org.apache.hudi.common.model.OverwriteWithLatestAvroPayload")) {
|
||||||
content = content.replace("org.apache.hudi.common.model.OverwriteWithLatestAvroPayload", "org.apache.hudi.common.model.TraceOverwriteWithLatestAvroPayload");
|
content = content.replace("org.apache.hudi.common.model.OverwriteWithLatestAvroPayload", "org.apache.hudi.common.model.TraceEventTimeAvroPayload");
|
||||||
content = content.replace("org.apache.hudi.keygen.SimpleKeyGenerator", "org.apache.hudi.keygen.DefaultPartitionNameKeyGenerator");
|
|
||||||
hudiService.write(propertiesPath, content, true);
|
hudiService.write(propertiesPath, content, true);
|
||||||
logger.info("{} has rewrote", hdfs);
|
logger.info("{} has rewrote", hdfs);
|
||||||
results.add(StrUtil.format("{} {}", meta.getJob().getId(), meta.getAlias()));
|
results.add(StrUtil.format("{} {}", meta.getJob().getId(), meta.getAlias()));
|
||||||
@@ -63,9 +62,8 @@ public class ToolCommand {
|
|||||||
if (hudiService.existsPath(hdfs)) {
|
if (hudiService.existsPath(hdfs)) {
|
||||||
String propertiesPath = StrUtil.format("{}/.hoodie/hoodie.properties", hdfs);
|
String propertiesPath = StrUtil.format("{}/.hoodie/hoodie.properties", hdfs);
|
||||||
String content = hudiService.read(propertiesPath);
|
String content = hudiService.read(propertiesPath);
|
||||||
if (content.contains("org.apache.hudi.common.model.TraceOverwriteWithLatestAvroPayload") && content.contains("org.apache.hudi.keygen.DefaultPartitionNameKeyGenerator")) {
|
if (content.contains("org.apache.hudi.common.model.TraceEventTimeAvroPayload")) {
|
||||||
content = content.replace("org.apache.hudi.common.model.TraceOverwriteWithLatestAvroPayload", "org.apache.hudi.common.model.OverwriteWithLatestAvroPayload");
|
content = content.replace("org.apache.hudi.common.model.TraceEventTimeAvroPayload", "org.apache.hudi.common.model.OverwriteWithLatestAvroPayload");
|
||||||
content = content.replace("org.apache.hudi.keygen.DefaultPartitionNameKeyGenerator", "org.apache.hudi.keygen.SimpleKeyGenerator");
|
|
||||||
hudiService.write(propertiesPath, content, true);
|
hudiService.write(propertiesPath, content, true);
|
||||||
logger.info("{} has rewrote", hdfs);
|
logger.info("{} has rewrote", hdfs);
|
||||||
results.add(StrUtil.format("{} {}", meta.getJob().getId(), meta.getAlias()));
|
results.add(StrUtil.format("{} {}", meta.getJob().getId(), meta.getAlias()));
|
||||||
|
|||||||
Reference in New Issue
Block a user