锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲免费视频在线观看,www.91亚洲,国产亚洲一区二区三区在线http://www.tkk7.com/hengheng123456789/category/17306.htmlzh-cnFri, 24 Dec 2010 17:49:29 GMTFri, 24 Dec 2010 17:49:29 GMT60HBASE鏉炬暎鏁版嵁瀛樺偍璁捐鍒濊瘑錛堣漿錛?/title><link>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341449.html</link><dc:creator>鍝煎摷</dc:creator><author>鍝煎摷</author><pubDate>Fri, 24 Dec 2010 03:46:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341449.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/341449.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341449.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/341449.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/341449.html</trackback:ping><description><![CDATA[杞嚜錛歨ttp://hi.baidu.com/webcell/blog/item/f179ac0f0ab6f3e7aa645749.html <div> <p style="line-height: normal; text-indent: 21pt; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">鏈榪戝叧娉?/span>Hadoop<span style="line-height: normal; ">錛屽洜姝や篃欏轟究鍏蟲敞浜嗕竴涓?/span>Hadoop<span style="line-height: normal; ">鐩稿叧鐨勯」鐩?/span>HBASE<span style="line-height: normal; ">灝辨槸鍩轟簬</span>Hadoop<span style="line-height: normal; ">鐨勪竴涓紑婧愰」鐩紝涔熸槸瀵?/span>Google<span style="line-height: normal; ">鐨?/span>BigTable<span style="line-height: normal; ">鐨勪竴縐嶅疄鐜般?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       BigTable<span style="line-height: normal; ">鏄粈涔堬紵</span>Google<span style="line-height: normal; ">鐨?/span>Paper<span style="line-height: normal; ">瀵瑰叾浣滀簡鍏呭垎鐨勮鏄庛傚瓧闈笂鐪嬪氨鏄竴寮犲ぇ琛紝鍏跺疄鍜屾垜浠兂璞$殑浼犵粺鏁版嵁搴撶殑琛ㄨ繕鏄湁浜涘樊鍒殑銆傛澗鏁f暟鎹彲浠ヨ鏄粙浜?/span>Map Entry<span style="line-height: normal; ">錛?/span>key & value<span style="line-height: normal; ">錛夊拰</span>DB Row<span style="line-height: normal; ">涔嬮棿鐨勪竴縐嶆暟鎹傚湪鎴戜嬌鐢?/span>Memcache<span style="line-height: normal; ">鐨勬椂鍊欙紝鏈夋椂鍊欑殑闇姹傛槸闇瑕佸瓨鍌ㄧ殑涓嶄粎浠呮槸綆鍗曠殑涓涓?/span>key<span style="line-height: normal; ">瀵瑰簲涓涓?/span>value<span style="line-height: normal; ">錛屽彲鑳芥垜闇瑕佺被浼間簬鏁版嵁搴撹〃緇撴瀯涓灞炴х殑瀛樺偍錛屼絾鏄張涓嶄細鏈変紶緇熸暟鎹簱琛ㄧ粨鏋勪腑閭d箞澶氬叧鑱斿叧緋葷殑闇姹傦紝鍏跺疄榪欑被鏁版嵁灝辨槸鎵璋撶殑鏉炬暎鏁版嵁銆?/span>BigTable<span style="line-height: normal; ">鏈嫻呮樉鏉ョ湅灝辨槸涓寮犲緢澶х殑琛紝琛ㄧ殑灞炴у彲浠ユ牴鎹渶姹傚幓鍔ㄦ佸鍔狅紝浣嗘槸鍙堟病鏈夎〃涓庤〃涔嬮棿鍏寵仈鏌ヨ鐨勯渶姹傘?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       <span style="line-height: normal; ">浜掕仈緗戝簲鐢ㄦ湁涓涓渶澶х殑鐗圭偣錛屽氨鏄熷害錛屽姛鑳藉啀寮哄ぇ錛岄熷害鎱紝榪樻槸浼氳鑸嶅純銆傚洜姝ゅ湪澶ц闂噺鐨勭綉绔欓兘閲囧彇鍓嶅悗鐨勭紦瀛樻潵鎻愬崌鎬ц兘鍜屽搷搴旀椂闂淬傚浜?/span>Map Entry<span style="line-height: normal; ">綾誨瀷鐨勬暟鎹紝闆嗕腑寮忓垎甯冨紡</span>Cache<span style="line-height: normal; ">閮芥湁寰堝閫夋嫨錛屽浜庝紶緇熺殑鍏崇郴鍨嬫暟鎹紝浠?/span>MySQL<span style="line-height: normal; ">鍒?/span>Oracle<span style="line-height: normal; ">閮界粰浜嗗緢濂界殑鏀寔錛屽敮鏈夋澗鏁f暟鎹繖綾繪暟鎹紝閲囩敤鍓嶅悗涓ょ瑙e喅鏂規(guī)閮戒笉鑳芥渶澶у寲瀹冪殑澶勭悊鑳藉姏銆傚洜姝?/span>BigTable<span style="line-height: normal; ">鎵嶆湁浜嗗畠鐢ㄦ涔嬪湴銆?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       HBASE<span style="line-height: normal; ">浣滀負</span>Apache<span style="line-height: normal; ">鐨勫紑婧愰」鐩紝涔熸槸鍑轟簬璧鋒闃舵錛屽洜涓哄叾瀹炲畠鎵渚濊禆鐨?/span>Hadoop<span style="line-height: normal; ">涔熶笉鑳借宸茬粡鍒頒簡鎴愮啛闃舵錛屾墍浠ラ兘鏈夊緢澶х殑鍙戝睍絀洪棿錛岃繖涔熶負鎴戜滑榪欎簺寮婧愮埍濂借呮彁渚涗簡鏇村絀洪棿鍘昏礎鐚傝繖閲屼富瑕佷細璋堝埌</span>HBASE<span style="line-height: normal; ">鐨勬鏋惰璁℃柟闈㈢殑鐭ヨ瘑鍜屽畠鐨勪竴浜涚壒鐐癸紝涓嶈鏄惁閲囩敤</span>HBASE<span style="line-height: normal; ">鍘昏В鍐沖伐浣滀腑鐨勯棶棰橈紝涓縐嶅ソ鐨勬祦紼嬭璁℃諱細緇欏紑鍙戣呭拰鏋舵瀯璁捐鑰呭甫鏉ヤ竴浜涙濇兂涓婄殑鐏姳銆?/span></p> <h2 style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: 32px; font-size: 14pt; ">HBASE</span><span style="line-height: 32px; font-size: 14pt; ">璁捐浠嬬粛</span></h2> <h3 style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: 27px; font-size: 12pt; ">鏁版嵁妯″瀷</span></h3> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       HBASE<span style="line-height: normal; ">涓殑姣忎竴寮犺〃錛屽氨鏄墍璋撶殑</span>BigTable<span style="line-height: normal; ">銆?/span>BigTable<span style="line-height: normal; ">浼氬瓨鍌ㄤ竴緋誨垪鐨勮璁板綍錛岃璁板綍鏈変笁涓熀鏈被鍨嬬殑瀹氫箟錛?/span>Row Key,Time Stamp,Column<span style="line-height: normal; ">銆?/span>Row Key<span style="line-height: normal; ">鏄鍦?/span>BigTable<span style="line-height: normal; ">涓殑鍞竴鏍囪瘑錛?/span>Time Stamp<span style="line-height: normal; ">鏄瘡嬈℃暟鎹搷浣滃搴斿叧鑱旂殑鏃墮棿鎴籌紝鍙互鐪嬩綔綾諱技浜?/span>SVN<span style="line-height: normal; ">鐨勭増鏈紝</span>Column<span style="line-height: normal; ">瀹氫箟涓猴細</span><family>:<label><span style="line-height: normal; ">錛岄氳繃榪欎袱閮ㄥ垎鍙互鍞竴鐨勬寚瀹氫竴涓暟鎹殑瀛樺偍鍒楋紝</span>family<span style="line-height: normal; ">鐨勫畾涔夊拰淇敼闇瑕佸</span>HBASE<span style="line-height: normal; ">浣滅被浼間簬</span>DB<span style="line-height: normal; ">鐨?/span>DDL<span style="line-height: normal; ">鎿嶄綔錛岃屽浜?/span>label<span style="line-height: normal; ">鐨勪嬌鐢紝鍒欎笉闇瑕佸畾涔夌洿鎺ュ彲浠ヤ嬌鐢紝榪欎篃涓哄姩鎬佸畾鍒跺垪鎻愪緵浜嗕竴縐嶆墜孌點?/span>family<span style="line-height: normal; ">鍙︿竴涓綔鐢ㄥ叾瀹炲湪浜庣墿鐞嗗瓨鍌ㄤ紭鍖栬鍐欐搷浣滐紝鍚?/span>family<span style="line-height: normal; ">鐨勬暟鎹墿鐞嗕笂淇濆瓨鐨勪細姣旇緝涓磋繎錛屽洜姝ゅ湪涓氬姟璁捐鐨勮繃紼嬩腑鍙互鍒╃敤榪欎釜鐗規(guī)с?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">鐪嬩竴涓嬮昏緫鏁版嵁妯″瀷錛?/span></p> <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto; line-height: normal; border-collapse: collapse; color: #555b6e; font-family: Arial; font-size: 12px; "> <tbody style="line-height: normal; "> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Row Key</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Time Stamp</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"contents:"</em></span></p> </td> <td colspan="2" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"anchor:"</em></span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"mime:"</em></span></p> </td> </tr> <tr style="line-height: normal; "> <td valign="top" rowspan="5" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"com.cnn.www"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t9</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="right" style="line-height: normal; text-align: right; "><span style="line-height: normal; font-size: 9pt; ">"anchor:cnnsi.com"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"CNN"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t8</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="right" style="line-height: normal; text-align: right; "><span style="line-height: normal; font-size: 9pt; ">"anchor:my.look.ca"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"CNN.com"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t6</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"text/html"</span></p> </td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t5</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t3</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "></td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 0.75pt; padding-left: 0.75pt; padding-bottom: 0.75pt; padding-top: 0.75pt; "></td> </tr> </tbody> </table> <p style="line-height: normal; text-indent: 21pt; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">涓婅〃涓湁涓鍒楋紝鍒楃殑鍞竴鏍囪瘑涓?/span>com.cnn.www<span style="line-height: normal; ">錛屾瘡涓嬈¢昏緫淇敼閮芥湁涓涓?/span>timestamp<span style="line-height: normal; ">鍏寵仈瀵瑰簲錛屼竴鍏辨湁鍥涗釜鍒楀畾涔夛細</span><contents:>,<anchor:cnnsi.com>,<anchor:my.look.ca>,<mime:><span style="line-height: normal; ">銆傚鏋滅敤浼犵粺鐨勬蹇墊潵灝?/span>BigTable<span style="line-height: normal; ">浣滆В閲婏紝閭d箞</span>BigTable<span style="line-height: normal; ">鍙互鐪嬩綔涓涓?/span>DB Schema<span style="line-height: normal; ">錛屾瘡涓涓?/span>Row<span style="line-height: normal; ">灝辨槸涓涓〃錛?/span>Row key<span style="line-height: normal; ">灝辨槸琛ㄥ悕錛岃繖涓〃鏍規(guī)嵁鍒楃殑涓嶅悓鍙互鍒掑垎涓哄涓増鏈紝鍚屾椂姣忎釜鐗堟湰鐨勬搷浣滈兘浼氭湁鏃墮棿鎴沖叧鑱斿埌鎿嶄綔鐨勮銆?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">鍐嶇湅涓涓?/span>HBASE<span style="line-height: normal; ">鐨勭墿鐞嗘暟鎹ā鍨嬶細</span></p> <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto; line-height: normal; border-collapse: collapse; color: #555b6e; font-family: Arial; font-size: 12px; "> <tbody style="line-height: normal; "> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Row Key</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Time Stamp</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"contents:"</em></span></p> </td> </tr> <tr style="line-height: normal; "> <td valign="top" rowspan="3" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"com.cnn.www"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t6</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t5</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t3</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"<html>..."</span></p> </td> </tr> </tbody> </table> <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto; line-height: normal; border-collapse: collapse; color: #555b6e; font-family: Arial; font-size: 12px; "> <tbody style="line-height: normal; "> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Row Key</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Time Stamp</span></strong></p> </td> <td colspan="2" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"anchor:"</em></span></p> </td> </tr> <tr style="line-height: normal; "> <td valign="top" rowspan="2" style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"com.cnn.www"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t9</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="right" style="line-height: normal; text-align: right; "><span style="line-height: normal; font-size: 9pt; ">"anchor:cnnsi.com"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"CNN"</span></p> </td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t8</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="right" style="line-height: normal; text-align: right; "><span style="line-height: normal; font-size: 9pt; ">"anchor:my.look.ca"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"CNN.com"</span></p> </td> </tr> </tbody> </table> <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" border="0" style="table-layout: auto; line-height: normal; border-collapse: collapse; color: #555b6e; font-family: Arial; font-size: 12px; "> <tbody style="line-height: normal; "> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Row Key</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Time Stamp</span></strong></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><strong style="line-height: normal; "><span style="line-height: normal; font-size: 9pt; ">Column</span></strong><span style="line-height: normal; font-size: 9pt; "> <em style="line-height: normal; ">"mime:"</em></span></p> </td> </tr> <tr style="line-height: normal; "> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="left" style="line-height: normal; text-align: left; "><span style="line-height: normal; font-size: 9pt; ">"com.cnn.www"</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">t6</span></p> </td> <td style="font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: normal; padding-right: 3pt; padding-left: 3pt; padding-bottom: 3pt; padding-top: 3pt; "> <p align="center" style="line-height: normal; text-align: center; "><span style="line-height: normal; font-size: 9pt; ">"text/html"</span></p> </td> </tr> </tbody> </table> <p style="line-height: normal; text-indent: 21pt; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">鐗╃悊鏁版嵁妯″瀷鍏跺疄灝辨槸灝嗛昏緫妯″瀷涓殑涓涓?/span>Row<span style="line-height: normal; ">鍒嗗壊鎴愪負鏍規(guī)嵁</span>Column family<span style="line-height: normal; ">瀛樺偍鐨勭墿鐞嗘ā鍨嬨?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">瀵逛簬</span>BigTable<span style="line-height: normal; ">鐨勬暟鎹ā鍨嬫搷浣滅殑鏃跺欙紝浼氶攣瀹?/span>Row<span style="line-height: normal; ">錛屽茍淇濊瘉</span>Row<span style="line-height: normal; ">鐨勫師瀛愭搷浣溿?/span></p> <h3 style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: 27px; font-size: 12pt; ">妗嗘灦緇撴瀯鍙婃祦紼?/span></h3> <p align="center" style="line-height: normal; text-align: center; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; font-size: 9pt; "><img height="587" src="http://www.tkk7.com/images/blogjava_net/cenwenchu/HBASE.GIF" width="593" border="0" style="line-height: normal; " alt="" /><br style="line-height: normal; " /> 鍥?/span><span style="line-height: normal; font-size: 9pt; ">1 </span><span style="line-height: normal; font-size: 9pt; ">妗嗘灦緇撴瀯鍥?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       HBASE<span style="line-height: normal; ">渚濇墭浜?/span>Hadoop<span style="line-height: normal; ">鐨?/span>HDFS<span style="line-height: normal; ">浣滀負瀛樺偍鍩虹錛屽洜姝ょ粨鏋勪篃寰堢被浼間簬</span>Hadoop<span style="line-height: normal; ">鐨?/span>Master-Slave<span style="line-height: normal; ">妯″紡錛?/span>Hbase Master Server <span style="line-height: normal; ">璐熻矗綆$悊鎵鏈夌殑</span>HRegion Server<span style="line-height: normal; ">錛屼絾</span>Hbase Master Server<span style="line-height: normal; ">鏈韓騫朵笉瀛樺偍</span>HBASE<span style="line-height: normal; ">涓殑浠諱綍鏁版嵁銆?/span>HBASE<span style="line-height: normal; ">閫昏緫涓婄殑</span>Table<span style="line-height: normal; ">琚畾涔夋垚涓轟竴涓?/span>Region<span style="line-height: normal; ">瀛樺偍鍦ㄦ煇涓鍙?/span>HRegion Server<span style="line-height: normal; ">涓婏紝</span>HRegion Server<span style="line-height: normal; ">涓?/span>Region<span style="line-height: normal; ">鐨勫搴斿叧緋繪槸涓瀵瑰鐨勫叧緋匯傛瘡涓涓?/span>HRegion<span style="line-height: normal; ">鍦ㄧ墿鐞嗕笂浼氳鍒嗕負涓変釜閮ㄥ垎錛?/span>Hmemcache<span style="line-height: normal; ">銆?/span>Hlog<span style="line-height: normal; ">銆?/span>HStore<span style="line-height: normal; ">錛屽垎鍒唬琛ㄤ簡緙撳瓨錛屾棩蹇楋紝鎸佷箙灞傘傞氳繃涓嬈℃洿鏂版祦紼嬫潵鐪嬩竴涓嬭繖涓夐儴鍒嗙殑浣滅敤錛?br style="line-height: normal; " /> </span></p> <p align="center" style="line-height: normal; text-align: center; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; font-size: 9pt; "><img height="483" src="http://www.tkk7.com/images/blogjava_net/cenwenchu/HbaseCommit.GIF" width="723" border="0" style="line-height: normal; " alt="" /><br style="line-height: normal; " /> 鍥?/span><span style="line-height: normal; font-size: 9pt; ">2 </span><span style="line-height: normal; font-size: 9pt; ">鎻愪氦鏇存柊浠ュ強鍒鋒柊</span><span style="line-height: normal; font-size: 9pt; ">Cache</span><span style="line-height: normal; font-size: 9pt; ">嫻佺▼</span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       <span style="line-height: normal; ">鐢辨祦紼嬪彲浠ョ湅鍑猴紝鎻愪氦鏇存柊鎿嶄綔灝嗕細鍐欏叆鍒頒袱閮ㄥ垎瀹炰綋涓紝</span>HMemcache<span style="line-height: normal; ">鍜?/span>Hlog<span style="line-height: normal; ">涓紝</span>HMemcache<span style="line-height: normal; ">灝辨槸涓轟簡鎻愰珮鏁堢巼鍦ㄥ唴瀛樹腑寤虹珛緙撳瓨錛屼繚璇佷簡閮ㄥ垎鏈榪戞搷浣滆繃鐨勬暟鎹兘澶熷揩閫熺殑琚鍙栧拰淇敼錛?/span>Hlog<span style="line-height: normal; ">鏄綔涓哄悓姝?/span>Hmemcache<span style="line-height: normal; ">鍜?/span>Hstore<span style="line-height: normal; ">鐨勪簨鍔℃棩蹇楋紝鍦?/span>HRegion Server<span style="line-height: normal; ">鍛ㄦ湡鎬х殑鍙戣搗</span>Flush Cache<span style="line-height: normal; ">鍛戒護鐨勬椂鍊欙紝灝變細灝?/span>Hmemcache<span style="line-height: normal; ">涓殑鏁版嵁鎸佷箙鍖栧埌</span>Hstore<span style="line-height: normal; ">涓紝鍚屾椂浼氭竻絀?/span>Hmemecache<span style="line-height: normal; ">涓殑鏁版嵁錛岃繖閲岄噰鐢ㄧ殑鏄瘮杈冪畝鍗曠殑絳栫暐鏉ュ仛鏁版嵁緙撳瓨鍜屽悓姝ワ紝澶嶆潅涓浜涘叾瀹炲彲浠ュ弬鐓?/span>java<span style="line-height: normal; ">鐨勫瀮鍦炬敹闆嗘満鍒舵潵鍋氥?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       <span style="line-height: normal; ">鍦ㄨ鍙?/span>Region<span style="line-height: normal; ">淇℃伅鐨勬椂鍊欙紝浼樺厛璇誨彇</span>HMemcache<span style="line-height: normal; ">涓殑鍐呭錛屽鏋滄湭鍙栧埌鍐嶅幓璇誨彇</span>Hstore<span style="line-height: normal; ">涓殑鏁版嵁銆?/span></p> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: normal; ">鍑犱釜緇嗚妭錛?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">1錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span><span style="line-height: normal; ">鐢變簬姣忎竴嬈?/span>Flash Cache<span style="line-height: normal; ">錛屽氨浼氫駭鐢熶竴涓?/span>Hstore File<span style="line-height: normal; ">錛屽湪</span>Hstore<span style="line-height: normal; ">涓瓨鍌ㄧ殑鏂囦歡浼氳秺鏉ヨ秺澶氾紝瀵規(guī)ц兘涔熶細浜х敓涓瀹氬獎鍝嶏紝鍥犳杈懼埌璁劇疆鏂囦歡鏁伴噺闃鍊肩殑鏃跺欏氨浼?/span>Merge<span style="line-height: normal; ">榪欎簺鏂囦歡涓轟竴涓ぇ鏂囦歡銆?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">2錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span>Cache<span style="line-height: normal; ">澶у皬鐨勮緗互鍙?/span>flush<span style="line-height: normal; ">鐨勬椂闂撮棿闅旇緗渶瑕佽冭檻鍐呭瓨娑堣椾互鍙婂鎬ц兘鐨勫獎鍝嶃?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">3錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span>HRegion Server<span style="line-height: normal; ">姣忔閲嶆柊鍚姩鐨勬椂鍊欎細灝?/span>Hlog<span style="line-height: normal; ">涓病鏈夎</span>Flush<span style="line-height: normal; ">鍒?/span>Hstore<span style="line-height: normal; ">涓殑鏁版嵁鍐嶆杞藉叆鍒?/span>Hmemcache<span style="line-height: normal; ">錛屽洜姝?/span>Hmemcache<span style="line-height: normal; ">榪囧ぇ瀵逛簬鍚姩鐨勯熷害涔熸湁鐩存帴褰卞搷銆?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">4錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span>Hstore File<span style="line-height: normal; ">涓瓨鍌ㄦ暟鎹噰鐢?/span>B-tree<span style="line-height: normal; ">鐨勭畻娉曪紝鍥犳涔熸敮鎸佷簡鍓嶉潰鎻愬埌瀵逛簬</span>Column<span style="line-height: normal; ">鍚?/span>Family<span style="line-height: normal; ">鏁版嵁鎿嶄綔鐨勫揩閫熷畾浣嶈幏鍙栥?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">5錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span>HRegion<span style="line-height: normal; ">鍙互</span>Merge<span style="line-height: normal; ">涔熷彲浠ヨ</span>Split<span style="line-height: normal; ">錛屾牴鎹?/span>HRegion<span style="line-height: normal; ">鐨勫ぇ灝忓喅瀹氥備笉榪囧湪鍋氳繖浜涙搷浣滅殑鏃跺?/span>HRegion<span style="line-height: normal; ">閮戒細琚攣瀹氫笉鍙嬌鐢ㄣ?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">6錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span>Hbase Master Server<span style="line-height: normal; ">閫氳繃</span>Meta-info Table<span style="line-height: normal; ">鏉ヨ幏鍙?/span>HRegion Server<span style="line-height: normal; ">鐨勪俊鎭互鍙?/span>Region<span style="line-height: normal; ">鐨勪俊鎭紝</span>Meta<span style="line-height: normal; ">鏈欏墮儴鐨勪竴涓?/span>Region<span style="line-height: normal; ">鏄櫄鎷熺殑涓涓彨鍋?/span>Root Region<span style="line-height: normal; ">錛岄氳繃</span>Root Region<span style="line-height: normal; ">鍙互鎵懼埌涓嬮潰鍚勪釜瀹為檯鐨?/span>Region<span style="line-height: normal; ">銆?/span></p> <p style="line-height: normal; margin-left: 57.75pt; text-indent: -36.75pt; color: #555b6e; font-family: Arial; font-size: 12px; ">7錛?span style="line-height: normal; font: normal normal normal 7pt/normal 'Times New Roman'; ">              </span><span style="line-height: normal; ">瀹㈡埛绔氳繃</span>Hbase Master Server<span style="line-height: normal; ">鑾峰緱浜?/span>Region<span style="line-height: normal; ">鎵鍦ㄧ殑</span>Region Server<span style="line-height: normal; ">錛岀劧鍚庡氨鐩存帴鍜?/span>Region Server<span style="line-height: normal; ">榪涜浜や簰錛岃屽浜?/span>Region Server<span style="line-height: normal; ">鐩鎬簰涔嬮棿涓嶉氫俊錛屽彧鍜?/span>Hbase Master Server<span style="line-height: normal; ">浜や簰錛屽彈鍒?/span>Master Server<span style="line-height: normal; ">鐨勭洃鎺у拰綆$悊銆?/span></p> <h3 style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; "><span style="line-height: 27px; font-size: 12pt; ">鍚庤瘽</span></h3> <p style="line-height: normal; color: #555b6e; font-family: Arial; font-size: 12px; ">       <span style="line-height: normal; ">瀵?/span>HBase<span style="line-height: normal; ">榪樻病鏈夋庝箞浣跨敤錛屼粎浠呭彧鏄湅浜?/span>wiki<span style="line-height: normal; ">鍘諱簡瑙d簡涓涓嬬粨鏋勫拰浣滅敤錛屾殏鏃惰繕娌℃湁闇瑕佷嬌鐢ㄧ殑鍦烘櫙錛屼笉榪囧浜庡悇縐嶅紑婧愰」鐩殑璁捐鏈夋墍浜嗚В錛屽鑷繁鐨勬鏋剁粨鏋勮璁′篃浼氭湁寰堝甯姪錛屽洜姝ゅ垎浜竴涓嬨?/span></p> </div> <img src ="http://www.tkk7.com/hengheng123456789/aggbug/341449.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">鍝煎摷</a> 2010-12-24 11:46 <a href="http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341449.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>NoSQL鏁版嵁搴撶瑪璋坴0.2錛堣漿錛?/title><link>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341430.html</link><dc:creator>鍝煎摷</dc:creator><author>鍝煎摷</author><pubDate>Fri, 24 Dec 2010 01:36:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341430.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/341430.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341430.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/341430.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/341430.html</trackback:ping><description><![CDATA[     鎽樿: 杞嚜錛歨ttp://www.yankay.com/nosql鏁版嵁搴撶瑪璋坴0-2/ 鏈榪戠爺絀禢OSQL錛屽彂鐜版鏂囩珷錛屽叡浜箣銆? 鏃ュ墠鍥藉唴娌℃湁涓濂楁瘮杈冨畬鏁寸殑NoSQL鏁版嵁搴撹祫鏂欙紝鏈夊緢澶氬厛椹辨暣鐞嗗彂琛ㄤ簡寰堝錛屼絾涓嶆槸寰堢郴緇熴備笉鏉愬皾璇曠潃灝嗗悇瀹剁殑璧勬枡鏁村悎涓涓嬶紝騫朵功鍐欎簡涓浜涜嚜宸辯殑瑙佽В銆?鏈功鍐欎簡涓浜涚洰鍓嶇殑NoSql鐨勪竴浜涗富瑕佹妧鏈紝綆楁硶鍜屾濇兂銆傚悓鏃跺垪涓句簡澶ч噺鐨勭幇鏈夌殑鏁版嵁搴撳疄渚嬨傝瀹屽叏綃囷紝鐩鎬俊璇昏呬細瀵筃oSQ...  <a href='http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341430.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/hengheng123456789/aggbug/341430.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">鍝煎摷</a> 2010-12-24 09:36 <a href="http://www.tkk7.com/hengheng123456789/archive/2010/12/24/341430.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>NoSQL錛堣漿錛?/title><link>http://www.tkk7.com/hengheng123456789/archive/2010/12/20/341144.html</link><dc:creator>鍝煎摷</dc:creator><author>鍝煎摷</author><pubDate>Mon, 20 Dec 2010 03:35:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2010/12/20/341144.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/341144.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2010/12/20/341144.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/341144.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/341144.html</trackback:ping><description><![CDATA[     鎽樿: 杞嚜錛歨ttp://baike.baidu.com/view/2677528.htm 綆浠?銆銆NoSQL錛屾剰鍗沖弽SQL榪愬姩錛屾槸涓欏瑰叏鏂扮殑鏁版嵁搴撻潻鍛芥ц繍鍔紝鏃╂湡灝辨湁浜烘彁鍑猴紝鍙戝睍鑷?009騫磋秼鍔胯秺鍙戦珮娑ㄣ侼oSQL鐨勬嫢鎶よ呬滑鎻愬¤繍鐢ㄩ潪鍏崇郴鍨嬬殑鏁版嵁瀛樺偍錛岀浉瀵逛簬鐩墠閾哄ぉ鐩栧湴鐨勫叧緋誨瀷鏁版嵁搴撹繍鐢紝榪欎竴姒傚康鏃犵枒鏄竴縐嶅叏鏂扮殑鎬濈淮鐨勬敞鍏ャ? 緙栬緫鏈鐜頒粖鐘跺喌 銆銆鐜頒粖鐨勮綆楁満浣撶郴緇撴瀯鍦ㄦ暟鎹瓨鍌ㄦ柟闈㈣...  <a href='http://www.tkk7.com/hengheng123456789/archive/2010/12/20/341144.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/hengheng123456789/aggbug/341144.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">鍝煎摷</a> 2010-12-20 11:35 <a href="http://www.tkk7.com/hengheng123456789/archive/2010/12/20/341144.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Agile Database Refactoring with Hibernatehttp://www.tkk7.com/hengheng123456789/archive/2007/09/03/142403.html鍝煎摷鍝煎摷Mon, 03 Sep 2007 09:47:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2007/09/03/142403.htmlhttp://www.tkk7.com/hengheng123456789/comments/142403.htmlhttp://www.tkk7.com/hengheng123456789/archive/2007/09/03/142403.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/142403.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/142403.htmlGilad Buzi, Kelley Glenn, Jonathan Novich
06/11/2007

