Structures

libhdfs defines these structures, which are supported by libMapRClient.

hdfsBuilder

Supported by libhdfs for hadoop-2.x

This structure can be passed to hdfsBuilderConnect() for creating connections to file system clusters. In the libMapRClient, four of the parameters are ignored. forceNewInstance is ignored, though the header file does not indicate this.

struct hdfsBuilder {
    int forceNewInstance;
    const char *nn;
    tPort port;
    const char *kerbTicketCachePath; // Ignored
    const char *userName;            // Ignored
    struct hdfsBuilderConfOpt *opts; // Ignored
};
Parameters

nn

Specifies the CLDB node to connect to when hdfsBuilderConnect() is called. This value is set by hdfsBuilderSetNameNode().

  • If default is specified for the host parameter, hdfsBuilderConnect() will connect to the first cluster listed in the file MAPR_HOME/conf/mapr-clusters.conf. (MAPR_HOME defaults to /opt/mapr.)
  • If a hostname or IP address is specified for the host parameter, hdfsBuilderConnect(), look in MAPR_HOME/conf/mapr-clusters.conf on the client node to match the specified hostname or IP address to a CLDB host and port.
    • If they find a match, they try to connect to the cluster and all standard features for connections to Data Fabric clusters are available. These features include high availability across CLDBs and secure connections.
    • If they do not find a match or if they cannot locate a mapr-clusters.conf file, they try to connect to the CLDB host specified in the call to create the connection. However, the standard features for connections to Data Fabric clusters are not available. For example, if the cluster is secured, the connection will fail.
port

Specifies the port to connect to on the CLDB node. This value is set by hdfsBuilderSetNameNodePort().

hdfsFileInfo

Supported by libhdfs for hadoop-2.x

This structure is returned by hdfsGetPathInfo() and deleted by hdfsFreeFileInfo(). It contains information about the file or directory that is specified in the call to hdfsGetPathInfo().

ParameterstObjectKind mKind

Specifies whether the object is a file or directory.

char *mName

Specifies the name of the object.

tTime mLastMod

Specifies the epoch time in milliseconds of the last modification to the object.

tOffset mSize

Specifies the size of the object in bytes.

short mReplication

Specifies the count of replicas of the object.

tOffset mBlockSize

Specifies the block size for the object.

char *mOwner

Specifies the owner of the object.

char *mGroup

Specifies the group that is associated with the object.

short mPermissions

Specifies the permissions on the object.

tTime mLastAccess

Specifies the epoch time in milliseconds at which the object was created.