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

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

                Author: ASF GitHub Bot
            Created on: 24/Oct/18 08:59
            Start Date: 24/Oct/18 08:59
    Worklog Time Spent: 10m 
      Work Description: echauchot commented on a change in pull request #6780: 
[BEAM-5817] Use an explicit enum for naming Nexmark benchmarks
URL: https://github.com/apache/beam/pull/6780#discussion_r227686089
 
 

 ##########
 File path: 
sdks/java/nexmark/src/main/java/org/apache/beam/sdk/nexmark/NexmarkLauncher.java
 ##########
 @@ -1294,76 +1295,75 @@ private boolean isSql() {
   }
 
   private NexmarkQueryModel getNexmarkQueryModel() {
-    List<NexmarkQueryModel> models = createQueryModels();
+    Map<NexmarkQueryName, NexmarkQueryModel> models = createQueryModels();
     return models.get(configuration.query);
   }
 
   private NexmarkQuery getNexmarkQuery() {
-    List<NexmarkQuery> queries = createQueries();
-
-    if (configuration.query >= queries.size()) {
-      return null;
-    }
-
+    Map<NexmarkQueryName, NexmarkQuery> queries = createQueries();
     return queries.get(configuration.query);
   }
 
-  private List<NexmarkQueryModel> createQueryModels() {
+  private Map<NexmarkQueryName, NexmarkQueryModel> createQueryModels() {
     return isSql() ? createSqlQueryModels() : createJavaQueryModels();
   }
 
-  private List<NexmarkQueryModel> createSqlQueryModels() {
-    return Arrays.asList(null, null, null, null, null, null, null, null, null, 
null, null, null);
+  private Map<NexmarkQueryName, NexmarkQueryModel> createSqlQueryModels() {
+    return ImmutableMap.of();
   }
 
-  private List<NexmarkQueryModel> createJavaQueryModels() {
-    return Arrays.asList(
-        new Query0Model(configuration),
-        new Query1Model(configuration),
-        new Query2Model(configuration),
-        new Query3Model(configuration),
-        new Query4Model(configuration),
-        new Query5Model(configuration),
-        new Query6Model(configuration),
-        new Query7Model(configuration),
-        new Query8Model(configuration),
-        new Query9Model(configuration),
-        null,
-        null,
-        null);
+  private Map<NexmarkQueryName, NexmarkQueryModel> createJavaQueryModels() {
+    return ImmutableMap.<NexmarkQueryName, NexmarkQueryModel>builder()
+        .put(NexmarkQueryName.ZERO, new Query0Model(configuration))
+        .put(NexmarkQueryName.ONE, new Query1Model(configuration))
+        .put(NexmarkQueryName.TWO, new Query2Model(configuration))
+        .put(NexmarkQueryName.THREE, new Query3Model(configuration))
+        .put(NexmarkQueryName.FOUR, new Query4Model(configuration))
+        .put(NexmarkQueryName.FIVE, new Query5Model(configuration))
+        .put(NexmarkQueryName.SIX, new Query6Model(configuration))
+        .put(NexmarkQueryName.SEVEN, new Query7Model(configuration))
+        .put(NexmarkQueryName.EIGHT, new Query8Model(configuration))
+        .put(NexmarkQueryName.NINE, new Query9Model(configuration))
+        .build();
 
 Review comment:
   A lot better than the list indeed ! Using a list with null values seemed 
weak and error prone.

----------------------------------------------------------------
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: 158034)
    Time Spent: 1h 20m  (was: 1h 10m)

> Nexmark test of joining stream to files
> ---------------------------------------
>
>                 Key: BEAM-5817
>                 URL: https://issues.apache.org/jira/browse/BEAM-5817
>             Project: Beam
>          Issue Type: New Feature
>          Components: examples-nexmark
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Nexmark is a convenient framework for testing the use case of large scale 
> stream enrichment. One way is joining a stream to files, and it can be tested 
> via any source that Nexmark supports.



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

Reply via email to