[ 
https://issues.apache.org/jira/browse/BEAM-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646738#comment-15646738
 ] 

ASF GitHub Bot commented on BEAM-941:
-------------------------------------

GitHub user kennknowles opened a pull request:

    https://github.com/apache/incubator-beam/pull/1309

    [BEAM-941] Refactor DoFnSignatures & DoFnInvokers for clarity; removes 
public INSTANCE

    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [x] Make sure the PR title is formatted like:
       `[BEAM-<Jira issue #>] Description of pull request`
     - [x] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [x] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [x] If this contribution is large, please file an Apache
           [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---
    
    R: @tgroh 
    
    As you requested for a followup on the `OnTimerInvoker` PR. The two commits 
are independent but both address the same issue. This is an operation no-op 
(unless something went wrong).
    
     - For `DoFnSignatures` I decided there was only likely to ever be one 
canonical way to create a `DoFnSignature, so it was merely a matter of changes 
one or two non-`static` methods to `static`.
     - For the invokers, it is very easy to imagine experiments with different 
kinds of invokers, so I made the factory interfaces explicit, as you suggested.
    
    BEAM-941 has a couple more longstanding occurrences that I did not address 
here:
    
    ```
    $ find . -name '*.java' | xargs grep 'public.*INSTANCE'
    
./sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/GlobalWindow.java:
  public static final GlobalWindow INSTANCE = new GlobalWindow();
    
./sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/GlobalWindow.java:
    public static final Coder INSTANCE = new Coder();
    
./sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/PaneInfo.java:
    public static final PaneInfoCoder INSTANCE = new PaneInfoCoder();
    
./sdks/java/core/src/test/java/org/apache/beam/sdk/testing/SystemNanoTimeSleeper.java:
  public static final Sleeper INSTANCE = new SystemNanoTimeSleeper();
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kennknowles/incubator-beam INSTANCE

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/1309.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1309
    
----
commit 8cd4ec84b9350e1aa6ba35010fc134adc0d7606f
Author: Kenneth Knowles <[email protected]>
Date:   2016-11-08T06:36:09Z

    Remove DoFnSignatures.INSTANCE

commit 6484bf7b1ceea7d9bcf32fa56c7539dbb06cae55
Author: Kenneth Knowles <[email protected]>
Date:   2016-11-08T07:03:46Z

    Remove INSTANCE from DoFnInvokers and OnTimerInvokers

----


> Replace Xyz.INSTANCE throughout the SDK with either static methods or 
> XyzFactory.default()
> ------------------------------------------------------------------------------------------
>
>                 Key: BEAM-941
>                 URL: https://issues.apache.org/jira/browse/BEAM-941
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Kenneth Knowles
>            Priority: Trivial
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to