从MongoDB迁移到HBase

从MongoDB迁移到HBase,mongodb,hadoop,hbase,Mongodb,Hadoop,Hbase,嗨,我是HBase数据库的新手。我下载了一些twitter数据并存储到MongoDB中。现在,我需要将这些数据转换为HBase,以加快Hadoop处理速度。但我无法创建它的方案。这里我将twitter数据转换为JSON格式- { “_id”:ObjectId(“512b71e6e4b02a4322d1c0b0”), “id”:长编号(“306044618179506176”), “来源”:“, “用户”:{ “姓名”:“达达·巴格温”, “地点”:“印度”, “url”:”http://www.

嗨,我是HBase数据库的新手。我下载了一些twitter数据并存储到MongoDB中。现在,我需要将这些数据转换为HBase,以加快Hadoop处理速度。但我无法创建它的方案。这里我将twitter数据转换为JSON格式-

{
“_id”:ObjectId(“512b71e6e4b02a4322d1c0b0”),
“id”:长编号(“306044618179506176”),
“来源”:“,
“用户”:{
“姓名”:“达达·巴格温”,
“地点”:“印度”,
“url”:”http://www.dadabhagwan.org",
“id”:191724440,
“受保护”:错误,
“时区”:空,
“描述”:“阿克兰·维格南的创始人——实现自我的实用精神科学”,
“屏幕名称”:“dadabhagwan”,
“geoEnabled”:false,
“profileImageURL”:http://a0.twimg.com/profile_images/1647956820/M_DSC_0034_normal.jpg",
“biggerProfileImageURL”:http://a0.twimg.com/profile_images/1647956820/M_DSC_0034_bigger.jpg",
“profileImageUrlHttps”:https://si0.twimg.com/profile_images/1647956820/M_DSC_0034_normal.jpg",
“profileImageURLHttps”:https://si0.twimg.com/profile_images/1647956820/M_DSC_0034_normal.jpg",
“biggerProfileImageURLHttps”:https://si0.twimg.com/profile_images/1647956820/M_DSC_0034_bigger.jpg",
“miniProfileImageURLHttps”:https://si0.twimg.com/profile_images/1647956820/M_DSC_0034_mini.jpg",
“originalProfileImageURLHttps”:https://si0.twimg.com/profile_images/1647956820/M_DSC_0034.jpg",
“跟随者计数”:499,
“profileBackgroundColor”:“EEE4C1”,
“profileTextColor”:“333333”,
“profileLinkColor”:“990000”,
“郎”:“恩”,
“profileSidebarFillColor”:“FCF9EC”,
“profileSidebarBorderColor”:“CBC09A”,
“profileUseBackgroundImage”:正确,
“ShowAllineMedia”:错误,
“友谊网”:1,
“收藏夹搜索”:0,
“profileBackgroundImageUrl”:http://a0.twimg.com/profile_background_images/396759326/dadabhagwan-twitter.jpg",
“profileBackgroundImageURL”:http://a0.twimg.com/profile_background_images/396759326/dadabhagwan-twitter.jpg",
“profileBackgroundImageUrlHttps”:https://si0.twimg.com/profile_background_images/396759326/dadabhagwan-twitter.jpg",
“profileBannerURL”:空,
“profileBannerRetinaURL”:空,
“profileBannerIPadURL”:空,
“ProfileBanneRipAdrentinaURL”:空,
“miniProfileImageURL”:http://a0.twimg.com/profile_images/1647956820/M_DSC_0034_mini.jpg",
“originalProfileImageURL”:http://a0.twimg.com/profile_images/1647956820/M_DSC_0034.jpg",
“utcOffset”:-1,
“contributorsEnabled”:false,
“状态”:空,
“createdAt”:数字长(“1284700143000”),
“profileBannerMobileURL”:空,
“profileBannerMobileRetinaURL”:null,
“ProfileBackgroundTilled”:错误,
“状态计数”:1713,
“已验证”:错误,
“译者”:错,
“列表帐户”:6,
“followRequestSent”:false,
“描述实体”:[],
“实体”:{
“url”:”http://www.dadabhagwan.org",
“开始”:0,
"完":26,,
“expandedURL”:http://www.dadabhagwan.org",
“显示URL”:http://www.dadabhagwan.org"
},
“rateLimitStatus”:空,
“访问级别”:0
},
“贡献者”:[],
“地理位置”:空,
“地点”:空,
“偏爱”:错误,
“转发”:错误,
“RetweetdStatus”:空,
“retweetCount”:0,
“用户实体”:[],
“我转发”:假,
“currentUserRetweetId”:-1,
“可能敏感”:假,
“实体”:[
{
“url”:”http://t.co/gR1GohGjaj",
“开始”:113,
“结束”:135,
“expandedURL”:http://fb.me/2j2HKHJrM",
“displayURL”:“fb.me/2j2HKHJrM”
}
],
“hashtagEntities”:[],
“媒体实体”:[],
“截断”:false,
“inReplyToStatusId”:-1,
“文本”:“当时的精神名言:\n\n‘我是昌都海’本身就是一种幻觉,从中可以看出,阿玛斯受到了指控。当。。。http://t.co/gR1GohGjaj",
“inReplyToUserId”:-1,
“inReplyToScreenName”:空,
“createdAt”:数字长(“1361801697000”),
“rateLimitStatus”:空,
“访问级别”:0
}
这里如何将数据划分为列和列族?我想制作一个
“twitter”列系列
,其中包含
源、getlocation、place、retweet等
,另一个
“user”列系列
,其中包含
名称、位置等
(用户数据)。i、 e每个内部级别子文档的新列族

这种方法正确吗?现在,我将如何区分
用户列系列
推特列系列


以及如何处理包含子文档列表的键(例如,
urlentity

在HBase中有许多方法可以对此进行建模,从将所有内容存储在一列中到为每个子实体使用不同的表以及多个其他表进行“索引”

一般来说,您可以根据读写访问模式对hbase中的数据进行建模。例如,列族存储在磁盘上的不同文件中。将数据分为两列族的一个原因是,在很多情况下,您需要其中一列族的数据,而不是另一列族的数据。等等


Ian Varley在2012年的HBaseCon上对HBAse模式设计做了一个很好的介绍。您可以找到幻灯片和视频

在HBAse中对此进行建模的方法有很多,从将所有内容存储在一个列中,到为每个子实体创建一个不同的表以及几个其他用于“索引”的表

一般来说,您可以根据读写访问模式对hbase中的数据进行建模。例如,列族存储在磁盘上的不同文件中。将数据分为两列族的一个原因是,在很多情况下,您需要其中一列族的数据,而不是另一列族的数据。等等

Ian Varley在2012年的HBaseCon上做了一个很好的关于HBAse模式设计的演示,您可以找到幻灯片和视频