hudi-utilities/src/main/java/org/apache/hudi/utilities/UtilHelpers.java
/**
   * Build Hoodie write client.
   *
   * @param jsc         Java Spark Context
   * @param basePath    Base Path
   * @param schemaStr   Schema
   * @param parallelism Parallelism
   */
Build Hoodie write client.
@param jsc         Java Spark Context
@param basePath    Base Path
@param schemaStr   Schema
@param parallelism Parallelism
Build Hoodie write client . @param jsc Java Spark Context @param basePath Base Path @param schemaStr Schema @param parallelism Parallelism
public static HoodieWriteClient createHoodieClient(JavaSparkContext jsc, String basePath, String schemaStr,
                                                     int parallelism, Option<String> compactionStrategyClass, TypedProperties properties) {
    HoodieCompactionConfig compactionConfig = compactionStrategyClass
        .map(strategy -> HoodieCompactionConfig.newBuilder().withInlineCompaction(false)
            .withCompactionStrategy(ReflectionUtils.loadClass(strategy)).build())
        .orElse(HoodieCompactionConfig.newBuilder().withInlineCompaction(false).build());
    HoodieWriteConfig config =
        HoodieWriteConfig.newBuilder().withPath(basePath)
            .withParallelism(parallelism, parallelism)
            .withBulkInsertParallelism(parallelism)
            .withSchema(schemaStr).combineInput(true, true).withCompactionConfig(compactionConfig)
            .withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.BLOOM).build())
            .withProps(properties).build();
    return new HoodieWriteClient(jsc, config);
  }
public static HoodieWriteClient createHoodieClient ( JavaSparkContext jsc , String basePath , String schemaStr , int parallelism , Option < String > compactionStrategyClass , TypedProperties properties ) { HoodieCompactionConfig compactionConfig = compactionStrategyClass . map ( strategy -> HoodieCompactionConfig . newBuilder ( ) . withInlineCompaction ( false ) . withCompactionStrategy ( ReflectionUtils . loadClass ( strategy ) ) . build ( ) ) . orElse ( HoodieCompactionConfig . newBuilder ( ) . withInlineCompaction ( false ) . build ( ) ) ; HoodieWriteConfig config = HoodieWriteConfig . newBuilder ( ) . withPath ( basePath ) . withParallelism ( parallelism , parallelism ) . withBulkInsertParallelism ( parallelism ) . withSchema ( schemaStr ) . combineInput ( true , true ) . withCompactionConfig ( compactionConfig ) . withIndexConfig ( HoodieIndexConfig . newBuilder ( ) . withIndexType ( HoodieIndex . IndexType . BLOOM ) . build ( ) ) . withProps ( properties ) . build ( ) ; return new HoodieWriteClient ( jsc , config ) ; }
Build Hoodie write client.
Build Hoodie write client .