This is an automated email from the ASF dual-hosted git repository.

vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 33f5208  Only inflight commit timeline (.commit/.deltacommit) must be 
used when checking for sanity during compaction scheduling
33f5208 is described below

commit 33f5208c1e95067606cd24ea90c05cd33626a243
Author: Balaji Varadarajan <[email protected]>
AuthorDate: Tue May 28 15:17:54 2019 -0700

    Only inflight commit timeline (.commit/.deltacommit) must be used when 
checking for sanity during compaction scheduling
---
 hoodie-client/src/main/java/com/uber/hoodie/HoodieWriteClient.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hoodie-client/src/main/java/com/uber/hoodie/HoodieWriteClient.java 
b/hoodie-client/src/main/java/com/uber/hoodie/HoodieWriteClient.java
index 5a918e4..fb64282 100644
--- a/hoodie-client/src/main/java/com/uber/hoodie/HoodieWriteClient.java
+++ b/hoodie-client/src/main/java/com/uber/hoodie/HoodieWriteClient.java
@@ -405,7 +405,8 @@ public class HoodieWriteClient<T extends 
HoodieRecordPayload> extends AbstractHo
       });
 
       HoodieActiveTimeline activeTimeline = table.getActiveTimeline();
-      Optional<HoodieInstant> instant = 
activeTimeline.filterInflightsExcludingCompaction().lastInstant();
+      Optional<HoodieInstant> instant =
+          
activeTimeline.getCommitsTimeline().filterInflightsExcludingCompaction().lastInstant();
       activeTimeline.saveToInflight(instant.get(),
           
Optional.of(metadata.toJsonString().getBytes(StandardCharsets.UTF_8)));
     } catch (IOException io) {
@@ -1079,7 +1080,7 @@ public class HoodieWriteClient<T extends 
HoodieRecordPayload> extends AbstractHo
     HoodieTableMetaClient metaClient = new 
HoodieTableMetaClient(jsc.hadoopConfiguration(),
         config.getBasePath(), true);
     // if there are inflight writes, their instantTime must not be less than 
that of compaction instant time
-    
metaClient.getActiveTimeline().filterInflightsExcludingCompaction().firstInstant().ifPresent(earliestInflight
 -> {
+    
metaClient.getCommitsTimeline().filterInflightsExcludingCompaction().firstInstant().ifPresent(earliestInflight
 -> {
       Preconditions.checkArgument(
           HoodieTimeline.compareTimestamps(earliestInflight.getTimestamp(), 
instantTime, HoodieTimeline.GREATER),
           "Earliest write inflight instant time must be later "

Reply via email to