Your data model was near perfect when your application was first written. Since then, it has evolved. You've hacked, you've denormalized, and, as a result, you've spent countless hours in meetings ranting about the fixes you need to put in place.

Yet, you're ambivalent. Despite your cogent arguments, you're loath to putting together the "change-all-your-data-all-at-once" plan. It's just too risky. There are countless applications that directly read from and write to your database--you can't change all of them at once! If only you could only fix your data model one piece at a time, and one application at a time.

It's a typical scenario, really. Over time, IT organizations at small, medium, and large enterprises create disparate applications that access vital data stored in a centralized database. And slowly, moderately ill-designed data models start dragging down performance, scalability, and the overall efficiency of an organization.

In this article, we will show readers how to upgrade their faulty schemas and data models without affecting existing applications or processes. By using the latest technology from Hibernate (version 3.0 and up)--along with a combination of database views, stored procedures, and standard design patterns--application developers and data architects can repair a faulty data model, one piece at a time.

Steps to Follow

Here's how we'll do it:

  1. Dream up an improved data model: Agree on what's wrong with the current model and how you could fix it
  2. Develop database views: Based on the current (faulty) model, these views reflect how you would like your data model to be
  3. Develop stored procedures or "instead of" triggers: These will replace a standard table insert
  4. Develop POJOs, Hibernate mappings, and DAOs: Represent your new data model and tie it to your views
  5. Test, test, test: Prove your data model right

