@@ -0,0 +1,1560 @@
+/*%0A * PURPOSE%0A *  providing an interface to hbase counter table.%0A *  'ilbeCounter' counting table has%0A *  one column family, 'c', and one qualifier, 'count'.%0A *  %0A *  for this table, put command is interchangeable with increment command.%0A *  so, only incCount method is provided. %0A */%0A%0Apackage hbase.dao;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.hbase.HBaseConfiguration;%0Aimport org.apache.hadoop.hbase.client.HConnection;%0Aimport org.apache.hadoop.hbase.client.HConnectionManager;%0Aimport org.apache.hadoop.hbase.client.HTableInterface;%0Aimport org.apache.hadoop.hbase.util.Bytes;%0A%0Apublic class CountersDAO %7B%0A%09// test purpose %0A%09public static byte%5B%5D OUTPUT_TESTTABLE = Bytes.toBytes(%22counterTestOutput%22);%0A%09%0A%09// table%0A%09public static byte%5B%5D OUTPUT_TABLE = Bytes.toBytes(%22ilbeCounter%22);%0A%09// column family%0A%09public static byte%5B%5D OUTPUT_FAM = Bytes.toBytes(%22c%22);%0A%09// qualifier%0A%09public static byte%5B%5D OUTPUT_COUNTERCOL = Bytes.toBytes(%22count%22);%0A%09%0A%09// ready for initiating hbase connection%0A%09private Configuration conf = HBaseConfiguration.create();%0A%09private HConnection connection = HConnectionManager.createConnection(conf);%0A%09%0A%09public CountersDAO() throws IOException %7B%7D%0A%09%0A%09/*%0A%09 * PURPOSE%0A%09 *  increasing by the count argumented of the row argumented.%0A%09 */%0A%09public void incCount(String rowkey, int count) throws IOException %7B%0A%09%09HTableInterface t = connection.getTable(OUTPUT_TABLE);%0A%0A%09%09t.incrementColumnValue(Bytes.toBytes(rowkey),%0A%09%09%09%09%09%09%09%09   OUTPUT_FAM, OUTPUT_COUNTERCOL,%0A%09%09%09%09%09%09%09%09   count);%0A%0A%09%09t.close();%0A%09%7D%0A%7D%0A

Create CountersDAO.java