Java implementation HDFS API interfaces and access Active NameNode Address

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/wangming520liwei/article/details/72772830

Java implementation HDFS API Interface

 

interface:

 

import java.util.List;

/**
 * 缓存接口
 * 
 * <pre>
 * Modify Information:
 * Author       Date        Description
 * ============ =========== ============================
 * xiaoming     2017-05-08  Create this file
 * </pre>
 * 
 */
public interface HdfsFileSystem {

    /**
     * 创建一个文件,如果已存在则返回失败
     * 
     * @param dst HDFS文件目录地址
     * @param contents 要写入文件数据
     * @return 成功返回true 如果存在返回 false
     * @throws Exception
     */
    boolean createFile(String dst, String contents) throws Exception;

    /**
     * 上传本地文件
     * 
     * @param src 源文件
     * @param dst 目标文件地址
     * 
     * @return 成功返回true 如果存在返回 false
     * @throws Exception
     */
    boolean uploadFile(String src, String dst) throws Exception;

    /**
     * 重命名文件
     * 
     * @param oldName 原文件名
     * @param newName 命名后文件名
     * @return 成功返回true 失败返回false
     * @throws Exception
     */

Guess you like

Origin blog.csdn.net/wangming520liwei/article/details/72772830