Now let's dive into the details of each one of these steps. But first, let's present the example at hand.

Our example is an overly denormalized order system. Instead of dividing the orders into an ORDER table and an ORDER_ITEM table, the original data designer decided to put all order information into one table, CUST_ORDER. We'd love to split this table into two, but how?

Figure 1 shows the original design.

figure
Figure 1. Our data model before the DMA solution

Ok, let's get fixin'!

Dream Up an Improved Data Model

We decided that we could really split this up fairly easily. It'd be great to achieve something like in Figure 2.

figure
Figure 2. Our data model including the views that improve the overall design

By dividing the order data into two tables, we avoid data repetition and have a generally more sustainable data model. But how can we arrive at this model given our existing data structure?

Communication is key. Although this has little to do with coding and testing, it is an important point. Make sure to involve all stakeholders in the new design of your data model. This includes developers working on other applications that access this data, database administrators who will have to maintain the new data model, and finally technical managers and technical business analysts who may have their own ideas about where the data model should go. We really can't say enough about how important communication is.

Develop Database Views

To achieve our desired structure, we can define database views on top of our existing schema that use the current data in our overly denormalized table(s). Our views, however, will present this data in a normalized way. The ORDER_V view is really just a grouped and simplified version of the CUST_ORDER table (removing specific order item information and grouping by the order_id). Here's the definition:

