2013-03-05 2 views
1

안녕하세요, HBase 데이터베이스가 새로 생겼습니다. 나는 트위터 데이터를 다운로드하고 MongoDB에 저장했다. 이제 Hadoop 처리 속도를 높이기 위해 해당 데이터를 HBase로 변환해야합니다. 그러나 나는 그 계획을 세울 수 없다. JSON 형식의 트위터 데이터가 있습니다.MongoDB에서 HBase로 마이 그 레이션

{ 
"_id" : ObjectId("512b71e6e4b02a4322d1c0b0"), 
"id" : NumberLong("306044618179506176"), 
"source" : "<a href=\"http://www.facebook.com/twitter\" rel=\"nofollow\">Facebook</a>", 
"user" : { 
    "name" : "Dada Bhagwan", 
    "location" : "India", 
    "url" : "http://www.dadabhagwan.org", 
    "id" : 191724440, 
    "protected" : false, 
    "timeZone" : null, 
    "description" : "Founder of Akram Vignan - Practical Spiritual Science of Self Realization", 
    "screenName" : "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", 
    "followersCount" : 499, 
    "profileBackgroundColor" : "EEE4C1", 
    "profileTextColor" : "333333", 
    "profileLinkColor" : "990000", 
    "lang" : "en", 
    "profileSidebarFillColor" : "FCF9EC", 
    "profileSidebarBorderColor" : "CBC09A", 
    "profileUseBackgroundImage" : true, 
    "showAllInlineMedia" : false, 
    "friendsCount" : 1, 
    "favouritesCount" : 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" : null, 
    "profileBannerRetinaURL" : null, 
    "profileBannerIPadURL" : null, 
    "profileBannerIPadRetinaURL" : null, 
    "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, 
    "status" : null, 
    "createdAt" : NumberLong("1284700143000"), 
    "profileBannerMobileURL" : null, 
    "profileBannerMobileRetinaURL" : null, 
    "profileBackgroundTiled" : false, 
    "statusesCount" : 1713, 
    "verified" : false, 
    "translator" : false, 
    "listedCount" : 6, 
    "followRequestSent" : false, 
    "descriptionURLEntities" : [ ], 
    "urlentity" : { 
     "url" : "http://www.dadabhagwan.org", 
     "start" : 0, 
     "end" : 26, 
     "expandedURL" : "http://www.dadabhagwan.org", 
     "displayURL" : "http://www.dadabhagwan.org" 
    }, 
    "rateLimitStatus" : null, 
    "accessLevel" : 0 
}, 
"contributors" : [ ], 
"geoLocation" : null, 
"place" : null, 
"favorited" : false, 
"retweet" : false, 
"retweetedStatus" : null, 
"retweetCount" : 0, 
"userMentionEntities" : [ ], 
"retweetedByMe" : false, 
"currentUserRetweetId" : -1, 
"possiblySensitive" : false, 
"urlentities" : [ 
    { 
     "url" : "http://t.co/gR1GohGjaj", 
     "start" : 113, 
     "end" : 135, 
     "expandedURL" : "http://fb.me/2j2HKHJrM", 
     "displayURL" : "fb.me/2j2HKHJrM" 
    } 
], 
"hashtagEntities" : [ ], 
"mediaEntities" : [ ], 
"truncated" : false, 
"inReplyToStatusId" : -1, 
"text" : "Spiritual Quote of the Day :\n\n‘I am Chandubhai’ is an illusion itself and from that are \nkarmas charged. When... http://t.co/gR1GohGjaj", 
"inReplyToUserId" : -1, 
"inReplyToScreenName" : null, 
"createdAt" : NumberLong("1361801697000"), 
"rateLimitStatus" : null, 
"accessLevel" : 0 
} 

여기에서 데이터를 열 및 열 패밀리로 나누는 방법은 무엇입니까? 나는 source, getlocation, place, retweet etc... 및 또 다른 "user" column-family을 포함하고 name, location etc... (사용자 데이터)을 포함하는 하나의 "twitter" column-family을 만들려고 생각했습니다. 즉 각 내부 수준 하위 문서의 새로운 열 패밀리입니다.

이 방법이 맞습니까? 이제 및 "twitter" column-family에 대해 urlentity을 어떻게 구분할 예정입니까?

어떻게 (예를 들어 urlentity에 대한) 하위 문서의 목록을 포함하는 키를 처리하는

답변

3

단일 열에서 모든 것을 저장에서 각각 다른 테이블을 가지고에 이르기까지 HBase를이 모델링하는 방법에는 여러 가지가 있습니다 하위 엔티티는 "인덱싱"을위한 몇 가지 다른 테이블을 가지고 있습니다.

일반적으로 말해서 액세스 패턴을 읽고 쓰는 것을 기반으로 hbase의 데이터를 모델링합니다. 예제 열 패밀리는 디스크의 다른 파일에 저장됩니다. 데이터를 두 열 패밀리로 나누는 이유는 하나의 데이터가 필요하고 다른 데이터가 필요하지 않은 경우가 많은 경우입니다. 등

당신이 슬라이드 here 및 비디오 here

을 찾을 수 있습니다 HBaseCon 2012 년 이안 Varley에 의해 HBase를 스키마 디자인에 대한 좋은 프리젠 테이션이있다
관련 문제