[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155070220


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java:
##
@@ -282,8 +226,8 @@ public OffsetRange[] getNextOffsetRanges(Option 
lastCheckpointStr, long
 }
 
 // Come up with final set of OffsetRanges to read (account for new 
partitions, limit number of events)
-long maxEventsToReadFromKafka = 
props.getLong(Config.MAX_EVENTS_FROM_KAFKA_SOURCE_PROP.key(),
-Config.MAX_EVENTS_FROM_KAFKA_SOURCE_PROP.defaultValue());
+long maxEventsToReadFromKafka = 
props.getLong(KafkaSourceConfig.MAX_EVENTS_FROM_KAFKA_SOURCE_PROP.key(),

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069638


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/SourceTestConfig.java:
##
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigProperty;
+
+/**
+ * Configurations for Test Data Sources.
+ */
+public class SourceTestConfig {

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069525


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/HoodieIncrSourceConfig.java:
##
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+import org.apache.hudi.hive.SlashEncodedDayPartitionValueExtractor;
+import org.apache.hudi.utilities.sources.helpers.IncrSourceHelper;
+
+import javax.annotation.concurrent.Immutable;
+
+import java.util.Arrays;
+
+/**
+ * Hudi Incremental Pulling Source Configs
+ */
+@Immutable
+@ConfigClassProperty(name = "Hudi Incremental Source Configs",
+groupName = ConfigGroups.Names.DELTA_STREAMER,
+subGroupName = ConfigGroups.SubGroupNames.DELTA_STREAMER_SOURCE,
+description = "Configurations controlling the behavior of incremental 
pulling from a Hudi "
++ "table as a source in Deltastreamer.")
+public class HoodieIncrSourceConfig extends HoodieConfig {
+
+  public static final ConfigProperty HOODIE_SRC_BASE_PATH = 
ConfigProperty
+  .key("hoodie.deltastreamer.source.hoodieincr.path")
+  .noDefaultValue()
+  .withDocumentation("Base-path for the source Hoodie table");

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069491


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/SqlSourceConfig.java:
##
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+
+import javax.annotation.concurrent.Immutable;
+
+/**
+ * SQL Source Configs
+ */
+@Immutable
+@ConfigClassProperty(name = "SQL Source Configs",
+groupName = ConfigGroups.Names.DELTA_STREAMER,
+subGroupName = ConfigGroups.SubGroupNames.DELTA_STREAMER_SOURCE,
+description = "Configurations controlling the behavior of SQL source in 
Deltastreamer.")
+public class SqlSourceConfig extends HoodieConfig {
+
+  public static final ConfigProperty SOURCE_SQL = ConfigProperty
+  .key("hoodie.deltastreamer.source.sql.sql.query")
+  .noDefaultValue()
+  .withDocumentation("");

Review Comment:
   Docs added.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069426


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/SqlSource.java:
##
@@ -91,6 +92,7 @@ protected Pair>, String> fetchNextBatch(
*/
   private static class Config {
 
-private static final String SOURCE_SQL = 
"hoodie.deltastreamer.source.sql.sql.query";
+@Deprecated

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069305


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/JdbcSource.java:
##
@@ -262,82 +264,89 @@ private String checkpoint(Dataset rowDataset, 
boolean isIncremental, Option
* Inner class with config keys.
*/
   protected static class Config {
-
-/**
- * {@value #URL} is the jdbc url for the Hoodie datasource.
- */
-private static final String URL = "hoodie.deltastreamer.jdbc.url";
+@Deprecated

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155069167


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/GcsEventsHoodieIncrSource.java:
##
@@ -114,19 +111,19 @@ public GcsEventsHoodieIncrSource(TypedProperties props, 
JavaSparkContext jsc, Sp
 
 this(props, jsc, spark, schemaProvider,
 new FilePathsFetcher(props, getSourceFileFormat(props)),
-new FileDataFetcher(props, props.getString(DATAFILE_FORMAT, 
DEFAULT_SOURCE_FILE_FORMAT))
+new FileDataFetcher(props, props.getString(DATAFILE_FORMAT.key(), 
SOURCE_FILE_FORMAT.defaultValue()))

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155068927


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/GCSEventsSourceConfig.java:
##
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+
+import javax.annotation.concurrent.Immutable;
+
+/**
+ * Cloud Source Configs
+ */
+@Immutable
+@ConfigClassProperty(name = "Kafka Source Configs",
+groupName = ConfigGroups.Names.DELTA_STREAMER,
+subGroupName = ConfigGroups.SubGroupNames.DELTA_STREAMER_SOURCE,
+description = "Configurations controlling the behavior of Kafka source in 
Deltastreamer.")

Review Comment:
   Fixed.



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

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



[GitHub] [hudi] yihua commented on a diff in pull request #8184: [HUDI-5780] Refactor Deltastreamer source configs to use HoodieConfig/ConfigProperty

2023-04-01 Thread via GitHub


yihua commented on code in PR #8184:
URL: https://github.com/apache/hudi/pull/8184#discussion_r1155061104


##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/GcsEventsHoodieIncrSource.java:
##
@@ -114,19 +111,19 @@ public GcsEventsHoodieIncrSource(TypedProperties props, 
JavaSparkContext jsc, Sp
 
 this(props, jsc, spark, schemaProvider,
 new FilePathsFetcher(props, getSourceFileFormat(props)),
-new FileDataFetcher(props, props.getString(DATAFILE_FORMAT, 
DEFAULT_SOURCE_FILE_FORMAT))
+new FileDataFetcher(props, props.getString(DATAFILE_FORMAT.key(), 
SOURCE_FILE_FORMAT.defaultValue()))

Review Comment:
   Set default value for `DATAFILE_FORMAT` and use it here instead?



##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/GCSEventsSourceConfig.java:
##
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+
+import javax.annotation.concurrent.Immutable;
+
+/**
+ * Cloud Source Configs
+ */
+@Immutable
+@ConfigClassProperty(name = "Kafka Source Configs",
+groupName = ConfigGroups.Names.DELTA_STREAMER,
+subGroupName = ConfigGroups.SubGroupNames.DELTA_STREAMER_SOURCE,
+description = "Configurations controlling the behavior of Kafka source in 
Deltastreamer.")

Review Comment:
   Fix the docs.



##
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/SqlSource.java:
##
@@ -91,6 +92,7 @@ protected Pair>, String> fetchNextBatch(
*/
   private static class Config {
 
-private static final String SOURCE_SQL = 
"hoodie.deltastreamer.source.sql.sql.query";
+@Deprecated

Review Comment:
   This can be removed.



##
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/HoodieIncrSourceConfig.java:
##
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.hudi.utilities.config;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+import org.apache.hudi.hive.SlashEncodedDayPartitionValueExtractor;
+import org.apache.hudi.utilities.sources.helpers.IncrSourceHelper;
+
+import javax.annotation.concurrent.Immutable;
+
+import java.util.Arrays;
+
+/**
+ * Hudi Incremental Pulling Source Configs
+ */
+@Immutable
+@ConfigClassProperty(name = "Hudi Incremental Source Configs",
+groupName = ConfigGroups.Names.DELTA_STREAMER,
+subGroupName = ConfigGroups.SubGroupNames.DELTA_STREAMER_SOURCE,
+description = "Configurations controlling the behavior of incremental 
pulling from a Hudi "
++ "table as a source in Deltastreamer.")
+public class HoodieIncrSourceConfig extends HoodieConfig {
+
+  public static final ConfigProperty HOODIE_SRC_BASE_PATH = 
ConfigProperty
+  .key("hoodie.deltastreamer.source.hoodieincr.path")
+  .noDefaultValue()
+  .withDocumentation("Base-path for the source Hoodie table");

Review Comment:
   `Hoodie` -> `Hudi`



##