def run_class(class_name, args=None, properties=None, classpath=None,<EOL>hadoop_conf_dir=None, logger=None, keep_streams=True):
if logger is None:<EOL><INDENT>logger = utils.NullLogger()<EOL><DEDENT>old_classpath = None<EOL>if classpath:<EOL><INDENT>old_classpath = os.getenv('<STR_LIT>', '<STR_LIT>')<EOL>if isinstance(classpath, basestring):<EOL><INDENT>classpath = [classpath]<EOL><DEDENT>os.environ['<STR_LIT>'] = "<STR_LIT::>".join(<EOL>classpath + old_classpath.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>)<EOL>logger.debug('<STR_LIT>', os.getenv('<STR_LIT>'))<EOL><DEDENT>try:<EOL><INDENT>res = run_cmd(class_name, args, properties,<EOL>hadoop_conf_dir=hadoop_conf_dir, logger=logger,<EOL>keep_streams=keep_streams)<EOL><DEDENT>finally:<EOL><INDENT>if old_classpath is not None:<EOL><INDENT>os.environ['<STR_LIT>'] = old_classpath<EOL><DEDENT><DEDENT>return res<EOL>
Run a Java class with Hadoop (equivalent of running ``hadoop
<class_name>`` from the command line).

Additional ``HADOOP_CLASSPATH`` elements can be provided via
``classpath`` (either as a non-string sequence where each element
is a classpath element or as a ``':'``-separated string).  Other
arguments are passed to :func:`run_cmd`.

.. code-block:: python

  >>> cls = 'org.apache.hadoop.fs.FsShell'
  >>> try: out = run_class(cls, args=['-test', '-e', 'file:/tmp'])
  ... except RunCmdError: tmp_exists = False
  ... else: tmp_exists = True

.. note::

  ``HADOOP_CLASSPATH`` makes dependencies available **only on the
  client side**.  If you are running a MapReduce application, use
  ``args=['-libjars', 'jar1,jar2,...']`` to make them available to
  the server side as well.