示例#1
0
 def setUp(self):
     self.hadoop_version = "0.20.2"
     self.hadoop_version_tuple = (0, 20, 2)
     self.hadoop_home = tempfile.mkdtemp(prefix="pydoop_test_")
     self.hadoop_conf = os.path.join(self.hadoop_home, "conf")
     os.mkdir(self.hadoop_conf)
     self.bindir = os.path.join(self.hadoop_home, "bin")
     os.mkdir(self.bindir)
     self.hadoop_exe = os.path.join(self.bindir, "hadoop")
     with open(self.hadoop_exe, "w") as fo:
         fd = fo.fileno()
         os.fchmod(fd, os.fstat(fd).st_mode | stat.S_IXUSR)
         fo.write("#!/bin/bash\necho Hadoop %s\n" % self.hadoop_version)
     self.orig_env = os.environ.copy()
     self.pf = hu.PathFinder()
示例#2
0
文件: __init__.py 项目: xuande/pydoop
Pydoop is a Python interface to Hadoop that allows you to write
MapReduce applications and interact with HDFS in pure Python.
"""

import os
import errno
import ConfigParser
from importlib import import_module
import pydoop.hadoop_utils as hu

try:
    from pydoop.config import DEFAULT_HADOOP_HOME
    from pydoop.version import version as __version__
except ImportError:  # should only happen at compile time
    DEFAULT_HADOOP_HOME = __version__ = None
_PATH_FINDER = hu.PathFinder()
_HADOOP_INFO = _PATH_FINDER.find()  # fill the cache ASAP

__author__ = ", ".join((
    "Simone Leo",
    "Gianluigi Zanetti",
    "Luca Pireddu",
    "Francesco Cabras",
    "Mauro Del Rio",
    "Marco Enrico Piras",
))
__author_email__ = ", ".join((
    "<*****@*****.**>",
    "<*****@*****.**>",
    "<*****@*****.**>",
    "<*****@*****.**>",