hbase

Retrieve any three random qualifier in hbase using java

青春壹個敷衍的年華 提交于 2019-12-25 08:57:15
问题 My hbase table looks like this: hbase(main):040:0> scan 'TEST' ROW COLUMN+CELL 4 column=data:108, timestamp=1399972960190, value=-240.0 4 column=data:112, timestamp=1399972960138, value=-160.0 4 column=data:12, timestamp=1399972922979, value=2 4 column=data:120, timestamp=1399972960124, value=-152.0 4 column=data:144, timestamp=1399972960171, value=-240.0 4 column=data:148, timestamp=1399972960152, value=-240.0 4 column=data:16, timestamp=1399972909606, value=9 4 column=data:8, timestamp

How to Delete recent version of all columns based on rowkey in Hbase

自闭症网瘾萝莉.ら 提交于 2019-12-25 08:47:06
问题 I've a requirement with deleting the data from Hbase. I want to delete the latest version of each cell based on the row key in Hbase. I thought of an approach to get the column names and latest timestamp of each column with the given rowkey.....then perform the delete operation iteratively with each column and its time stamp. But I'm not able to get the column names, so I'm not able do it. Please share if you have any thoughts or working code ? 回答1: Here is a custom filter I made once,

Proper ways to Put XML into HBase

风流意气都作罢 提交于 2019-12-25 08:42:12
问题 I am trying to put into HBase (version 1.1.X) some XML files stored locally. My goal is to store the content of those XMLs in my HBase Table as string using MapReduce ( no reduce stage ) without loading them to HDFS. Here is my pseudo-code: fetchXMLs(path); XML2OneLineFile(); configureHBase(); // + establishing connection Map(input, output); //input: one XML file in one line; output : is the Put() of HBase; closeConnection(); Is this way of tackling the problem correct, or there are better

How to insert multivalued field in solr using lily morphline row-based

依然范特西╮ 提交于 2019-12-25 07:26:11
问题 I am trying to insert a comma-seperated string as a multivalued field to my morphline configuration from a Row-based Structure in HBase. Can any one suggest any better way or experience I am new to this. Is there any way I can do that. HBase-Indexer Mapper: <?xml version="1.0"?> <indexer table="Document_Test" mapper="com.ngdata.hbaseindexer.morphline.MorphlineResultToSolrMapper" unique-key-field="documentId" mapping="row"> <param name="morphlineFile" value="/path/to/morphline.conf" /> <

Hadoop and hbase java client.. issues with HbaseRPC

孤者浪人 提交于 2019-12-25 05:35:09
问题 I am trying to insert the data into hbase.I am running java program from remote machine. I have mentioned the code below. try { Configuration conf = HBaseConfiguration.create(); conf.clear(); conf.set("hbase.zookeeper.quorum", "<HOST_IP>:2181"); conf.set("hbase.zookeeper.property.clientPort", "2181"); conf.set("hbase.zookeeper.dns.nameserver", "<HOST_IP>"); conf.set("hbase.regionserver.port","60020"); conf.set("hbase.master", "<HOST_IP>:9000"); HTable table = new HTable(conf, "test"); Put put

HBase fails to start [closed]

坚强是说给别人听的谎言 提交于 2019-12-25 03:53:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm installing Hbase 0.94.2 as per the somewhat simplistic http://hbase.apache.org/book/quickstart.html, and it's not working yet. Running the start script i get in the log file: 2012-11-23 18:26:37,827 INFO org.apache.zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181,

HBase shell 中的十六进制数值表示

十年热恋 提交于 2019-12-25 03:43:37
在使用Hbase shell 进行get 或scan操作时,时不时会看到一些数值被转成了16进制, 就像下面那样 value=W\x5C5\x80 那么这个值具体等于多少? 查阅资料后发现算法如下 W -> W的ASCII码16进制 为 0x57 \x5C -> 就是16进制不变 0x5C 5 -> 5的ASCII码16进制 为 0x35 \x80 -> 就是16进制不变 0x80 所以从左往右重新拼起来就是 0x575C3580 -> 转成十进制为 1465660800 所以照例,如下 value=W]PA W -> W的ASCII码16进制 为 0x57 ] -> ]的ASCII码16进制 为 0x5D P -> P的ASCII码16进制 为 0x50 A -> A的ASCII码16进制 为 0x41 0x575D5041 -> 转成十进制为 1465733185 以上是查询结果出现十六进制的情况, 那么如果查询的Key本身也被转为16进制怎么办? 因为有时候key中可能有中文字符. 可以照如下操作: 先写个简单测试程序把中文UTF-8转成16进制 System.out.println(org.apache.commons.codec.binary.Hex.encodeHex("中文".getBytes("UTF-8"))); //输出结果:e4b8ade69687

What exactly is countOfRowsFiltered in ScanMetrics with HBase Scan?

为君一笑 提交于 2019-12-25 03:34:44
问题 I have a table that is subject to heavy insert and delete action, and I need to scan it frequently with Scans (only by row-key, no column values). I noticed that Scan latency increases as the amount of data in the table grows. After closer inspection of ScanMetrics , I noticed that for most higher-latency scans, the measure of ScanMetrics.countOfRowsFiltered is MUCH higher than the number of rows that I'm actually requesting to scan (which I specify both .setLimit() in the Scan and PageFilter

Apache Pig: Dynamic columns

强颜欢笑 提交于 2019-12-25 03:19:12
问题 I've a dataset (CSV) that has three value columns (v1, 2 and 3) with a value. The description of the value is stored as a comma separated string in the column 'keys'. | v1 | v2 | v3 | keys | | A | C | E | X,Y,Z | Using Pig I would like to load this information in a HBase table where the Column Family is C and the Column Qualifier is the key. | C:X | C:Y | C:Z | | A | C | E | Has anyone done this before and would like to share this knowledge? Another option is to store a map (key#value) in a

Is this method for HBase data storage correct?

雨燕双飞 提交于 2019-12-25 02:53:20
问题 Here what is want to do is i want to store and retrieve serialized data in HBase table and later i want to retrieve them as it is. I thought to follow method. Please tell me if i'm wrong. put.add(streamColumnFamily,streamColumnName,serializedData); Here serializedData attribute will be handle by HBaseSerialization class. what is want to is, is this method correct. will i be able to retrieve stored data as it was. (int as int, float as float, String as String etc) 回答1: Yes, the method is