CREATE VIEW dma_example.order_v
AS select
dma_example.cust_order.order_id AS order_id,
dma_example.cust_order.order_cust AS order_cust,
max(dma_example.cust_order.order_date) AS order_date
from dma_example.cust_order
group by dma_example.cust_order.order_id;

The ORDER_ITEM_V view captures only the order item details, ignoring the customer id and the date (information that can be obtained from the ORDER_V view). Here's the ORDER_ITEM_V's definition:

CREATE VIEW dma_example.order_item_v
AS select
dma_example.cust_order.order_id AS oi_order,
dma_example.cust_order.order_item AS oi_item,
dma_example.cust_order.order_item_price AS oi_price,
dma_example.cust_order.order_item_qty AS oi_qty
from dma_example.cust_order
where (dma_example.cust_order.order_item is not null);

So what we've basically done is split one table into two.

Stored Procedures or INSTEAD OF Triggers

We now want to be able to treat our new views as if they were tables--inserting, updating, and deleting to our hearts' content without actually worrying about what is going on behind the scenes. Although some views may be directly updatable without any further intervention on the part of the database designer, our views are a little more complex, and we want to make sure we control exactly how the database will affect the underlying (CUST_ORDER) table. The best way to do this is to define code on the database that will execute every time we try to execute one of these CUD operations against our views.


