This is an automated email from the ASF dual-hosted git repository.
danny0405 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 410b4f5060a [MINOR] Fixed checkstyle in HoodieJavaWriteClientExample
(#11756)
410b4f5060a is described below
commit 410b4f5060a0113ac653d29db1f9618715a138ee
Author: Vova Kolmakov <[email protected]>
AuthorDate: Tue Aug 13 07:05:48 2024 +0700
[MINOR] Fixed checkstyle in HoodieJavaWriteClientExample (#11756)
Co-authored-by: Vova Kolmakov <[email protected]>
---
.../hudi/examples/java/HoodieJavaWriteClientExample.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
a/hudi-examples/hudi-examples-java/src/main/java/org/apache/hudi/examples/java/HoodieJavaWriteClientExample.java
b/hudi-examples/hudi-examples-java/src/main/java/org/apache/hudi/examples/java/HoodieJavaWriteClientExample.java
index 84bd12c4fc7..cdaf4dfc32f 100644
---
a/hudi-examples/hudi-examples-java/src/main/java/org/apache/hudi/examples/java/HoodieJavaWriteClientExample.java
+++
b/hudi-examples/hudi-examples-java/src/main/java/org/apache/hudi/examples/java/HoodieJavaWriteClientExample.java
@@ -58,7 +58,7 @@ public class HoodieJavaWriteClientExample {
private static String tableType = HoodieTableType.COPY_ON_WRITE.name();
- private static final String morStr = "mor";
+ private static final String MOR_STR = "mor";
public static void main(String[] args) throws Exception {
if (args.length < 3) {
@@ -68,11 +68,11 @@ public class HoodieJavaWriteClientExample {
String tablePath = args[0];
String tableName = args[1];
String tableTypeStr = args[2];
- if (tableTypeStr != null && tableTypeStr.equals(morStr)) {
+ if (tableTypeStr != null && tableTypeStr.equals(MOR_STR)) {
tableType = HoodieTableType.MERGE_ON_READ.name();
}
- LOG.info("Start JavaWriteClient example with tablePath: " + tablePath + ",
tableName: " + tableName + ", tableType: " + tableType);
+ LOG.info("Start JavaWriteClient example with tablePath: {}, tableName: {},
tableType: {}", tablePath, tableName, tableType);
// Generator of some records to be loaded in.
HoodieExampleDataGenerator<HoodieAvroPayload> dataGen = new
HoodieExampleDataGenerator<>();
@@ -101,27 +101,27 @@ public class HoodieJavaWriteClientExample {
// inserts
String newCommitTime = client.startCommit();
- LOG.info("Starting commit " + newCommitTime);
+ LOG.info("Starting commit {}", newCommitTime);
List<HoodieRecord<HoodieAvroPayload>> records =
dataGen.generateInserts(newCommitTime, 10);
List<HoodieRecord<HoodieAvroPayload>> recordsSoFar = new
ArrayList<>(records);
List<HoodieRecord<HoodieAvroPayload>> writeRecords =
- recordsSoFar.stream().map(r -> new
HoodieAvroRecord<HoodieAvroPayload>(r)).collect(Collectors.toList());
+
recordsSoFar.stream().map(HoodieAvroRecord::new).collect(Collectors.toList());
client.insert(writeRecords, newCommitTime);
// updates
newCommitTime = client.startCommit();
- LOG.info("Starting commit " + newCommitTime);
+ LOG.info("Starting commit {}", newCommitTime);
List<HoodieRecord<HoodieAvroPayload>> toBeUpdated =
dataGen.generateUpdates(newCommitTime, 2);
records.addAll(toBeUpdated);
recordsSoFar.addAll(toBeUpdated);
writeRecords =
- recordsSoFar.stream().map(r -> new
HoodieAvroRecord<HoodieAvroPayload>(r)).collect(Collectors.toList());
+
recordsSoFar.stream().map(HoodieAvroRecord::new).collect(Collectors.toList());
client.upsert(writeRecords, newCommitTime);
// Delete
newCommitTime = client.startCommit();
- LOG.info("Starting commit " + newCommitTime);
+ LOG.info("Starting commit {}", newCommitTime);
// just delete half of the records
int numToDelete = recordsSoFar.size() / 2;
List<HoodieKey> toBeDeleted =