{"id":1422,"date":"2011-10-24T09:57:29","date_gmt":"2011-10-24T14:57:29","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=1422"},"modified":"2011-10-24T09:57:29","modified_gmt":"2011-10-24T14:57:29","slug":"hbase-has-disappearing-rows","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2011\/10\/24\/hbase-has-disappearing-rows\/","title":{"rendered":"HBase has disappearing rows"},"content":{"rendered":"<p>I guess this may have a place if your application data is transient in nature and doesn&#8217;t need to be retained forever.<\/p>\n<p>We first take an existing table and for a given column family set its &#8220;time to live&#8221; to 30 seconds.  According to the documentation, the cell will be removed after this time.<\/p>\n<pre lang=\"text\">\r\nhbase(main):010:0> disable 'myxml'\r\n0 row(s) in 2.0870 seconds\r\n\r\nhbase(main):011:0> alter 'myxml', {NAME => 'xmlfamily', TTL => '30'}\r\n0 row(s) in 0.1080 seconds\r\n\r\nhbase(main):012:0> enable 'myxml'\r\n0 row(s) in 2.0770 seconds\r\n<\/pre>\n<p>We then insert a row&#8230;<\/p>\n<pre lang=\"text\">\r\nhbase(main):013:0> put 'myxml', '1', 'xmlfamily:mdata_xml', '<x>foo<\/x>'\r\n0 row(s) in 1.0980 seconds\r\n<\/pre>\n<p>&#8230;and show that it exists right now&#8230;<\/p>\n<pre lang=\"text\">\r\nhbase(main):014:0> scan 'myxml'\r\nROW                                           COLUMN+CELL\r\n 1                                            column=xmlfamily:mdata_xml, timestamp=1310152994856, value=<x>foo<\/x>\r\n1 row(s) in 0.2890 seconds\r\n\r\nhbase(main):015:0> get 'myxml', '1'\r\nCOLUMN                                        CELL\r\n xmlfamily:mdata_xml                          timestamp=1310152994856, value=<x>foo<\/x>\r\n1 row(s) in 0.4170 seconds\r\n<\/pre>\n<p>&#8230;but after we wait a minute or so, it is &#8220;gone&#8221;&#8230;<\/p>\n<pre lang=\"text\">\r\nhbase(main):016:0> get 'myxml', '1'\r\nCOLUMN                                        CELL\r\n0 row(s) in 0.0490 seconds\r\n\r\nhbase(main):017:0>\r\n<\/pre>\n<p>It should be noted that the default TTL for a column family is 2,147,483,647 seconds, which is roughly 68 years.  As such, we should be safe \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I guess this may have a place if your application data is transient in nature and doesn&#8217;t need to be retained forever. We first take an existing table and for a given column family set its &#8220;time to live&#8221; to&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2011\/10\/24\/hbase-has-disappearing-rows\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,20],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/1422"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1422"}],"version-history":[{"count":13,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/1422\/revisions"}],"predecessor-version":[{"id":1658,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/1422\/revisions\/1658"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}