In most databases (MS SQL Server, Sybase, Oracle, DB2), we can define INSTEAD OF triggers (PostreSQL uses "rules" that behave similarly) that will be responsible for inserting, updating, and deleting records from the underlying table from which the view is defined. MySQL, however, does not currently support INSTEAD OF triggers. In their place, we can create stored procedures and, through careful configuration of Hibernate mapping files, call these stored procedures every time a CUD operation is triggered in our code (and persisted by Hibernate). Be it stored procedures or instead of triggers, the code is very similar.

Since our example uses MySQL, we will demonstrate our solution using stored procedures.

The code

Our stored procedures for inserting, updating, and deleting into our denormalized table must take into account all aspects of the denormalization: repetitive rows, additional fields, superfluous values, etc. When we use these stored procedures, the data model we created with the definition of nice, normalized views is turned back into the flawed, denormalized structure. Why? Because the rest of our applications are expecting the data to be presented in this way. In addition, our view definitions rely on the data to exist in the current structure.

So what does one of these procedures look like? Here's an example of inserting an item to the order:

create procedure insert_order_item
(in itemprice FLOAT, in itemqty INT, in orderid INT, in itemid INT)
LANGUAGE SQL
BEGIN
DECLARE p_order_id INT;
DECLARE p_cust_id INT;
DECLARE max_order_id INT;
DECLARE p_itemprice FLOAT;
-- apply the current price to the line item
if itemprice is null then
select prod_price into p_itemprice from product where prod_id=itemid;
else
set p_itemprice = itemprice;
end if;
-- get the customer id.
select order_cust into p_cust_id
from cust_order where order_id=orderid limit 1;
insert into cust_order
(order_id, order_cust, order_date,
order_item, order_item_price, order_item_qty)
values
(orderid, p_cust_id, now(), itemid, p_itemprice, itemqty);
END

