You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/07/26 15:03:59 UTC

[GitHub] [hudi] xingbowu opened a new pull request #3348: refact hoodie stream creator

xingbowu opened a new pull request #3348:
URL: https://github.com/apache/hudi/pull/3348


   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   *refactor hoodie data stream creator in hudi-flink module*
   
   ## Brief change log
   
     - refactor method to create hoodie data stream  in HoodieTableSink and HoodieFlinkStreamer
   
   ## Verify this pull request
   
   This pull request is already covered by existing tests, such as *StreamWriteITCase*.
   
   ## Committer checklist
   
    - [x] Commit message is descriptive of the change
    
    - [x] CI is green
   
    - [x] Necessary doc changes done or have another open PR
          
    - [x] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] yanghua commented on pull request #3348: [MINOR] refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
yanghua commented on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-887126662


   Hi @xingbowu Thanks for your contribution. IMO, this PR is not suitable for the "MINOR" category based on the official contribution guide. You should file a Jira ticket and change the title of the PR.


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] danny0405 commented on a change in pull request #3348: [HUDI-2229] refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#discussion_r677171295



##########
File path: hudi-flink/src/main/java/org/apache/hudi/streamer/HoodieFlinkStreamer.java
##########
@@ -111,53 +101,7 @@ public static void main(String[] args) throws Exception {
         dataStream = transformer.get().apply(dataStream);
       }
     }
-
-    DataStream<HoodieRecord> dataStream2 = dataStream.map(new RowDataToHoodieFunction<>(rowType, conf), TypeInformation.of(HoodieRecord.class));
-
-    if (conf.getBoolean(FlinkOptions.INDEX_BOOTSTRAP_ENABLED)) {
-      dataStream2 = dataStream2.rebalance()
-          .transform(
-              "index_bootstrap",
-              TypeInformation.of(HoodieRecord.class),
-              new ProcessOperator<>(new BootstrapFunction<>(conf)))
-          .setParallelism(conf.getOptional(FlinkOptions.INDEX_BOOTSTRAP_TASKS).orElse(parallelism))
-          .uid("uid_index_bootstrap_" + conf.getString(FlinkOptions.TABLE_NAME));
-    }
-
-    DataStream<Object> pipeline = dataStream2
-        // Key-by record key, to avoid multiple subtasks write to a bucket at the same time
-        .keyBy(HoodieRecord::getRecordKey)
-        .transform(
-            "bucket_assigner",
-            TypeInformation.of(HoodieRecord.class),
-            new BucketAssignOperator<>(new BucketAssignFunction<>(conf)))

Review comment:
       The pipeline in `HoodieTableSink.java` is the only real thing and we can just discard the logic here.

##########
File path: hudi-flink/src/main/java/org/apache/hudi/util/StreamerUtil.java
##########
@@ -325,4 +343,69 @@ public static long instantTimeDiffSeconds(String newInstantTime, String oldInsta
     }
   }
 
+  public static DataStreamSink<?> createHoodieDataStreamSink(RowType rowType, Configuration conf, int parallelism,
+                                                             StreamWriteOperatorFactory<HoodieRecord> operatorFactory, DataStream<RowData> dataStream) {
+    DataStream<HoodieRecord> dataStream2 = dataStream.map(new RowDataToHoodieFunction<>(rowType, conf),
+            TypeInformation.of(HoodieRecord.class));
+
+    if (conf.getBoolean(FlinkOptions.INDEX_BOOTSTRAP_ENABLED)) {
+      dataStream2 = getIndexBootstrapStream(conf, parallelism, dataStream2);

Review comment:
       Move these methods into a separate class `HoodieWritePipelines` and maybe you can create a fluent API to build all kinds of sub-pipelines.




-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] xingbowu commented on pull request #3348: [HUDI-2229] Refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
xingbowu commented on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-901094850


   close this pr by mistake. open new pr #3495 to link it 


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot edited a comment on pull request #3348: [MINOR] refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-886785658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168",
       "triggerID" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run travis` re-run the last Travis build
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot edited a comment on pull request #3348: [HUDI-2229] Refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-886785658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168",
       "triggerID" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot commented on pull request #3348: [MINOR] refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-886785658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run travis` re-run the last Travis build
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot edited a comment on pull request #3348: [MINOR] refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-886785658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168",
       "triggerID" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run travis` re-run the last Travis build
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] xingbowu closed pull request #3348: [HUDI-2229] Refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
xingbowu closed pull request #3348:
URL: https://github.com/apache/hudi/pull/3348


   


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] xingbowu commented on pull request #3348: [HUDI-2229] Refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
xingbowu commented on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-901094850


   close this pr by mistake. open new pr #3495 to link it 


-- 
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-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot edited a comment on pull request #3348: [HUDI-2229] Refact hoodie stream creator

Posted by GitBox <gi...@apache.org>.
hudi-bot edited a comment on pull request #3348:
URL: https://github.com/apache/hudi/pull/3348#issuecomment-886785658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168",
       "triggerID" : "cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cde9cca62d5fa09aa04bdcc01b6c8a10ed55a2a7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=1168) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run travis` re-run the last Travis build
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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