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 2022/02/07 20:36:18 UTC

[GitHub] [hudi] nsivabalan opened a new pull request #4762: [HUDI-3367] Adding support for custom scheduler configs with streaming sink

nsivabalan opened a new pull request #4762:
URL: https://github.com/apache/hudi/pull/4762


   ## What is the purpose of the pull request
   
   Adding support to setting custom scheduler spark configs for streaming sink. 
   Users have to set "spark.scheduler.allocation.file=/sample_alloc_file" when they launch the spark-shell to leverage this. 
   sample file
   ```
     <?xml version="1.0"?>
     <allocations>
       <pool name="sparkdatasourcewrite">
         <schedulingMode>FAIR</schedulingMode>
         <weight>4</weight>
         <minShare>2</minShare>
       </pool>
       <pool name="hoodiecompact">
         <schedulingMode>FAIR</schedulingMode>
         <weight>3</weight>
         <minShare>1</minShare>
       </pool>
     </allocations>
   ```
   
   The poolname is hardcoded within hudi and so users are expected to match the pool names as is. 
   
   ## Brief change log
   
   *(for example:)*
     - *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
   
   ## Verify this pull request
   
   Tested this patch manually by explicitly setting the allocation file and w/o. 
   
   Snapshot for spark streaming write where configs are honored. 
   <img width="1769" alt="Screen Shot 2022-02-07 at 9 37 53 AM" src="https://user-images.githubusercontent.com/513218/152867682-a4df80d6-d3a5-4802-be3c-e42e18cc6580.png">
   
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] 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] codope merged pull request #4762: [HUDI-3367] Adding support for custom scheduler configs with streaming sink

Posted by GitBox <gi...@apache.org>.
codope merged pull request #4762:
URL: https://github.com/apache/hudi/pull/4762


   


-- 
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 #4762: [HUDI-3367] Adding support for custom scheduler configs with streaming sink

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "97e9d66c70705fe8a16f71dc57b4d0e3aa870f7f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "97e9d66c70705fe8a16f71dc57b4d0e3aa870f7f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 97e9d66c70705fe8a16f71dc57b4d0e3aa870f7f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@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] xushiyan commented on a change in pull request #4762: [HUDI-3367] Adding support for custom scheduler configs with streaming sink

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



##########
File path: hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala
##########
@@ -117,6 +117,11 @@ object HoodieSparkSqlWriter {
     }
 
     val jsc = new JavaSparkContext(sparkContext)
+    if (asyncCompactionTriggerFn.isDefined) {
+      if (jsc.getConf.getOption(DataSourceWriteOptions.SPARK_SCHEDULER_ALLOCATION_FILE_KEY).isDefined) {
+        jsc.setLocalProperty("spark.scheduler.pool", DataSourceWriteOptions.SPARK_DATASOURCE_WRITER_POOL_NAME)

Review comment:
       these 2 does not look like hoodie specific settings while `DataSourceWriteOptions` should only have `hoodie.*` settings

##########
File path: hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala
##########
@@ -473,6 +473,32 @@ object DataSourceWriteOptions {
       + "Use this when you are in the process of migrating from "
       + "com.uber.hoodie to org.apache.hudi. Stop using this after you migrated the table definition to org.apache.hudi input format")
 
+  // spark data source write pool name. Incase of streaming sink, users might be interested to set custom scheduling configs
+  // for regular writes and async compaction. In such cases, this pool name will be used for spark datasource writes.
+  val SPARK_DATASOURCE_WRITER_POOL_NAME = "sparkdatasourcewrite"

Review comment:
       better to prefix with `hoodie` and be specific, sth like `hoodie_spark_datasource_writer_pool`




-- 
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] nsivabalan commented on a change in pull request #4762: [HUDI-3367] Adding support for custom scheduler configs with streaming sink

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



##########
File path: hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala
##########
@@ -117,6 +117,11 @@ object HoodieSparkSqlWriter {
     }
 
     val jsc = new JavaSparkContext(sparkContext)
+    if (asyncCompactionTriggerFn.isDefined) {
+      if (jsc.getConf.getOption(DataSourceWriteOptions.SPARK_SCHEDULER_ALLOCATION_FILE_KEY).isDefined) {
+        jsc.setLocalProperty("spark.scheduler.pool", DataSourceWriteOptions.SPARK_DATASOURCE_WRITER_POOL_NAME)

Review comment:
        I agree. but do you have a good suggestion as to where to move this? I could not find a right class to move this only. 
   Only option I can think of is to introduce a new class just to hold this 2 new variables. 




-- 
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