[
https://issues.apache.org/jira/browse/BEAM-12767?focusedWorklogId=643000&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-643000
]
ASF GitHub Bot logged work on BEAM-12767:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Aug/21 20:51
Start Date: 27/Aug/21 20:51
Worklog Time Spent: 10m
Work Description: lukecwik commented on a change in pull request #15338:
URL: https://github.com/apache/beam/pull/15338#discussion_r697707454
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java
##########
@@ -1058,13 +1086,29 @@ private static void validateMethodAnnotations(
validateGettersHaveConsistentAnnotation(
methodNameToAllMethodMap, descriptors,
AnnotationPredicates.DEFAULT_VALUE);
+ // Verify that there is no getter with a mixed @JsonDeserialize annotation.
+ validateGettersHaveConsistentAnnotation(
Review comment:
Does it make sense that if `@JsonDeserialize` is on the getter then we
must also have `@JsonSerialize` and vice versa?
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java
##########
@@ -1791,6 +1984,11 @@ private static void checkEmptyStringAllowed(
private final Map<Set<Class<? extends PipelineOptions>>, Registration<?>>
combinedCache =
Maps.newConcurrentMap();
+ private final Map<Method, JsonDeserializer<Object>> deserializerCache =
Maps.newConcurrentMap();
Review comment:
We should use `Optional` here as well to prevent recomputation all the
time since computeIfAbsent will always compute again and again when null.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 643000)
Time Spent: 7.5h (was: 7h 20m)
> Improve UX of PipelineOptions parsing
> -------------------------------------
>
> Key: BEAM-12767
> URL: https://issues.apache.org/jira/browse/BEAM-12767
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Steve Niemitz
> Assignee: Steve Niemitz
> Priority: P2
> Time Spent: 7.5h
> Remaining Estimate: 0h
>
> Attempting to parse complex types in PipelineOptions can have a suboptimal
> UX. For example, if the option type being parsed is an Instant, simply
> passing in:
> {{--myInstant=2021-07-17 }}{{will fail. Instead the user must pass in
> --myInstant="2021-07-17"}}{{, however, this is complicated by the fact that
> the quotes will be stripped from the arguments in many cases, requiring a
> user to actually pass in --myInstant='"2021-07-17"'. }}
> This can be improved by attempting to parse the input twice, once as-is, and
> then trying again by automatically wrapping it in quotes.
> Additionally, it's impossible to use a custom JsonDeserializer on a pipeline
> option property. We should allow using @JsonDeserialize on the getters to
> supply a custom one.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)