Notice that whatever data is usually missing from the ORDER_ITEM_V view has to be sought out and inserted in the underlying CUST_ORDER table. This procedure, if successful in inserting into the CUST_ORDER table, will return the number of rows affected as 1. It is important to note that Hibernate expects either 1 or 0 as a result of these stored procedures, since it treats them as single rows in tables (even though they are really views). To ensure that this happens, we might have to throw little tricks into our stored procedures. For instance, the stored procedure to update an order may affect various rows in the CUST_ORDER table (one row for every order item). If we were to simply update all the rows with the given order ID, the rows' affected value returned would be greater than 1. Since this would present a problem for Hibernate, we use a small table and update it after the update to the CUST_ORDER table. This causes the stored procedure to return 1 as the number of affected rows (since the update we executed only affects one row). Here is what the stored procedure looks like:

create procedure update_order
(in ordercust INT, in orderdate DATETIME, in orderid INT)
LANGUAGE SQL
BEGIN
update cust_order set order_cust=ordercust,
order_date=orderdate
where order_id=orderid;
if row_count() > 0 then
update help_table set i=i+1;
end if;
END

POJOs, Hibernate Mappings, and DAOs

Creating the POJOs and Hibernate mappings for your new, view-based data model is fairly straightforward. There are, however, a couple of gotchas to keep in mind here.

Virtual foreign and primary keys

Although database views do not have foreign and primary keys, you should still map these in your solution's mapping file. This allows other developers to treat this new data model as if it were a true physical model. Furthermore, mapping these elements will ensure an almost seamless transition when you move on to a final solution based on real tables.

Overriding insert, update, and delete

When using stored procedures (you do not need to do this if your solution is implementing instead of triggers), you must override the insert, update, and delete calls with calls to your stored procedures. This is done by adding <sql-insert>, <sql-update> and <sql-delete> elements to the mapping. These elements tell Hibernate to call the given procedures instead of inserting, updating, and deleting directly to the database. Here is the ORDER_V mapping:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.onjava.shared.vo.Order" table="order_v" catalog="dma_example">
<id name="orderId" type="int" column="order_id" />
<property name="orderCust" type="int" column="order_cust" />
<property name="orderDate" type="timestamp" column="order_date" length="19"/>
<set name="items" inverse="true" cascade="all-delete-orphan" lazy="true">
<key column="oi_order"/>
<one-to-many class="org.onjava.shared.vo.OrderItem" />
</set>
<sql-insert callable="true">{call insert_order(?, ?, ?)}</sql-insert>
<sql-update callable="true">{call update_order(?, ?, ?)}</sql-update>
<sql-delete callable="true">{call delete_order(?)}</sql-delete>
</class>
</hibernate-mapping>

The parameter order is important here. Refer to the custom SQL reference of the Hibernate manual to determine the parameter order in your stored procedures.

Data access objects

Once the right mapping is in place, the data access objects for the view-based data model are identical to table-based models. Hibernate takes care of executing the stored procedures and treats the views much like tables. See this article's sample DMA solution for complete data access classes for the ORDER_V and ORDER_ITEM_V views.


Test, Test, Test

Extensive testing is one of the most important activities during the creation of a DMA solution. Only thorough testing can ensure a correctly functioning view-based (logical) data model. All aspects of the new data model must be explored in tests. And, of course, it is imperative to test both working cases and failing cases.


A great aid in automating testing is DBUnit. Although we won't go into great detail on how DBUnit works (a great OnJava article by Andrew Glover already does that) a couple of important pointers should be noted:

  • Data diversity: Make sure your test data clearly reflects all sorts of different data scenarios, including foreign key relationships and null values.
  • Dataset size: Although it is important to maintain a large enough data set to support all of your tests, keep in mind that DBUnit empties and reloads your data during every test method. Large data sets may lead to slow testing.

As far as the tests themselves, look at them as a way to exercise your DAOs and value objects. Here are some of the kinds of tests we recommend. For a closer look at the implementation, look at the sample code included with this article.

  • Find All: Make sure the DAO returns the expected number of rows.
  • Find one: Look up a record using the virtual primary key and make sure the correct record is returned with all the expected (column) values in place.
  • Insert: Insert a record and verify it has been inserted.
  • Insert multiple records: Make sure inserting is working for more than one skill at a time.
  • Insert duplicates: Attempt to violate the virtual primary key constraint.
  • Delete: Delete a record and verify that it has really been deleted.
  • Delete multiples: Do so only if your DAO design supports doing this.
  • Update: Update and make sure the update has been persisted to the DB.
  • Violate constraints: Make sure all possible virtual constraint conditions are tested.
  • Optimistic locking: There are several ways to generate optimistic locking exceptions. All of these should be attempted in order to verify the correct functioning of the optimistic locking exception mechanism. Four different kinds of optimistic locking conditions should be tested:
    • Delete a record when a record has already been deleted.
    • Delete a record when it has been updated since the last fetch (only possible if you are maintaining a version column).
    • Update a record that has been deleted.
    • Update a record that has been updated since the last fetch (only possible if you are maintaining a version column).

Once you have completed all of these tests, you can be confident that your new data model is fairly bomb-proof.

Peaceful Coexistence

Now that you have upgraded your application to use a sane data model, keep in mind that other applications will be accessing the same data using slightly different points of contact. This shouldn't worry you, it's just something to keep in mind. Figure 3 demonstrates how your new and improved application lives peacefully alongside the existing legacy applications.

figure
Figure 3. A legacy application and the DMA solution coexisting peacefully and manipulating the same data set albeit through different models

Now What? Migration to a Permanent Data Model

