Exemplo n.º 1
0
HdfsFile::~HdfsFile() {
    if(f_) {
        webhdfs_file_close(f_);
    }
    /* Disconnect from WebHDFS */
    if(fs_) {
        webhdfs_disconnect(fs_);
    }
    if(conf_) {
        webhdfs_conf_free(conf_);
    }
}
Exemplo n.º 2
0
int main (int argc, char **argv) {
    webhdfs_conf_t *conf;
    webhdfs_t *fs;

    /* Setup webhdfs config */
    conf = webhdfs_conf_alloc();
    webhdfs_conf_set_server(conf, "localhost", 50007, 0);
    webhdfs_conf_set_user(conf, "th30z");

    /* Connect to WebHDFS */
    fs = webhdfs_connect(conf);

    webhdfs_mkdir(fs, "/test", 0644);

    /* Disconnect from WebHDFS */
    webhdfs_disconnect(fs);
    webhdfs_conf_free(conf);

    return(0);
}