[ 
https://issues.apache.org/jira/browse/BEAM-5442?focusedWorklogId=189567&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-189567
 ]

ASF GitHub Bot logged work on BEAM-5442:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jan/19 17:18
            Start Date: 24/Jan/19 17:18
    Worklog Time Spent: 10m 
      Work Description: tweise commented on pull request #7597: [WIP] 
[BEAM-5442] Retrieve valid runner options from JobService
URL: https://github.com/apache/beam/pull/7597#discussion_r250700811
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java
 ##########
 @@ -630,6 +634,55 @@ public static void printHelp(PrintStream out, Class<? 
extends PipelineOptions> i
     }
   }
 
+  public static Map<String, PipelineOptionDescriptor> describe(Set<Class<? 
extends PipelineOptions>> ifaces) {
+    checkNotNull(ifaces);
+    Map<String, PipelineOptionDescriptor> result = new HashMap<>();
+
+    for (Class<? extends PipelineOptions> iface : ifaces) {
+      CACHE.get().validateWellFormed(iface);
+
+      Set<PipelineOptionSpec> properties = 
PipelineOptionsReflector.getOptionSpecs(iface);
+
+      RowSortedTable<Class<?>, String, Method> ifacePropGetterTable =
+              TreeBasedTable.create(ClassNameComparator.INSTANCE, 
Ordering.natural());
+      for (PipelineOptionSpec prop : properties) {
+        ifacePropGetterTable.put(prop.getDefiningInterface(), prop.getName(), 
prop.getGetterMethod());
+      }
+
+      for (Map.Entry<Class<?>, Map<String, Method>> ifaceToPropertyMap :
+              ifacePropGetterTable.rowMap().entrySet()) {
+        Class<?> currentIface = ifaceToPropertyMap.getKey();
+        Map<String, Method> propertyNamesToGetters = 
ifaceToPropertyMap.getValue();
+
+        List<String> lists = 
Lists.newArrayList(propertyNamesToGetters.keySet());
+        lists.sort(String.CASE_INSENSITIVE_ORDER);
+        for (String propertyName : lists) {
+          Method method = propertyNamesToGetters.get(propertyName);
+          // TODO: type representation
+          String printableType = method.getReturnType().getSimpleName();
 
 Review comment:
   @robertwb @mxm any thoughts on how we want to specify the option type in a 
language agnostic way?
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 189567)
    Time Spent: 16h 20m  (was: 16h 10m)

> PortableRunner swallows custom options for Runner
> -------------------------------------------------
>
>                 Key: BEAM-5442
>                 URL: https://issues.apache.org/jira/browse/BEAM-5442
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core, sdk-py-core
>            Reporter: Maximilian Michels
>            Assignee: Thomas Weise
>            Priority: Major
>              Labels: portability, portability-flink
>          Time Spent: 16h 20m
>  Remaining Estimate: 0h
>
> The PortableRunner doesn't pass custom PipelineOptions to the executing 
> Runner.
> Example: {{--parallelism=4}} won't be forwarded to the FlinkRunner.
> (The option is just removed during proto translation without any warning)
> We should allow some form of customization through the options, even for the 
> PortableRunner. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to