Specifying MapR-DB Binary Tables When Using the C APIs

In APIs in which you must pass the name of a MapR-DB table, you can specify the name in one of two ways:

  • Specify the complete path to the table in this format: /mapr/<cluster>/<volume>/<table> For example, if you were to use the nhb_admin_table_add_column_family API to add a new column family to a table, the name of the cluster was newyork, the name of the volume was vol1, and the name of the table was table1, you would specify the table with this path: /mapr/newyork/vol1/table1
  • Specify the name only. This method requires that you first modify the hbase.table.namespace.mappings property to the core-site.xml file. For Hadoop 1, edit the file /opt/mapr/hadoop/hadoop-0.20.2/conf/core-site.xml. For Hadoop 2, edit the file /opt/mapr/hadoop/hadoop-2.4.1/etc/hadoop/core-site.xml. Here is an example:
<property>
        <name>hbase.table.namespace.mappings</name>
        <value>*:/tables_dir1</value>
</property>

In this example, all tables that you create with the C APIs and all tables that you access will be in the directory /tables_dir1. If you specified the table name table1 in a C API, the full path to the table would be /tables_dir1/table1.