# Optional: Building a job jar only
mvn3 package
# Optional: Packaging the Source to /home/poulin/bcounts-0.1.0-SNAPSHOT/target/
mvn3 assembly:single
# Optional: Generating JavaDoc only
mvn3 javadoc:javadoc

6.21

Check M2_REPO classpath variable set in Eclipse
o Open a new Terminal and start up Eclipse
su poulin
eclipse

o In Eclipse: Window->preferences->java->build path->classpath variables

o Once M2_REPO is observed, Click Cancel back to the parent Eclipse window

6.22In Eclipse: File->Import…->(expand) General -> (highlight) Existing Projects into Workspace -> (click) Next -> and specify root directory /home/poulin/bcounts-0.1.0-SNAPSHOT (hit enter if pasted)
Ensure that bcounts is checked in the Projects box and Click Finish

6.23

In Eclipse: Window->Preferences->Java->Code Style->Formatter

6.24

Click Import… and navigate to /home/poulin/bcounts-0.1.0-SNAPSHOT/eclipse_formatter_apache.xml
Then Click Apply and then Click OK and then close Eclipse.

6.25

Create schema for Bayesian Counters examples in HBase
su poulin
echo “create ‘sp’, {NAME => ’5min’, VERSIONS => 1, TTL => 604800, BLOCKCACHE => false}, {NAME => ’30min’, VERSIONS => 1, TTL => 604800, BLOCKCACHE => false}, {NAME => ’1day’, VERSIONS => 1, TTL => 604800, BLOCKCACHE => false}, {NAME => ‘All’, VERSIONS => 1, TTL => 1209600, BLOCKCACHE => false}” | hbase shell
echo “create ‘iris’, {NAME => ’5min’, VERSIONS => 1, TTL => 86400, BLOCKCACHE => false}, {NAME => ’30min’, VERSIONS => 1, TTL => 86400, BLOCKCACHE => false}, {NAME => ’1day’, VERSIONS => 1, TTL => 86400, BLOCKCACHE => false}, {NAME => ‘All’, VERSIONS => 1, TTL => 432000, BLOCKCACHE => false}” | hbase shell
echo “create ‘ad’, {NAME => ’5min’, VERSIONS => 1, TTL => 259200, BLOCKCACHE => false}, {NAME => ’30min’, VERSIONS => 1, TTL => 259200, BLOCKCACHE => false}, {NAME => ’1day’, VERSIONS => 1, TTL => 259200, BLOCKCACHE => false}, {NAME => ‘All’, VERSIONS => 1, TTL => 432000, BLOCKCACHE => false}” | hbase shell
echo “create ‘car’, {NAME => ’5min’, VERSIONS => 2, TTL => 300, BLOCKCACHE => false}, {NAME => ’30min’, VERSIONS => 2, TTL => 1800, BLOCKCACHE => false}, {NAME => ’1day’, VERSIONS => 2, TTL => 259200, BLOCKCACHE => false}, {NAME => ‘All’, VERSIONS => 2, TTL => 432000, BLOCKCACHE => false}” | hbase shell

6.26

Load Iris data into HBase via CLI
su poulin
cd /home/poulin/bcounts-0.1.0-SNAPSHOT
bcount com.cloudera.bayesiancounters.util.Driver loader examples/data/iris.data iris
echo “scan ‘iris’” | hbase shell

Load Iris data into HBase
The iris data loaded into hbase is rectangular and newline delimited in the format:
,,,…
During the load, the counts in hbase are incremented.
The human-readable meaning and schema of iris.data can be found in the Iris section of the bayesiancounters-site.xml which is added to a CLASSPATH in prior steps.
For a production pipeline, will repeat this iris.load at a regular interval of deltas or bind the UI directly to the hbase calls used by the loader code.
The loader logic can be mastered with eclipse by modifying the following section of this tutorial:
Change from: “Run->Run Configurations”
Change to: “Run->Debug Configurations”
Then check mark next to “Stop in main” and then step through the code.