@@ -0,0 +1,1553 @@
+/*%0A * PURPOSE%0A *  providing the interface to posts table.%0A *  'ilbePosts' table has one column family, 'p', and%0A *  two qualifier, 'content' and 'title'.%0A */%0A%0Apackage hbase.dao;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.hbase.CellUtil;%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.client.Put;%0Aimport org.apache.hadoop.hbase.client.Result;%0Aimport org.apache.hadoop.hbase.util.Bytes;%0A%0Apublic class PostsDAO %7B%0A%09public static byte%5B%5D INPUT_TABLE = Bytes.toBytes(%22ilbe%22);%0A%09public static byte%5B%5D INPUT_FAM = Bytes.toBytes(%22p%22);%0A%09public static byte%5B%5D INPUT_CONTENTCOL = Bytes.toBytes(%22content%22);%0A%09public static byte%5B%5D INPUT_TITLECOL = Bytes.toBytes(%22title%22);%0A%09%0A%09private Configuration conf = HBaseConfiguration.create();%0A%09private HConnection connection = HConnectionManager.createConnection(conf);%0A%09%0A%09public PostsDAO() throws IOException %7B %7D%0A%09%0A%09public String getContent(Result r) %7B%09%09%0A%09%09return Bytes.toString(getCell(r, INPUT_CONTENTCOL));%0A%09%7D%0A%09%0A%09public String getTitle(Result r) %7B%0A%09%09return Bytes.toString(getCell(r, INPUT_TITLECOL));%0A%09%7D%0A%09%0A%09private byte%5B%5D getCell(Result r, byte%5B%5D qualifier) %7B%0A%09%09return CellUtil.cloneValue(r.getColumnLatestCell(INPUT_FAM, qualifier));%0A%09%7D%0A%0A%09public void put(Put p) throws IOException %7B%0A%09%09HTableInterface t = connection.getTable(INPUT_TABLE);%09%09%0A%09%09t.put(p);%0A%09%09t.close();%0A%09%7D%0A%7D%0A

Create PostsDAO.java