Accessing MapR-FS with C Applications

MapR provides a modified version of libhdfs that supports access to MapR-FS. You can develop applications with C that read files, write to files, change file permissions and file ownership, create and delete files and directories, rename files, and change the access and modification times of files and directories.

libMapRClient supports and makes modifications to both the hadoop-0.20.2 and hadoop-2.x versions of libhdfs. The API reference notes which APIs are supported by hadoop-0.20.2 only, hadoop-2.x only, or both hadoop-0.20.2 and hadoop-2.x.

libMapRClient’s version of libhdfs contains the following changes and additions:

  • There are no calls to a JVM, so applications run faster and more efficiently.
  • Changes to APIs
    • hadoop-2.x: Support for hdfsBuilder structures for connections to HDFS is limited. Some of the parameters are ignored.
    • hadoop-0.20.2: hdfsGetDefaultBlockSize(): If the filesystem that the client is connected to is an instance of MapR-FS, the returned value is 256 MB, regardless of the actual setting.
    • hadoop-0.20.2 and hadoop-2.x: hdfsCreateDirectory(): The parameters for buffer size, replication, and block size are ignored for connections to MapR-FS.
    • hadoop-0.20.2 and hadoop-2.x: hdfsGetDefaultBlockSizeAtPath(): If the filesystem that the client is connected to is an instance of MapR-FS, the returned value is 256 MB, regardless of the actual setting.
    • hadoop-0.20.2 and hadoop-2.x: hdfsOpenFile(): The parameters for buffer size and replication are ignored for connections to MapR-FS.
  • APIs that are unique to libMapRClient for both hadoop-0.20.2 and hadoop-2.x
    • hdfsCreateDirectory2()
    • hdfsGetNameContainerSizeBytes()
    • hdfsOpenFile2()
    • hdfsSetRpcTimeout()
    • hdfsSetThreads()