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
};
nn
Specifies the CLDB node to connect to
when hdfsBuilderConnect() is called. This value is set by
hdfsBuilderSetNameNode().
- If
defaultis specified for thehostparameter,hdfsBuilderConnect()will connect to the first cluster listed in the fileMAPR_HOME/conf/mapr-clusters.conf. (MAPR_HOMEdefaults to/opt/mapr.) - If a hostname or IP address is specified for the
hostparameter,hdfsBuilderConnect(), look inMAPR_HOME/conf/mapr-clusters.confon 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.conffile, 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.
portSpecifies 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
mKindSpecifies whether the object is a file or directory.
char
*mNameSpecifies the name of the object.
tTime
mLastModSpecifies the epoch time in milliseconds of the last modification to the object.
tOffset mSizeSpecifies the size of the object in bytes.
short mReplicationSpecifies the count of replicas of the object.
tOffset mBlockSizeSpecifies the block size for the object.
char *mOwnerSpecifies the owner of the object.
char *mGroupSpecifies the group that is associated with the object.
short mPermissionsSpecifies the permissions on the object.
tTime mLastAccessSpecifies the epoch time in milliseconds at which the object was created.