Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.0
    • Component/s: Gelly
    • Labels:
      None

      Description

      Create interface for parsing command-line parameters using ParameterTool and generic implementations for boolean, long, double, string, choice.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user greghogan opened a pull request:

          https://github.com/apache/flink/pull/3433

          FLINK-5911 [gelly] Command-line parameters

          Create interface for parsing command-line parameters using ParameterTool and generic implementations for boolean, long, double, string, choice.

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

          $ git pull https://github.com/greghogan/flink 5911_command_line_parameters

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

          https://github.com/apache/flink/pull/3433.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 #3433


          commit 85565435a02b0e88dc24d0b9e8c3075ade596fef
          Author: Greg Hogan <code@greghogan.com>
          Date: 2017-02-28T17:35:07Z

          FLINK-5911 [gelly] Command-line parameters

          Create interface for parsing command-line parameters using ParameterTool
          and generic implementations for boolean, long, double, string, choice.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user greghogan opened a pull request: https://github.com/apache/flink/pull/3433 FLINK-5911 [gelly] Command-line parameters Create interface for parsing command-line parameters using ParameterTool and generic implementations for boolean, long, double, string, choice. You can merge this pull request into a Git repository by running: $ git pull https://github.com/greghogan/flink 5911_command_line_parameters Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3433.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 #3433 commit 85565435a02b0e88dc24d0b9e8c3075ade596fef Author: Greg Hogan <code@greghogan.com> Date: 2017-02-28T17:35:07Z FLINK-5911 [gelly] Command-line parameters Create interface for parsing command-line parameters using ParameterTool and generic implementations for boolean, long, double, string, choice.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user greghogan commented on the issue:

          https://github.com/apache/flink/pull/3433

          @vasia reusable parameters will make it much easier to add drivers and inputs.

          Show
          githubbot ASF GitHub Bot added a comment - Github user greghogan commented on the issue: https://github.com/apache/flink/pull/3433 @vasia reusable parameters will make it much easier to add drivers and inputs.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user vasia commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3433#discussion_r108067501

          — Diff: flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/Parameter.java —
          @@ -0,0 +1,55 @@
          +/*
          + * Licensed to the Apache Software Foundation (ASF) under one
          + * or more contributor license agreements. See the NOTICE file
          + * distributed with this work for additional information
          + * regarding copyright ownership. The ASF licenses this file
          + * to you under the Apache License, Version 2.0 (the
          + * "License"); you may not use this file except in compliance
          + * with the License. You may obtain a copy of the License at
          + *
          + * http://www.apache.org/licenses/LICENSE-2.0
          + *
          + * Unless required by applicable law or agreed to in writing, software
          + * distributed under the License is distributed on an "AS IS" BASIS,
          + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          + * See the License for the specific language governing permissions and
          + * limitations under the License.
          + */
          +
          +package org.apache.flink.graph.drivers.parameter;
          +
          +import org.apache.flink.api.java.utils.ParameterTool;
          +
          +/**
          + * Encapsulates the usage and configuration of a command-line parameter.
          + *
          + * @param <T> parameter value type
          + */
          +public interface Parameter<T> {
          +
          + /**
          + * An informal usage string. Parameter names are prefixed with "--".
          + *
          + * Optional parameters are enclosed by "[" and "]".
          + *
          + * Generic values are represented by all-caps with specific values enclosed
          + * by "<" and ">".
          + *
          + * @return command-line usage string
          + */
          + String getParameterization();
          — End diff –

          Why not `getUsage()`?

          Show
          githubbot ASF GitHub Bot added a comment - Github user vasia commented on a diff in the pull request: https://github.com/apache/flink/pull/3433#discussion_r108067501 — Diff: flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/Parameter.java — @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.graph.drivers.parameter; + +import org.apache.flink.api.java.utils.ParameterTool; + +/** + * Encapsulates the usage and configuration of a command-line parameter. + * + * @param <T> parameter value type + */ +public interface Parameter<T> { + + /** + * An informal usage string. Parameter names are prefixed with "--". + * + * Optional parameters are enclosed by " [" and "] ". + * + * Generic values are represented by all-caps with specific values enclosed + * by "<" and ">". + * + * @return command-line usage string + */ + String getParameterization(); — End diff – Why not `getUsage()`?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user greghogan commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3433#discussion_r108069363

          — Diff: flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/Parameter.java —
          @@ -0,0 +1,55 @@
          +/*
          + * Licensed to the Apache Software Foundation (ASF) under one
          + * or more contributor license agreements. See the NOTICE file
          + * distributed with this work for additional information
          + * regarding copyright ownership. The ASF licenses this file
          + * to you under the Apache License, Version 2.0 (the
          + * "License"); you may not use this file except in compliance
          + * with the License. You may obtain a copy of the License at
          + *
          + * http://www.apache.org/licenses/LICENSE-2.0
          + *
          + * Unless required by applicable law or agreed to in writing, software
          + * distributed under the License is distributed on an "AS IS" BASIS,
          + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          + * See the License for the specific language governing permissions and
          + * limitations under the License.
          + */
          +
          +package org.apache.flink.graph.drivers.parameter;
          +
          +import org.apache.flink.api.java.utils.ParameterTool;
          +
          +/**
          + * Encapsulates the usage and configuration of a command-line parameter.
          + *
          + * @param <T> parameter value type
          + */
          +public interface Parameter<T> {
          +
          + /**
          + * An informal usage string. Parameter names are prefixed with "--".
          + *
          + * Optional parameters are enclosed by "[" and "]".
          + *
          + * Generic values are represented by all-caps with specific values enclosed
          + * by "<" and ">".
          + *
          + * @return command-line usage string
          + */
          + String getParameterization();
          — End diff –

          That does sound better. Will refactor.

          Show
          githubbot ASF GitHub Bot added a comment - Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/3433#discussion_r108069363 — Diff: flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/drivers/parameter/Parameter.java — @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.graph.drivers.parameter; + +import org.apache.flink.api.java.utils.ParameterTool; + +/** + * Encapsulates the usage and configuration of a command-line parameter. + * + * @param <T> parameter value type + */ +public interface Parameter<T> { + + /** + * An informal usage string. Parameter names are prefixed with "--". + * + * Optional parameters are enclosed by " [" and "] ". + * + * Generic values are represented by all-caps with specific values enclosed + * by "<" and ">". + * + * @return command-line usage string + */ + String getParameterization(); — End diff – That does sound better. Will refactor.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/3433

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/3433
          Hide
          greghogan Greg Hogan added a comment -

          Implemented in f2a8bc92df583c0a6beb519fd8a84cb40edbd060

          Show
          greghogan Greg Hogan added a comment - Implemented in f2a8bc92df583c0a6beb519fd8a84cb40edbd060

            People

            • Assignee:
              greghogan Greg Hogan
              Reporter:
              greghogan Greg Hogan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development