本文介绍了将XML放入HBase的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的目标是将这些XML的内容存储在我的HBase中Table使用MapReduce( no reduce stage )作为字符串,而不将它们加载到HDFS中。

这是我的伪代码:

  fetchXMLs(path); 
XML2OneLineFile();
configureHBase(); // +建立连接
映射(输入,输出); //输入:一行中的一个XML文件;输出:是HBase的Put();
closeConnection();

解决这个问题的方法是否正确,或者有更好的方法来解决问题?



ps:我不想从我的XML中解析或提取数据,只是将它们存储起来。



/ p>

解决方案

Hbase并非真正用于大型对象存储。根据你的xml的大小,HBase可能不是你正在寻找的解决方案。

目前,我正在研究一个包含多种文件类型(包括xml)的数据库。我认为最好的做法是将1Mo以下的文件存储到HBase,其余的文件存放在Hadoop中,将元数据保存在SQL或HBase中。



这取决于您希望通过这些数据实现的目标。


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 ways to do it?

ps: I do not want to parse or extract data from my XML, just store them.

Thanks in advance

解决方案

Hbase is not really made for large object storing. Depending on the size of your xml, HBase might not be the solution you are looking for.

At this moment, I am working on a database consisting of multiple file types including xml. What I thought was good was to store any files under 1Mo to HBase, and the rest to Hadoop, maintaining meta data either in an SQL or in HBase.

It depends a lot of what you want to achieve with this data.

这篇关于将XML放入HBase的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 03:57