So you've implemented this fancy solution to fix your data model. As the months go by, developers update their applications and begin to use this new view-based data model. But the underlying denormalization (or whatever faulty design exists) is still there, and you want to get rid of it. But how? It's actually simpler than you might think. Here is the step-by-step guide:

  1. Develop tables: These will look much like your views, but will have real foreign keys and indexes. Make sure to maintain the same column names as the views themselves.
  2. Load tables: You will load the tables with data from your already existing views. Select from view into table. It's really that simple.
  3. Modify your mappings: Change your Hibernate mappings to reflect the table names instead of the views and, if you used stored procedures, get rid of the <sql-insert>, <sql-update> and <sql-delete> elements (since now you won't need them).
  4. Test, test, test: Your original tests should work with absolutely no modification. Run them over and over again to prove that.

Voila! If you've done things right, not a single line of Java code needs to be modified, and your applications will behave exactly the same. This is where the true beauty of this kind of solution is evident. By abstracting the data model through Hibernate and database procedures, you can achieve an impressive change with little effort. Of course, this doesn't mean that you shouldn't retest everything thoroughly--the good news is that your tests are still totally valid as well (if you are using XML data sets, make sure to replace the view name with the table name).

Conclusion

Using some of the latest and greatest Hibernate technologies, Java testing methodologies, and smart use of your databases resources, we have shown you that iterative change is possible. What is magical about solving data model problems this way is that the solution is mutually inclusive. This means that while you have solved the problem for yourself (in your application), other applications accessing the same data can continue to operate fine until they wise up and jump on your corrected bandwagon. It's a really friendly approach to data model migration.

As a final note, we would like to remind you to keep the following in mind when implementing your solution:

  • Zero impact: DMA solutions must not affect current applications or processes. This means that while records are modified in the new (virtual) data model, the existing set of data (in the faulty data model) must reflect the change.
  • Maintain functionality: While a new data model may eliminate the importance of certain data columns, it is important to simultaneously maintain the old behavior. Calculated fields are a perfect example of this. If a legacy application calculates a field before insertion, but the new data model doesn't even include the field, the DMA solution must respect the old behavior and calculate (and insert) the field.
  • Testing for complete confidence: DMA solutions that are created must be thoroughly tested in order to provide confidence that the new schema is as solid as a direct database schema is. The DMA pattern may not be a straightforward mapping of tables and columns, and is therefore vulnerable to bugs. The challenge then, is in testing the solution and making sure it adheres to complete ACID principles.

Resources

Gilad Buzi has been involved in data driven application development for over ten years. He is currently a Principal Software Engineer with The Code Works Inc.

Kelley Glenn has worked in the software development industry for more than 10 years, with experience in telephony billing and enterprise application integration.

Jonathan Novich is co-founder and partner at The Code Works, Inc. with more than 10 years of experience in software consulting and development.



鍝煎摷 2007-09-03 17:47 鍙戣〃璇勮
]]>
ibatis 寮鍙戞寚鍗?/title><link>http://www.tkk7.com/hengheng123456789/archive/2007/09/03/142321.html</link><dc:creator>鍝煎摷</dc:creator><author>鍝煎摷</author><pubDate>Mon, 03 Sep 2007 07:33:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2007/09/03/142321.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/142321.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2007/09/03/142321.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/142321.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/142321.html</trackback:ping><description><![CDATA[     鎽樿:   ibatis 寮鍙戞寚鍗?http://www.360doc.com/showWeb/0/0/262045.aspx 鐩稿Hibernate鍜孉pache OJB 絳?#8220;涓绔欏紡”ORM瑙e喅鏂規(guī)鑰岃█錛宨batis 鏄竴縐?#8220;鍗婅嚜鍔ㄥ寲”鐨凮RM瀹炵幇銆?鎵璋?#8220;鍗婅嚜鍔?#8221;錛屽彲鑳界悊瑙d笂鏈夌偣鐢熸訂銆傜旱瑙傜洰鍓嶄富嫻佺殑ORM錛屾棤璁篐...  <a href='http://www.tkk7.com/hengheng123456789/archive/2007/09/03/142321.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/hengheng123456789/aggbug/142321.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">鍝煎摷</a> 2007-09-03 15:33 <a href="http://www.tkk7.com/hengheng123456789/archive/2007/09/03/142321.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>osql鎵瑰鐞唌s sqlserver 鑴氭湰鐨勮鍙?/title><link>http://www.tkk7.com/hengheng123456789/archive/2007/02/07/98571.html</link><dc:creator>鍝煎摷</dc:creator><author>鍝煎摷</author><pubDate>Wed, 07 Feb 2007 05:10:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2007/02/07/98571.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/98571.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2007/02/07/98571.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/98571.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/98571.html</trackback:ping><description><![CDATA[聽聽聽鎴戜滑鍦ㄥ疄闄呴」鐩簲鐢ㄤ腑緇忓父浼氶亣鍒版墽琛屽緢澶歋QL鑴氭湰璇彞鐨勬儏鍐碉紝浣嗘槸濡傛灉SQL鑴氭湰鏂囦歡榪囧ぇ錛孧S SqlServer 鐨勬煡璇㈠垎鏋愬櫒浼氭嫆緇濇墦寮錛岃繖鏃跺欐垜浠氨鍙互浣跨敤osql 鍛戒護鏉ュ鐞嗐?br /><br />1銆佸亣璁捐剼鏈枃浠朵負create-sql-server.sql錛屽茍涓斿湪鐩綍C:\Program Files\Microsoft SQL Server\80\Tools\Binn涓?br /><br />2銆佽繘鍏ョ洰褰旵:\Program Files\Microsoft SQL Server\80\Tools\Binn銆?br /><br />3銆佹墽琛屽涓嬪懡浠わ細<br /><br />C:\Program Files\Microsoft SQL Server\80\Tools\Binn>osql -U sa -P sa -S 127.0.0.1 -d NorthWind -i create-sql-server.sql<br /><br />-U 鐢ㄦ埛鍚?br />-P 瀵嗙爜<br />-S 鏈哄櫒IP<br />-d 鏁版嵁搴撳悕縐?br />-i 鑴氭湰鏂囦歡鍚嶇О<br /><img src ="http://www.tkk7.com/hengheng123456789/aggbug/98571.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">鍝煎摷</a> 2007-02-07 13:10 <a href="http://www.tkk7.com/hengheng123456789/archive/2007/02/07/98571.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MySql涔?.0浣跨敤蹇冨緱http://www.tkk7.com/hengheng123456789/archive/2007/01/10/92967.html鍝煎摷鍝煎摷Wed, 10 Jan 2007 09:07:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2007/01/10/92967.htmlhttp://www.tkk7.com/hengheng123456789/comments/92967.htmlhttp://www.tkk7.com/hengheng123456789/archive/2007/01/10/92967.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/92967.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/92967.html聽聽聽鍓嶄袱澶╁緢鏄嬌鐢ㄤ簡涓鎶奙ySql錛岀増鏈槸5.0.27錛屽瀛楃闆嗙殑璁劇疆銆佸瓨鍌ㄨ繃紼嬬殑寤虹珛銆佽Е鍙戝櫒鐨勫緩绔嬮鏈夊績寰楋紝鐜頒笌澶у鍒嗕韓瀹炰緥銆?br />
1銆佸瓧絎﹂泦鐨勮緗?br />
聽聽聽a銆侀鍏堝畨瑁匨ySql5.0.27錛屾敞鎰忥紒鏄痵etup瀹夎錛屼笉鏄厤瀹夎鐗堛傦紙濡備綍璁劇疆鍏嶅畨瑁呯増鐨勫瓧絎﹂泦淇鴻繕涓嶄細錛?br />
聽聽聽b銆佽繍琛孧ySql Server Instance Configuration Wizard錛屽湪please select the default character set欏甸潰閫夋嫨Menual Selected Default Character Set / Collation錛屽茍鍦–haracter Set:涓嬫媺妗嗕腑閫夋嫨gb2312錛堢粡嫻嬭瘯錛屼粠MS SQL Server涓鍏ヤ腑鏂囧瓧絎︽槸鎴愬姛鐨勩傦級

聽聽聽c銆佺劧鍚庡惎鍔∕ySql鏈嶅姟鍗沖彲錛?br />
2銆佸瓨鍌ㄨ繃紼嬬殑寤虹珛

聽聽聽a銆佷負浜嗘柟渚挎墽琛宻ql璇彞錛屾垜寤鴻瀹夎MySQL GUI Tools 5.0鐨勫彲瑙嗗寲宸ュ叿錛屽崄鍒嗘柟渚匡紒

聽聽聽b銆佹墦寮MySQL GUI Tools 5.0鐨凪ySql Query Browser宸ュ叿錛岃繛鎺ocalhost錛岀敤鎴峰悕涓簉oot錛屽瘑鐮佷負絀恒?br />
聽聽聽c銆侀夋嫨File-銆塏ew Script Tab

聽聽聽d銆佸湪Script 1鐨凾ab欏典腑杈撳叆浠ヤ笅璇彞錛岄夋嫨Execute鎸夐挳鎵ц鍗沖彲銆?br />
-- 寤虹珛鏁版嵁搴?sample 錛屽茍浣跨敤瀹?br />create database sample;
use sample;

