Exemplo n.º 1
0
def submit_tar(cl_args, unknown_args, tmp_dir):
    '''
  Extract and execute the java files inside the tar and then add topology
  definition file created by running submitTopology

  We use the packer to make a package for the tar and dump it
  to a well-known location. We then run the main method of class
  with the specified arguments. We pass arguments as heron.options.
  This will run the jar file with the topology class name.

  The submitter inside will write out the topology defn file to a location
  that we specify. Then we write the topology defn file to a well known
  packer location. We then write to appropriate places in zookeeper
  and launch the aurora jobs
  :param cl_args:
  :param unknown_args:
  :param tmp_dir:
  :return:
  '''
    # execute main of the topology to create the topology definition
    topology_file = cl_args['topology-file-name']
    java_defines = cl_args['topology_main_jvm_property']
    execute.heron_tar(cl_args['topology-class-name'], topology_file,
                      tuple(unknown_args), tmp_dir, java_defines)

    try:
        launch_topologies(cl_args, topology_file, tmp_dir)

    except Exception:
        return False

    finally:
        shutil.rmtree(tmp_dir)

    return True
Exemplo n.º 2
0
def submit_tar(cl_args, unknown_args, tmp_dir):

  # execute main of the topology to create the topology definition
  topology_file = cl_args['topology-file-name']
  execute.heron_tar(
      cl_args['topology-class-name'],
      topology_file,
      tuple(unknown_args),
      tmp_dir,
      cl_args['javaDefines'])

  try:
    launch_topologies(cl_args, topology_file, tmp_dir)

  except Exception as ex:
    return False

  finally:
    shutil.rmtree(tmp_dir)

  return True
Exemplo n.º 3
0
def submit_tar(cl_args, unknown_args, tmp_dir):
  '''
  Extract and execute the java files inside the tar and then add topology
  definition file created by running submitTopology

  We use the packer to make a package for the tar and dump it
  to a well-known location. We then run the main method of class
  with the specified arguments. We pass arguments as heron.options.
  This will run the jar file with the topology class name.

  The submitter inside will write out the topology defn file to a location
  that we specify. Then we write the topology defn file to a well known
  packer location. We then write to appropriate places in zookeeper
  and launch the aurora jobs
  :param cl_args:
  :param unknown_args:
  :param tmp_dir:
  :return:
  '''
  # execute main of the topology to create the topology definition
  topology_file = cl_args['topology-file-name']
  java_defines = cl_args['topology_main_jvm_property']
  execute.heron_tar(
      cl_args['topology-class-name'],
      topology_file,
      tuple(unknown_args),
      tmp_dir,
      java_defines)

  try:
    launch_topologies(cl_args, topology_file, tmp_dir)

  except Exception:
    return False

  finally:
    shutil.rmtree(tmp_dir)

  return True