close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_delta.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Apr 22, 2010, 10:51:25 AM (16 years ago)
- Author:
-
waue
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v3
|
v4
|
|
| 65 | 65 | == 2.1 列出hbase 裡的所有 table == |
| 66 | 66 | {{{ |
| 67 | | !#php |
| | 67 | #!php |
| 68 | 68 | echo( "listing tables...\n" ); |
| 69 | 69 | $tables = $client->getTableNames(); |
| … |
… |
|
| 76 | 76 | == 2.2 刪除table == |
| 77 | 77 | {{{ |
| 78 | | !#php |
| | 78 | #!php |
| 79 | 79 | $name = "hbase table name"; |
| 80 | 80 | if ($client->isTableEnabled( $name )) { |
| … |
… |
|
| 90 | 90 | * 我們先定義columns 的物件結構如下 |
| 91 | 91 | {{{ |
| 92 | | !#php |
| | 92 | #!php |
| 93 | 93 | $columns = array( |
| 94 | 94 | new ColumnDescriptor( array( |
| … |
… |
|
| 104 | 104 | * 將剛剛的column 放到table 內 |
| 105 | 105 | {{{ |
| 106 | | !#php |
| | 106 | #!php |
| 107 | 107 | $t = "table name"; |
| 108 | 108 | echo( "creating table: {$t}\n" ); |
| … |
… |
|
| 117 | 117 | == 2.4 列出 table內的家族成員 family == |
| 118 | 118 | {{{ |
| 119 | | !#php |
| | 119 | #!php |
| 120 | 120 | $t = "table name"; |
| 121 | 121 | echo( "column families in {$t}:\n" ); |
| … |
… |
|
| 129 | 129 | == 2.5 寫入資料 == |
| 130 | 130 | {{{ |
| 131 | | !#php |
| | 131 | #!php |
| 132 | 132 | $t = "table name"; |
| 133 | 133 | $row = "row name" |
| … |
… |
|
| 148 | 148 | * get 取得一個 column value 的用法 |
| 149 | 149 | |
| | 150 | {{{ |
| | 151 | #!php |
| 150 | 152 | $table_name = 't1'; |
| 151 | 153 | $row_name = '1'; |
| … |
… |
|
| 160 | 162 | } |
| 161 | 163 | } |
| 162 | | |
| | 164 | }}} |
| 163 | 165 | === getRow 取得一整個row === |
| 164 | 166 | * getRow($tableName, $row) 用法 |
| … |
… |
|
| 180 | 182 | |
| 181 | 183 | {{{ |
| 182 | | !#php |
| | 184 | #!php |
| 183 | 185 | $table_name = 't1'; |
| 184 | 186 | $start_row = ""; // 從row 的起點開始 |