简体   繁体   English

如何在HBase中存储XML文件?

[英]How to store XML files in HBase?

I'm trying to work on following scenarios: 我正在尝试以下情形:

  1. I have simple XML data: 我有简单的XML数据:

     <main_tag> <x> <a>name value</a> <b>age value</b> </x> <y> <c>country value</c> <y> </main_tag> 

    I want the above XML file to be stored in HBase. 我希望以上XML文件存储在HBase中。 How can we do it? 我们该怎么做?

  2. If I have large number of XML files, how can I do bulk loading of files into HBase? 如果我有大量的XML文件,如何将文件批量加载到HBase中?

In both the scenarios, I don't want to use HDFS initially. 在这两种情况下,我都不希望最初使用HDFS。

Your first question answered by @ravindra. 您的第一个问题由@ravindra回答。 For second question, You have the option of bulk loading where you can use map reduce to read large data, and convert it into HFile format, and then use bulk loading command to load output of map reduce to Hbase. 对于第二个问题,您可以选择批量加载,可以使用map reduce读取大数据,并将其转换为HFile格式,然后使用bulk loading命令将map reduce的输出加载到Hbase。 For this, since map reduce reads data from HDFS, you should have large data in HDFS. 为此,由于map reduce从HDFS读取数据,因此HDFS中应该有大数据。

It depends on your data too. 这也取决于您的数据。 Look here for more information. 在这里查看更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM