You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@twill.apache.org by hsaputra <gi...@git.apache.org> on 2015/06/22 23:41:17 UTC

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

GitHub user hsaputra opened a pull request:

    https://github.com/apache/incubator-twill/pull/47

    Add more Javadoc for TwillSpecification inner classes and interfaces.

    Changes included in this PR:
    
    -) Another set of changes to add Javadoc to document public interfaces and methods.
    -) Change LocalFileAdder return values for the methods to return LocalFileAddeder instead of MoreFile which is implementation of LocalFileAdder (may need to refactor this someday).
    -) Add LocalFileAdder.apply method to make sure implementation have method that could return RunnableSetter.


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

    $ git pull https://github.com/hsaputra/incubator-twill update_javadoc_local_files

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

    https://github.com/apache/incubator-twill/pull/47.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 #47
    
----
commit f8d400ff9f384f1eedb0d8600965ff84afd45149
Author: hsaputra <hs...@apache.org>
Date:   2015-06-22T20:24:26Z

    Add more Javadoc for TwillSpecification inner classes and interfaces.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/incubator-twill/pull/47#discussion_r32994339
  
    --- Diff: twill-api/src/main/java/org/apache/twill/api/LocalFile.java ---
    @@ -45,5 +45,8 @@
       boolean isArchive();
     
       @Nullable
    +  /**
    --- End diff --
    
    Move the javadoc before method annotation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

Posted by chtyim <gi...@git.apache.org>.
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/incubator-twill/pull/47#discussion_r32994451
  
    --- Diff: twill-api/src/main/java/org/apache/twill/api/TwillSpecification.java ---
    @@ -241,29 +244,93 @@ public PlacementPolicySetter withPlacementPolicy() {
             this.completer = completer;
           }
     
    +      /**
    +       * @return instance of {@link LocalFileAdder} to add files to a runnable.
    +       */
           public LocalFileAdder withLocalFiles() {
             return new MoreFile(completer);
           }
     
    +      /**
    +       * @return instance of {@link RunnableSetter} that could be used to add runnables.
    +       */
           public RunnableSetter noLocalFiles() {
             return completer.complete(Collections.<LocalFile>emptyList());
           }
         }
     
    +    /**
    +     * Define methods to add local files to be included in a runnable.
    +     */
         public interface LocalFileAdder {
    -      MoreFile add(String name, File file);
    +      /**
    +       * Add local file to a runnable.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be added.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file);
     
    -      MoreFile add(String name, URI uri);
    +      /**
    +       * Add local file to a runnable.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri);
     
    -      MoreFile add(String name, File file, boolean archive);
    +      /**
    +       * Add local file to a runnable using {@link File}.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be included.
    +       * @param archive if it is an archive file.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file, boolean archive);
     
    -      MoreFile add(String name, URI uri, boolean archive);
    +      /**
    +       * Add local file to a runnable using {@link URI}.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @param archive if it is an archive file.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri, boolean archive);
     
    -      MoreFile add(String name, File file, String pattern);
    +      /**
    +       * Add local file to a runnable using {@link File} with filter pattern.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be added.
    +       * @param pattern the filter pattern to include the files.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file, String pattern);
     
    -      MoreFile add(String name, URI uri, String pattern);
    +      /**
    +       * Add local file to a runnable using {@link File} with filter pattern.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @param pattern the filter pattern to include the files.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri, String pattern);
    +
    +      /**
    +       * Apply the local files into an instance of {@link RunnableSetter} to add runnables with local files.
    +       * @return instance of {@link RunnableSetter} with local files.
    +       */
    +      RunnableSetter apply();
    --- End diff --
    
    It was intentionally to not have the apply() method defined in this interface so that at least one file is added before apply() can be called.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on the pull request:

    https://github.com/apache/incubator-twill/pull/47#issuecomment-114301728
  
    I will just close this one for PR to fix https://issues.apache.org/jira/browse/TWILL-54
    
    This should get rid of some public interfaces.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra closed the pull request at:

    https://github.com/apache/incubator-twill/pull/47


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-twill pull request: Add more Javadoc for TwillSpecificat...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on a diff in the pull request:

    https://github.com/apache/incubator-twill/pull/47#discussion_r32995668
  
    --- Diff: twill-api/src/main/java/org/apache/twill/api/TwillSpecification.java ---
    @@ -241,29 +244,93 @@ public PlacementPolicySetter withPlacementPolicy() {
             this.completer = completer;
           }
     
    +      /**
    +       * @return instance of {@link LocalFileAdder} to add files to a runnable.
    +       */
           public LocalFileAdder withLocalFiles() {
             return new MoreFile(completer);
           }
     
    +      /**
    +       * @return instance of {@link RunnableSetter} that could be used to add runnables.
    +       */
           public RunnableSetter noLocalFiles() {
             return completer.complete(Collections.<LocalFile>emptyList());
           }
         }
     
    +    /**
    +     * Define methods to add local files to be included in a runnable.
    +     */
         public interface LocalFileAdder {
    -      MoreFile add(String name, File file);
    +      /**
    +       * Add local file to a runnable.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be added.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file);
     
    -      MoreFile add(String name, URI uri);
    +      /**
    +       * Add local file to a runnable.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri);
     
    -      MoreFile add(String name, File file, boolean archive);
    +      /**
    +       * Add local file to a runnable using {@link File}.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be included.
    +       * @param archive if it is an archive file.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file, boolean archive);
     
    -      MoreFile add(String name, URI uri, boolean archive);
    +      /**
    +       * Add local file to a runnable using {@link URI}.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @param archive if it is an archive file.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri, boolean archive);
     
    -      MoreFile add(String name, File file, String pattern);
    +      /**
    +       * Add local file to a runnable using {@link File} with filter pattern.
    +       *
    +       * @param name name of the file for local access.
    +       * @param file the actual {@link File} to be added.
    +       * @param pattern the filter pattern to include the files.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, File file, String pattern);
     
    -      MoreFile add(String name, URI uri, String pattern);
    +      /**
    +       * Add local file to a runnable using {@link File} with filter pattern.
    +       *
    +       * @param name name of the file for local access.
    +       * @param uri the {@link URI} for the file to be added.
    +       * @param pattern the filter pattern to include the files.
    +       * @return instance of {@link LocalFileAdder}
    +       */
    +      LocalFileAdder add(String name, URI uri, String pattern);
    +
    +      /**
    +       * Apply the local files into an instance of {@link RunnableSetter} to add runnables with local files.
    +       * @return instance of {@link RunnableSetter} with local files.
    +       */
    +      RunnableSetter apply();
    --- End diff --
    
    Ah, thanks for the background lesson on how the method was intended to be used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---