当前位置: 首页>>代码示例>>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;未经允许,请勿转载。