@staticmethod
def merge_files(src, dst, wait=True, rm=True):
    """Merge files in HDFS.

        * src: mask of files to be merged;
        * dst: output name;
        * wait: True to wait the end of operation (default);
        * rm: Remove the input files after the merge.
        """
    import os
    import subprocess
    f_null = open(os.devnull, 'w')
    if rm:
        command = (
            'hdfs dfs -text {} | hdfs dfs -put - {} && hdfs dfs -rm -r {}'.
            format(src, dst, src))
    else:
        command = 'hdfs dfs -text {0} | hdfs dfs -put - {1}'.format(src, dst)
    if wait:
        code = subprocess.call(command, shell=True, stdout=f_null, stderr=
            subprocess.STDOUT)
    else:
        code = subprocess.Popen(command, shell=True, stdout=f_null, stderr=
            subprocess.STDOUT)
    return code == 0
