
    1                         S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  SSKJ
r
  SSKJ
r  SS	KJr  \
R                   " S
 S\R                   5      5       rg)zBase class for PySpark Job.    )absolute_import)division)unicode_literalsN)encoding)arg_parsers)base)utilc                   H    \ rS rSrSr\S 5       r\S 5       r\S 5       rSr	g)PyFlinkBase    z"Submit a PyFlink job to a cluster.c                 v   U R                  SSS9  U R                  SSS9  U R                  S[        R                  " 5       S/ SS	9  U R                  S
SS9  U R                  SSS9  U R                  S[        R                  " 5       S/ SS	9  U R                  S[        R                  " 5       S/ SS	9  U R                  S[        R                  SS9  U R                  S[        R
                  " 5       SSS9  U R                  S[        R                  S9  U R                  S[        R
                  " 5       SSS9  g) z;Performs command-line argument parsing specific to PyFlink.py_filez!HCFS URI of the main Python file.)helpz--savepointz?HCFS URI of the savepoint that contains the saved job progress.z
--py-filesPY_FILEzComma-separated list of custom Python files to provide to the job. Supports standard resource file suffixes, such as .py, .egg, .zip and .whl. This also supports passing a directory.)typemetavardefaultr   z--py-requirementszA requirements.txt file that defines third-party dependencies. These dependencies are installed and added to the PYTHONPATH of the python UDF worker.z--py-modulezRPython module with program entry point. This option should be used with --pyFiles.z--jarsJARzLComma-separated list of jar files to provide to the task manager classpaths.z
--archivesARCHIVEzComma-separated list of archives to be extracted into the working directory of the python UDF worker. Must be one of the following file formats: .zip, .tar, .tar.gz, or .tgz.job_argszThe job arguments to pass.)nargsr   z--propertieszPROPERTY=VALUEzList of key=value pairs to configure PyFlink. For a list of available properties, see: https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/config/)r   r   r   z--properties-filez--driver-log-levelszPACKAGE=LEVELzList of key=value pairs to configure driver logging, where the key is a package and the value is the log4j log level. For example: root=FATAL,com.example=INFO.N)add_argumentr   ArgListargparse	REMAINDERArgDictjob_utilPROPERTIES_FILE_HELP_TEXT)parsers    7lib/googlecloudsdk/command_lib/dataproc/jobs/pyflink.pyArgsPyFlinkBase.Args$   s    ;   N     "Q  
 &        "'  	   ":  
   )  
   " [  	 ("D"D     "4  	    c                 v    U R                   U R                  U R                  U R                  U R                  S.$ )Nr   py_filesarchivespy_requirementsjarsr%   )argss    r    GetFilesByTypePyFlinkBase.GetFilesByType{   s3     <<MMMM//		 r#   c                 j   U R                  UR                  =(       d    / US   US   US   US   UR                  US   UUR                  S9	n[        R
                  " UR                  UR                  5      nU(       a.  [        R                  " X`R                   R                  SS9Ul        XQl        g	)
z1Populates the pyflinkJob member of the given job.r'   r&   r)   r(   r   )	r*   archiveUrispythonFileUrisjarFileUrispythonRequirementspythonModulemainPythonFileUriloggingConfigsavepointUriT)
sort_itemsN)
PyFlinkJobr   	py_module	savepointr   BuildJobProperties
propertiesproperties_filer   DictToAdditionalPropertyMessagePropertiesValue
pyflinkJob)messagesjobfiles_by_typelogging_configr*   pyflink_jobjob_propertiess          r    ConfigureJobPyFlinkBase.ConfigureJob   s     %%]] b!*-$Z0!&)():;^^'	2$^^ & 
K 00--N 'GG
--==$ k !Nr#    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr!   r+   rF   __static_attributes__rH   r#   r    r   r       sB    *T Tl   ! !r#   r   )rM   
__future__r   r   r   r   apitools.base.pyr   googlecloudsdk.callioper   r   (googlecloudsdk.command_lib.dataproc.jobsjob_baser	   r   HiddenJobBaser   rH   r#   r    <module>rW      sM     " &  '  % / ( E E }!("" }! }!r#   