Esempio n. 1
0
 def __start_segment(self):
     import params
     return utils.exec_hawq_operation(
         hawqconstants.START,
         "{0} -a".format(hawqconstants.SEGMENT),
         not_if=utils.chk_hawq_process_status_cmd(
             params.hawq_segment_address_port))
Esempio n. 2
0
    def stop(self, env):
        import params

        utils.exec_hawq_operation(hawqconstants.STOP,
                                  "{0} -a".format(hawqconstants.SEGMENT),
                                  only_if=utils.chk_hawq_process_status_cmd(
                                      params.hawq_segment_address_port))
Esempio n. 3
0
 def stop(self, env, mode=hawq_constants.FAST):
     import params
     utils.exec_hawq_operation(hawq_constants.STOP,
                               "{0} -M {1} -a -v".format(
                                   hawq_constants.SEGMENT, mode),
                               only_if=utils.chk_hawq_process_status_cmd(
                                   params.hawq_segment_address_port))
Esempio n. 4
0
def stop_component(component_name, port, mode):
    """
  Stops the component
  """
    utils.exec_hawq_operation(hawq_constants.STOP,
                              "{0} -M {1} -a -v".format(component_name, mode),
                              only_if=utils.chk_hawq_process_status_cmd(
                                  port, component_name))
Esempio n. 5
0
def stop(mode=hawq_constants.FAST, component=None):
  """
  Stops the HAWQ Master/Standby, if component is cluster performs cluster level operation from master
  """
  import params
  component_name = component if component else __get_component_name()
  utils.exec_hawq_operation(
                hawq_constants.STOP,
                "{0} -M {1} -a -v".format(component_name, mode),
                only_if=utils.chk_hawq_process_status_cmd(params.hawq_master_address_port, component_name))
Esempio n. 6
0
def stop_master():
    """
  Stops the HAWQ Master/Standby
  """
    import params
    component_name = __get_component_name()
    utils.exec_hawq_operation(hawqconstants.STOP,
                              "{0} -a".format(component_name),
                              only_if=utils.chk_hawq_process_status_cmd(
                                  params.hawq_master_address_port,
                                  component_name))
Esempio n. 7
0
def __start_local_master():
    """
  Starts HAWQ Master or HAWQ Standby Master component on the host
  """
    import params
    component_name = __get_component_name()
    utils.exec_hawq_operation(hawqconstants.START,
                              "{0} -a".format(component_name),
                              not_if=utils.chk_hawq_process_status_cmd(
                                  params.hawq_master_address_port,
                                  component_name))
Esempio n. 8
0
def start_component(component_name, port, data_dir):
    """
  If data directory exists start the component, else initialize the component
  """
    __check_dfs_truncate_enforced()
    if os.path.exists(
            os.path.join(data_dir, hawq_constants.postmaster_opts_filename)):
        return utils.exec_hawq_operation(
            hawq_constants.START,
            "{0} -a -v".format(component_name),
            not_if=utils.chk_hawq_process_status_cmd(port))
    __init_component(component_name)
Esempio n. 9
0
def __start_local_master():
  """
  Starts HAWQ Master or HAWQ Standby Master component on the host
  """
  import params
  component_name = __get_component_name()

  __setup_hdfs_dirs()

  utils.exec_hawq_operation(
        hawq_constants.START,
        "{0} -a -v".format(component_name),
        not_if=utils.chk_hawq_process_status_cmd(params.hawq_master_address_port, component_name))
  Logger.info("Master {0} started".format(params.hostname))
Esempio n. 10
0
 def stop(self, env, mode=hawq_constants.FAST):
   import params
   utils.exec_hawq_operation(hawq_constants.STOP, "{0} -M {1} -a -v".format(hawq_constants.SEGMENT, mode), only_if=utils.chk_hawq_process_status_cmd(
                               params.hawq_segment_address_port))
Esempio n. 11
0
 def __start_segment(self):
   import params
   return utils.exec_hawq_operation(
         hawq_constants.START, 
         "{0} -a -v".format(hawq_constants.SEGMENT), 
         not_if=utils.chk_hawq_process_status_cmd(params.hawq_segment_address_port))