[
https://issues.apache.org/jira/browse/BEAM-3925?focusedWorklogId=95646&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-95646
]
ASF GitHub Bot logged work on BEAM-3925:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Apr/18 17:22
Start Date: 26/Apr/18 17:22
Worklog Time Spent: 10m
Work Description: pupamanyu commented on a change in pull request #5141:
[BEAM-3925] Allow ValueProvider for KafkaIO so that we can create Beam
Templates using KafkaIO
URL: https://github.com/apache/beam/pull/5141#discussion_r184468679
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/options/ValueProviders.java
##########
@@ -55,4 +60,33 @@ public static String updateSerializedOptions(
throw new RuntimeException("Unable to parse re-serialize options", e);
}
}
+ /**
+ * Used to build a {@link ValueProvider} for {@link List List<String>}.
+ */
+ @SuppressWarnings("unchecked")
+ public static ValueProvider<List<String>>
commaSeparatedStrings(ValueProvider<String> csv) {
+ return ValueProvider.NestedValueProvider.of(csv, new CsvTranslator());
+ }
+
+ /**
+ * Used to build a {@link ValueProvider} for {@link List List<String>}.
+ */
+ private static class CsvTranslator implements SerializableFunction<String,
List<String>> {
+ @Override
+ public List<String> apply(String csv) {
+ return ImmutableList.copyOf(
+ Splitter.on(',').trimResults().omitEmptyStrings().splitToList(csv));
+ }
+ }
+
+ public static Class classForName(String className) {
+ Class clazz;
+ try {
+ clazz = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Please check for the existence of the
KeySerializer Class",
Review comment:
I will change the message to "Please check for the existence of the Class"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 95646)
Time Spent: 4h 20m (was: 4h 10m)
> Allow ValueProvider for KafkaIO
> -------------------------------
>
> Key: BEAM-3925
> URL: https://issues.apache.org/jira/browse/BEAM-3925
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Sameer Abhyankar
> Assignee: Pramod Upamanyu
> Priority: Major
> Time Spent: 4h 20m
> Remaining Estimate: 0h
>
> Add ValueProvider support for the various methods in KafkaIO. This would
> allow us to use KafkaIO in reusable pipeline templates.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)