1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| public static <T, I, K, O> HoodieMergeHandle<T, I, K, O> create( WriteOperationType operationType, HoodieWriteConfig writeConfig, String instantTime, HoodieTable<T, I, K, O> table, Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId, TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) { if (table.requireSortedRecords()) { if (table.getMetaClient().getTableConfig().isCDCEnabled()) { return new HoodieSortedMergeHandleWithChangeLog<>(writeConfig, instantTime, table, recordItr, partitionPath, fileId, taskContextSupplier, keyGeneratorOpt); } else { return new HoodieSortedMergeHandle<>(writeConfig, instantTime, table, recordItr, partitionPath, fileId, taskContextSupplier, keyGeneratorOpt); } } else if (!WriteOperationType.isChangingRecords(operationType) && writeConfig.allowDuplicateInserts()) { return new HoodieConcatHandle<>(writeConfig, instantTime, table, recordItr, partitionPath, fileId, taskContextSupplier, keyGeneratorOpt); } else { if (table.getMetaClient().getTableConfig().isCDCEnabled()) { return new HoodieMergeHandleWithChangeLog<>(writeConfig, instantTime, table, recordItr, partitionPath, fileId, taskContextSupplier, keyGeneratorOpt); } else { return new HoodieMergeHandle<>(writeConfig, instantTime, table, recordItr, partitionPath, fileId, taskContextSupplier, keyGeneratorOpt); } } }
|