yanghua commented on a change in pull request #2074:
URL: https://github.com/apache/hudi/pull/2074#discussion_r495639342
##########
File path:
hudi-utilities/src/main/java/org/apache/hudi/utilities/UtilHelpers.java
##########
@@ -93,11 +96,19 @@
private static final Logger LOG = LogManager.getLogger(UtilHelpers.class);
public static Source createSource(String sourceClass, TypedProperties cfg,
JavaSparkContext jssc,
- SparkSession sparkSession, SchemaProvider
schemaProvider) throws IOException {
+ SparkSession sparkSession, SchemaProvider
schemaProvider, HoodieDeltaStreamerMetrics metrics) throws IOException {
+
try {
+ if (JsonKafkaSource.class.getName().equals(sourceClass)
+ || AvroKafkaSource.class.getName().equals(sourceClass)) {
+ return (Source) ReflectionUtils.loadClass(sourceClass,
+ new Class<?>[]{TypedProperties.class, JavaSparkContext.class,
SparkSession.class, SchemaProvider.class, HoodieDeltaStreamerMetrics.class},
cfg,
+ jssc, sparkSession, schemaProvider, metrics);
+ }
+
return (Source) ReflectionUtils.loadClass(sourceClass,
- new Class<?>[] {TypedProperties.class, JavaSparkContext.class,
SparkSession.class, SchemaProvider.class}, cfg,
- jssc, sparkSession, schemaProvider);
+ new Class<?>[] {TypedProperties.class, JavaSparkContext.class,
SparkSession.class, SchemaProvider.class}, cfg,
Review comment:
Why change this indent?
##########
File path:
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java
##########
@@ -190,8 +192,10 @@ public DeltaSync(HoodieDeltaStreamer.Config cfg,
SparkSession sparkSession, Sche
this.transformer =
UtilHelpers.createTransformer(cfg.transformerClassNames);
this.keyGenerator = DataSourceUtils.createKeyGenerator(props);
+ this.metrics = new
HoodieDeltaStreamerMetrics(getHoodieClientConfig(this.schemaProvider));
+
this.formatAdapter = new SourceFormatAdapter(
- UtilHelpers.createSource(cfg.sourceClassName, props, jssc,
sparkSession, schemaProvider));
+ UtilHelpers.createSource(cfg.sourceClassName, props, jssc,
sparkSession, schemaProvider, metrics));
Review comment:
The first indent is correct?
##########
File path:
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java
##########
@@ -233,6 +235,18 @@ public KafkaOffsetGen(TypedProperties props) {
return checkpointOffsetReseter ? earliestOffsets : checkpointOffsets;
}
+ private Long delayOffectCalculation(Option<String> lastCheckpointStr,
Set<TopicPartition> topicPartitions, KafkaConsumer consumer) {
Review comment:
`delayOffectCalculation ` -> `delayOffsetCalculation `?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]