Running CountTableRows When the Store is Non-Secure

If you will be running CountTableRows against a non-secure store such as that deployed in the Deploying a Non-Secure Store appendix, and you have compiled and built CountTableRows in the manner presented in the previous section, the MapReduce job initiated by the CountTableRows example program can be deployed by typing the following at the command line of the Hadoop cluster's access node:

export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:\
    /opt/oracle/kv-ee/lib/kvclient.jar

cd /opt/oracle/nosqlapps/kv

hadoop jar examples/CountTableRows.jar \
    hadoop.table.CountTableRows \
    -libjars \
    /opt/oracle/kv-ee/lib/kvclient.jar,\
    /opt/oracle/kv-ee/lib/kvstore-ee.jar \
    /opt/oracle/kv-ee/lib/jackson-core.jar,\
    /opt/oracle/kv-ee/lib/jackson-databind.jar,\
    /opt/oracle/kv-ee/lib/jackson-annotations.jar,\
    example-store \
    kv-host-1:5000 \
    vehicleTable \
    /user/example-user/CountTableRows/vehicleTable/<000N>

The Hadoop command interpreter's -libjars argument is used to include the third party libraries kvclient.jar, kvstore-ee.jar, jackson-core.jar, jackson-databind.jar, and jackson-annotations.jar in the classpath of each MapReduce task executing on the cluster's DataNodes. This is necessary so that those tasks can access classes such as, TableInputSplit and TableRecordReader, as well as various support classes that are not available on the Hadoop platform.

The value example-store specifies the name of the store you deployed and the value kv-host-1:5000 specifies the hostname and port to use when connecting to that store. The value vehicleTable specifies the name of the table whose rows will be counted by the MapReduce job. And the last argument, containing the path string, specifies where in the Hadoop HDFS filesystem the final value for the number of rows in the vehicleTable should be written.

Note:

The example-user component of the path value input to the last argument corresponds to a directory under the HDFS top-level directory with base path /user, which typically corresponds to the user who has initiated the MapReduce job. This directory is usually created in HDFS by the Hadoop cluster administrator. Additionally, the <000N> token at the end of the path represents a string such as 0000, 0001, 0002, etc. Although any string can be used for this token, using a different number for "N" on each execution of the job makes it easier to keep track of results when you run the job multiple times.