当前位置: 首页>>代码示例>>Python>>正文


Python hadoop.fully_qualify_hdfs_path函数代码示例

本文整理汇总了Python中mrjob.hadoop.fully_qualify_hdfs_path函数的典型用法代码示例。如果您正苦于以下问题:Python fully_qualify_hdfs_path函数的具体用法?Python fully_qualify_hdfs_path怎么用?Python fully_qualify_hdfs_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fully_qualify_hdfs_path函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _pick_spark_tmp_dir

 def _pick_spark_tmp_dir(self):
     if self._opts['spark_tmp_dir']:
         return self.fs.join(self._opts['spark_tmp_dir'], self._job_key)
     else:
         master = self._spark_master() or 'local'
         if master.startswith('local'):  # including local-cluster
             # need a local temp dir
             # add "-spark" so we don't collide with default local temp dir
             return os.path.join(
                 gettempdir(), self._job_key + '-spark')
         else:
             # use HDFS (same default as HadoopJobRunner)
             return posixpath.join(
                 fully_qualify_hdfs_path('tmp/mrjob'), self._job_key)
开发者ID:Yelp,项目名称:mrjob,代码行数:14,代码来源:runner.py

示例2: test_other_uri

 def test_other_uri(self):
     self.assertEqual(fully_qualify_hdfs_path('foo://bar/baz'),
                      'foo://bar/baz')
开发者ID:kartheek6,项目名称:mrjob,代码行数:3,代码来源:test_hadoop.py

示例3: test_s3n_uri

 def test_s3n_uri(self):
     self.assertEqual(fully_qualify_hdfs_path('s3n://bucket/oh/noes'),
                      's3n://bucket/oh/noes')
开发者ID:kartheek6,项目名称:mrjob,代码行数:3,代码来源:test_hadoop.py

示例4: test_hdfs_uri

 def test_hdfs_uri(self):
     self.assertEqual(fully_qualify_hdfs_path('hdfs://host/path/'),
                      'hdfs://host/path/')
开发者ID:kartheek6,项目名称:mrjob,代码行数:3,代码来源:test_hadoop.py

示例5: test_absolute_path

 def test_absolute_path(self):
     self.assertEqual(fully_qualify_hdfs_path('/path/to/cheese'),
                      'hdfs:///path/to/cheese')
开发者ID:kartheek6,项目名称:mrjob,代码行数:3,代码来源:test_hadoop.py

示例6: test_relative_path

 def test_relative_path(self):
     with patch('getpass.getuser') as getuser:
         getuser.return_value = 'dave'
         self.assertEqual(fully_qualify_hdfs_path('path/to/chocolate'),
                          'hdfs:///user/dave/path/to/chocolate')
开发者ID:kartheek6,项目名称:mrjob,代码行数:5,代码来源:test_hadoop.py

示例7: test_empty

 def test_empty(self):
     with patch('getpass.getuser') as getuser:
         getuser.return_value = 'dave'
         self.assertEqual(fully_qualify_hdfs_path(''), 'hdfs:///user/dave/')
开发者ID:kartheek6,项目名称:mrjob,代码行数:4,代码来源:test_hadoop.py

示例8: test_relative_path

 def test_relative_path(self):
     with patch("getpass.getuser") as getuser:
         getuser.return_value = "dave"
         self.assertEqual(fully_qualify_hdfs_path("path/to/chocolate"), "hdfs:///user/dave/path/to/chocolate")
开发者ID:swiftserve,项目名称:mrjob,代码行数:4,代码来源:test_hadoop.py

示例9: test_empty

 def test_empty(self):
     with patch("getpass.getuser") as getuser:
         getuser.return_value = "dave"
         self.assertEqual(fully_qualify_hdfs_path(""), "hdfs:///user/dave/")
开发者ID:swiftserve,项目名称:mrjob,代码行数:4,代码来源:test_hadoop.py


注:本文中的mrjob.hadoop.fully_qualify_hdfs_path函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。