-- 寤虹珛涓涓〃

create table Msg (
聽 MsgServiceId聽聽聽 聽integer,
聽 MsgTypeId聽聽聽聽聽聽 聽integer,
聽 MsgQueuedAt聽聽 聽datetime,
聽 MsgParam1聽聽聽聽聽聽 聽varchar(60)聽 NULL,
聽 MsgId聽聽聽 聽int NOT NULL auto_increment,聽聽聽聽聽聽聽聽聽-- 鑷
聽 PRIMARY KEY聽 (`MsgId`)聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽-- 涓婚敭
)DEFAULT CHARSET=gb2312;聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽-- 璁劇疆琛ㄧ殑瀛楃闆?br />
-- 寤虹珛绱㈠紩

create unique index BCG_Msg_idx2 on Msg ( MsgTypeId,聽 MsgId );

-- 寤虹珛瀛樺偍榪囩▼

DELIMITER |聽 --蹇呴』鏈夋鍙?/font>

CREATE PROCEDURE BCG_QueueMsg
聽聽 (
聽聽聽聽 in v_MsgServiceName varchar(30),
聽聽聽聽 in v_MsgParam1聽聽聽聽聽 varchar(60)
聽聽 )
BEGIN
聽聽聽聽聽 DECLARE v_MsgTypeId integer;
聽聽聽聽聽 DECLARE v_QueuedAt聽 timestamp;
聽聽聽聽聽 set v_QueuedAt = now();
聽聽聽聽聽 SELECT MsgServiceId INTO v_MsgServiceId FROM BCG_MsgService where MsgServiceName=v_MsgServiceName;
聽聽聽聽聽 INSERT INTO Msg (
聽聽聽聽聽聽聽 MsgTypeId,
聽聽聽聽聽聽聽 MsgQueuedAt,聽
聽聽聽聽聽聽聽 MsgParam1
聽聽聽聽聽 )
聽聽聽聽聽 VALUES (
聽聽聽聽聽聽聽聽v_MsgTypeId,
聽聽聽聽聽聽聽 v_QueuedAt,聽
聽聽聽聽聽聽聽 v_MsgParam1
聽聽聽聽聽 );
END;
|
DELIMITER ;


3銆佽Е鍙戝櫒鐨勫緩绔?br />
聽聽聽a銆侀夋嫨File-銆塏ew Script Tab

聽聽聽b銆佸湪Script 2鐨凾ab欏典腑杈撳叆浠ヤ笅璇彞錛岄夋嫨Execute鎸夐挳鎵ц鍗沖彲銆?br />
-- 浣跨敤sample鏁版嵁搴?br />use sample;

-- 寤虹珛嫻嬭瘯琛?br />
CREATE TABLE Orders (
聽OrderID int NOT NULL auto_increment ,
聽CustomerID nchar (5)聽 NULL ,
聽EmployeeID int NULL ,
聽OrderDate datetime NULL ,
聽RequiredDate datetime NULL ,
聽ShippedDate datetime NULL ,
聽ShipVia int NULL ,
聽Freight float NULL ,
聽ShipName nvarchar (40) NULL ,
聽ShipAddress nvarchar (60)聽 NULL ,
聽ShipCity nvarchar (15)聽 NULL ,
聽ShipRegion nvarchar (15)聽 NULL ,
聽ShipPostalCode nvarchar (10)聽聽 NULL ,
聽ShipCountry nvarchar (15)聽聽 NULL,
聽 PRIMARY KEY聽 (`OrderID`)
)DEFAULT CHARSET = gb2312;

-- 寤虹珛瑙﹀彂鍣?TESTDBINSERT聽 錛屽綋鏈夎褰曟彃鍏ヨ〃鏃訛紝鍚屾椂鎻掑叆Msg琛ㄤ竴鏉¤褰?br />
DELIMITER |
CREATE TRIGGER TESTDBINSERT聽 AFTER聽 INSERT ON ORDERS
FOR EACH ROW
BEGIN
聽聽聽 -- 鎶婃柊鎻掑叆orders琛ㄤ腑鏂拌褰曠殑OrderID瀛楁鐨勫艱祴緇橧D錛?font color="#ff1493">NEW琛ㄧず褰撳墠鎻掑叆鐨勮褰曢」鍐呭
聽聽聽 SET @ID = NEW.OrderID;聽

聽聽聽 -- 鑾峰緱褰撳墠鏃墮棿
聽聽聽 SET @v_QueuedAt = NOW();

聽聽聽 -- 鎶婁互涓婂緱鍒扮殑鍊兼彃鍏sg琛ㄤ腑
聽聽聽 INSERT INTO Msg (
聽聽聽聽聽聽聽 MsgTypeId,
聽聽聽聽聽聽聽 MsgQueuedAt,聽
聽聽聽聽聽聽聽 MsgParam1
聽聽聽 ) VALUES (
聽聽聽聽聽聽聽 1,
聽聽聽聽聽聽聽 @v_QueuedAt,聽
聽聽聽聽聽聽聽 @ID
聽聽聽 );
END;
|
DELIMITER ;

聽聽聽c銆佽繖鏃跺湪琛╫rders涓彃鍏ヤ竴鏉¤褰曪紝鍒橫sg琛ㄤ腑涔熷鍔犱竴鏉¤褰曘?br />
鏈鍚庤鏄嶮ySQL GUI Tools 5.0鏄竴涓崄鍒嗗ソ鐢ㄧ殑宸ュ叿錛岃繕鏈夊彲浠ヤ粠鍏朵粬鏁版嵁搴撲腑瀵煎叆鏁版嵁鐨凣UI宸ュ叿錛屽笇鏈涘ぇ瀹跺澶氱爺絀躲?/p>

鍝煎摷 2007-01-10 17:07 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲国产美国国产综合一区二区| 亚洲伊人久久综合中文成人网| 亚洲AV日韩精品久久久久| 好猛好深好爽好硬免费视频| 亚洲高清无码综合性爱视频| 黄色免费网址在线观看| 亚洲国产成人精品91久久久| 九九视频高清视频免费观看| 中文字幕亚洲天堂| 免费久久人人爽人人爽av| 久久久久亚洲av无码专区喷水| 精品熟女少妇av免费久久| 亚洲国产人成在线观看69网站| 最近免费中文字幕大全高清大全1| 亚洲精品无码久久久久久久| 精品熟女少妇AV免费观看| 亚洲欧洲专线一区| 夜色阁亚洲一区二区三区| 国产精品免费一区二区三区| 国产v亚洲v天堂无码网站| 一级毛片**不卡免费播| 亚洲精品人成网在线播放影院| 国产成人精品男人免费| 两性色午夜视频免费网| 亚洲毛片在线观看| 妞干网在线免费观看| 成人午夜免费视频| 亚洲高清日韩精品第一区| 女人18毛片特级一级免费视频 | 久久国产福利免费| 亚洲一区二区三区电影| 国内自产拍自a免费毛片| 一个人看的www免费在线视频| 久久精品7亚洲午夜a| 最近中文字幕mv免费高清电影| 鲁啊鲁在线视频免费播放| 1区1区3区4区产品亚洲| 亚洲?v无码国产在丝袜线观看| 午夜视频免费在线观看| 日本亚洲欧美色视频在线播放 | 亚洲人成网77777亚洲色|