當前位置: 首頁>>代碼示例>>Python>>正文


Python conf.REMOTE_DEPLOYMENT_DIR類代碼示例

本文整理匯總了Python中liboozie.conf.REMOTE_DEPLOYMENT_DIR的典型用法代碼示例。如果您正苦於以下問題:Python REMOTE_DEPLOYMENT_DIR類的具體用法?Python REMOTE_DEPLOYMENT_DIR怎麽用?Python REMOTE_DEPLOYMENT_DIR使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了REMOTE_DEPLOYMENT_DIR類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _create_deployment_dir

    def _create_deployment_dir(self):
        """
    Return the job deployment directory in HDFS, creating it if necessary.
    The actual deployment dir should be 0711 owned by the user
    """
        # Automatic setup of the required directories if needed
        create_directories(self.fs)

        # Case of a shared job
        if self.user != self.job.document.owner:
            path = (
                REMOTE_DEPLOYMENT_DIR.get()
                .replace("$USER", self.user.username)
                .replace("$TIME", str(time.time()))
                .replace("$JOBID", str(self.job.id))
            )
            # Shared coords or bundles might not have any existing workspaces
            if self.fs.exists(self.job.deployment_dir):
                self.fs.copy_remote_dir(self.job.deployment_dir, path, owner=self.user)
            else:
                self._create_dir(path)
        else:
            path = self.job.deployment_dir
            self._create_dir(path)
        return path
開發者ID:cyc821211,項目名稱:hue,代碼行數:25,代碼來源:submission2.py

示例2: _create_deployment_dir

 def _create_deployment_dir(self):
   """
   Return the job deployment directory in HDFS, creating it if necessary.
   The actual deployment dir should be 0711 owned by the user
   """
   if self.user != self.job.owner:
     path = Hdfs.join(REMOTE_DEPLOYMENT_DIR.get(), '_%s_-oozie-%s-%s' % (self.user.username, self.job.id, time.time()))
     self.fs.copy_remote_dir(self.job.deployment_dir, path, owner=self.user, dir_mode=0711)
   else:
     path = self.job.deployment_dir
     self._create_dir(path)
   return path
開發者ID:lalaguozhe,項目名稱:hue,代碼行數:12,代碼來源:submittion.py

示例3: create_directories

def create_directories(fs, directory_list=[]):
  # If needed, create the remote home, deployment and data directories
  directories = [REMOTE_DEPLOYMENT_DIR.get()] + directory_list

  for directory in directories:
    if not fs.do_as_user(fs.DEFAULT_USER, fs.exists, directory):
      remote_home_dir = Hdfs.join('/user', fs.DEFAULT_USER)
      if directory.startswith(remote_home_dir):
        # Home is 755
        fs.do_as_user(fs.DEFAULT_USER, fs.create_home_dir, remote_home_dir)
      # Shared by all the users
      fs.do_as_user(fs.DEFAULT_USER, fs.mkdir, directory, 01777)
      fs.do_as_user(fs.DEFAULT_USER, fs.chmod, directory, 01777) # To remove after https://issues.apache.org/jira/browse/HDFS-3491
開發者ID:neiodavince,項目名稱:hue,代碼行數:13,代碼來源:submission2.py

示例4: create_directories

def create_directories(fs):
  # If needed, create the remote home, deployment and data directories
  directories = (REMOTE_DEPLOYMENT_DIR.get(), REMOTE_SAMPLE_DIR.get())

  for directory in directories:
    if not fs.do_as_user("hdfs", fs.exists, directory):
      remote_home_dir = Hdfs.join('/user', "hdfs")
      if directory.startswith(remote_home_dir):
        # Home is 755
        fs.do_as_user("hdfs", fs.create_home_dir, remote_home_dir)
      # Shared by all the users
      fs.do_as_user("hdfs", fs.mkdir, directory, 511)
      fs.do_as_user("hdfs", fs.chmod, directory, 511) # To remove after https://issues.apache.org/jira/browse/HDFS-3491

  return REMOTE_SAMPLE_DIR.get()
開發者ID:DatalakeInc,項目名稱:hortonworks-sandbox,代碼行數:15,代碼來源:oozie_setup.py

示例5: _create_deployment_dir

  def _create_deployment_dir(self):
    """
    Return the job deployment directory in HDFS, creating it if necessary.
    The actual deployment dir should be 0711 owned by the user
    """
    # Automatic setup of the required directories if needed
    create_directories(self.fs)

    # Case of a shared job
    if self.user != self.job.owner:
      path = Hdfs.join(REMOTE_DEPLOYMENT_DIR.get(), '_%s_-oozie-%s-%s' % (self.user.username, self.job.id, time.time()))
      # Shared coords or bundles might not have any existing workspaces
      if self.fs.exists(self.job.deployment_dir):
        self.fs.copy_remote_dir(self.job.deployment_dir, path, owner=self.user, dir_mode=0711)
      else:
        self._create_dir(path)
    else:
      path = self.job.deployment_dir
      self._create_dir(path)
    return path
開發者ID:hungwaa,項目名稱:hue,代碼行數:20,代碼來源:submittion.py


注:本文中的liboozie.conf.REMOTE_DEPLOYMENT_DIR類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。