Exemple #1
0
def add_arguments(parser):
  """ add arguments """
  default_config_file = os.path.join(
      utils.get_heron_tracker_conf_dir(), constants.DEFAULT_CONFIG_FILE)

  parser.add_argument(
      '--config-file',
      metavar='(a string; path to config file; default: "' + default_config_file + '")',
      default=default_config_file)

  parser.add_argument(
      '--type',
      metavar='(an string; type of state manager (zookeeper or file, etc.); example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_TYPE) + ')',
      choices=["file", "zookeeper"])

  parser.add_argument(
      '--name',
      metavar='(an string; name to be used for the state manager; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_NAME) + ')')

  parser.add_argument(
      '--rootpath',
      metavar='(an string; where all the states are stored; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_ROOTPATH) + ')')

  parser.add_argument(
      '--tunnelhost',
      metavar='(an string; if ssh tunneling needs to be established to connect to it; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_TUNNELHOST) + ')')

  parser.add_argument(
      '--hostport',
      metavar='(an string; only used to connect to zk, must be of the form \'host:port\';'\
      ' example: ' + str(constants.DEFAULT_STATE_MANAGER_HOSTPORT) + ')')

  parser.add_argument(
      '--port',
      metavar='(an integer; port to listen; default: ' + str(constants.DEFAULT_PORT) + ')',
      type=int,
      default=constants.DEFAULT_PORT)

  parser.add_argument(
      '--verbose',
      action='store_true')

  return parser
Exemple #2
0
def add_arguments(parser):
  """ add arguments """
  default_config_file = os.path.join(
      utils.get_heron_tracker_conf_dir(), constants.DEFAULT_CONFIG_FILE)

  parser.add_argument(
      '--config-file',
      metavar='(a string; path to config file; default: "' + default_config_file + '")',
      default=default_config_file)

  parser.add_argument(
      '--type',
      metavar='(an string; type of state manager (zookeeper or file, etc.); example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_TYPE) + ')',
      choices=["file", "zookeeper"])

  parser.add_argument(
      '--name',
      metavar='(an string; name to be used for the state manager; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_NAME) + ')')

  parser.add_argument(
      '--rootpath',
      metavar='(an string; where all the states are stored; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_ROOTPATH) + ')')

  parser.add_argument(
      '--tunnelhost',
      metavar='(an string; if ssh tunneling needs to be established to connect to it; example: ' \
        + str(constants.DEFAULT_STATE_MANAGER_TUNNELHOST) + ')')

  parser.add_argument(
      '--hostport',
      metavar='(an string; only used to connect to zk, must be of the form \'host:port\';'\
      ' example: ' + str(constants.DEFAULT_STATE_MANAGER_HOSTPORT) + ')')

  parser.add_argument(
      '--port',
      metavar='(an integer; port to listen; default: ' + str(constants.DEFAULT_PORT) + ')',
      type=int,
      default=constants.DEFAULT_PORT)

  parser.add_argument(
      '--verbose',
      action='store_true')

  return parser
Exemple #3
0
def add_arguments(parser):
    """ add arguments """
    default_config_file = os.path.join(utils.get_heron_tracker_conf_dir(),
                                       constants.DEFAULT_CONFIG_FILE)

    parser.add_argument('--config-file',
                        metavar='(a string; path to config file; default: "' +
                        default_config_file + '")',
                        default=default_config_file)

    parser.add_argument('--port',
                        metavar='(an integer; port to listen; default: ' +
                        str(constants.DEFAULT_PORT) + ')',
                        type=int,
                        default=constants.DEFAULT_PORT)

    parser.add_argument('--verbose', action='store_true')

    return parser
Exemple #4
0
def add_arguments(parser):
  """ add arguments """
  default_config_file = os.path.join(
      utils.get_heron_tracker_conf_dir(), constants.DEFAULT_CONFIG_FILE)

  parser.add_argument(
      '--config-file',
      metavar='(a string; path to config file; default: "' + default_config_file + '")',
      default=default_config_file)

  parser.add_argument(
      '--port',
      metavar='(an integer; port to listen; default: ' + str(constants.DEFAULT_PORT) + ')',
      type=int,
      default=constants.DEFAULT_PORT)

  parser.add_argument(
      '--verbose',
      action='store_true')

  return parser
Exemple #5
0
        sys.exit(0)


@click.command()
@click.option(
    "--version",
    is_flag=True,
    is_eager=True,
    expose_value=False,
    callback=show_version,
)
@click.option('--verbose', is_flag=True)
@click.option(
    '--config-file',
    help="path to a tracker config file",
    default=os.path.join(utils.get_heron_tracker_conf_dir(),
                         constants.DEFAULT_CONFIG_FILE),
    show_default=True,
)
@click.option(
    '--port',
    type=int,
    default=constants.DEFAULT_PORT,
    show_default=True,
    help="local port to serve on",
)
@click.option(
    '--type',
    "stmgr_type",
    help=f"statemanager type e.g. {constants.DEFAULT_STATE_MANAGER_TYPE}",
    type=click.Choice(choices=["file", "zookeeper"]),
Exemple #6
0
    sys.exit(0)


@click.command()
@click.option(
    "--version",
    is_flag=True,
    is_eager=True,
    expose_value=False,
    callback=show_version,
)
@click.option('--verbose', is_flag=True)
@click.option(
    '--config-file',
    help="path to a tracker config file",
    default=os.path.join(utils.get_heron_tracker_conf_dir(), constants.DEFAULT_CONFIG_FILE),
    show_default=True,
)
@click.option(
    '--port',
    type=int,
    default=constants.DEFAULT_PORT,
    show_default=True,
    help="local port to serve on",
)
@click.option(
    '--type',
    "stmgr_type",
    help=f"statemanager type e.g. {constants.DEFAULT_STATE_MANAGER_TYPE}",
    type=click.Choice(choices=["file", "zookeeper"]),
)