Changes between Version 4 and Version 5 of waue/2010/0402
- Timestamp:
- Apr 22, 2010, 10:52:53 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2010/0402
v4 v5 66 66 {{{ 67 67 #!php 68 <? 68 69 echo( "listing tables...\n" ); 69 70 $tables = $client->getTableNames(); … … 73 74 } 74 75 } 76 ?> 75 77 }}} 76 78 == 2.2 刪除table == 77 79 {{{ 78 80 #!php 81 <? 79 82 $name = "hbase table name"; 80 83 if ($client->isTableEnabled( $name )) { … … 85 88 $client->deleteTable( $name ); 86 89 } 90 ?> 87 91 }}} 88 92 == 2.3 新增table == … … 91 95 {{{ 92 96 #!php 97 <? 93 98 $columns = array( 94 99 new ColumnDescriptor( array( … … 100 105 ) ) 101 106 ); 107 ?> 102 108 }}} 103 109 … … 105 111 {{{ 106 112 #!php 113 <? 107 114 $t = "table name"; 108 115 echo( "creating table: {$t}\n" ); … … 114 121 } 115 122 123 ?> 116 124 }}} 117 125 == 2.4 列出 table內的家族成員 family == 118 126 {{{ 119 127 #!php 128 <? 120 129 $t = "table name"; 121 130 echo( "column families in {$t}:\n" ); … … 126 135 echo( " column: {$col->name}, maxVer: {$col->maxVersions}\n" ); 127 136 } 137 ?> 128 138 }}} 129 139 == 2.5 寫入資料 == 130 140 {{{ 131 141 #!php 142 <? 132 143 $t = "table name"; 133 144 $row = "row name" … … 142 153 143 154 $client->mutateRow( $t, $row, $mutations ); 155 ?> 144 156 }}} 145 157 … … 150 162 {{{ 151 163 #!php 164 <? 152 165 $table_name = 't1'; 153 166 $row_name = '1'; … … 162 175 } 163 176 } 177 ?> 164 178 }}} 165 179 === getRow 取得一整個row === … … 167 181 {{{ 168 182 #!php 183 <? 169 184 $table_name = "table name"; 170 185 $row_name = "row name"; … … 177 192 printTRowResult($TRowResult); 178 193 } 194 ?> 179 195 }}} 180 196 … … 183 199 {{{ 184 200 #!php 201 <? 185 202 $table_name = 't1'; 186 203 $start_row = ""; // 從row 的起點開始 … … 214 231 echo( "<br> Scanner finished <br>" ); 215 232 $client->scannerClose( $scanner ); 216 217 }}} 233 ?> 234 }}}