yihua commented on code in PR #10435:
URL: https://github.com/apache/hudi/pull/10435#discussion_r1440140227


##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/HoodieSparkUtils.scala:
##########
@@ -107,23 +107,19 @@ object HoodieSparkUtils extends SparkAdapterSupport with 
SparkVersionsSupport wi
     //       injecting [[SQLConf]], which by default isn't propagated by Spark 
to the executor(s).
     //       [[SQLConf]] is required by [[AvroSerializer]]
     injectSQLConf(df.queryExecution.toRdd.mapPartitions { rows =>
-      if (rows.isEmpty) {
-        Iterator.empty

Review Comment:
   Does removal of this provide any benefit?



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/StreamSync.java:
##########
@@ -448,7 +450,9 @@ public Pair<Option<String>, JavaRDD<WriteStatus>> 
syncOnce() throws IOException
         }
       }
 
+      long startWrite = System.currentTimeMillis();

Review Comment:
   Similar here on using `HoodieTimer` and below.



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieTableServiceClient.java:
##########
@@ -1016,7 +1016,7 @@ private List<String> 
getInstantsToRollbackForLazyCleanPolicy(HoodieTableMetaClie
   @Deprecated
   public boolean rollback(final String commitInstantTime, 
Option<HoodiePendingRollbackInfo> pendingRollbackInfo, boolean skipLocking) 
throws HoodieRollbackException {
     final String rollbackInstantTime = pendingRollbackInfo.map(entry -> 
entry.getRollbackInstant().getTimestamp())
-        .orElse(createNewInstantTime(!skipLocking));
+        .orElseGet(() -> createNewInstantTime(!skipLocking));
     return rollback(commitInstantTime, pendingRollbackInfo, 
rollbackInstantTime, skipLocking);

Review Comment:
   Good catch!



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/StreamSync.java:
##########
@@ -402,7 +402,9 @@ public Pair<Option<String>, JavaRDD<WriteStatus>> 
syncOnce() throws IOException
         .build();
     String instantTime = metaClient.createNewInstantTime();
 
+    long startInput = System.currentTimeMillis();
     InputBatch inputBatch = readFromSource(instantTime, metaClient);
+    LOG.error("Time to read from source : " + (System.currentTimeMillis() - 
startInput));

Review Comment:
   Use `HoodieTimer` to track execution time?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to