Changes between Version 4 and Version 5 of waue/2010/0402


Ignore:
Timestamp:
Apr 22, 2010, 10:52:53 AM (9 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2010/0402

    v4 v5  
    6666{{{
    6767#!php
     68<?
    6869echo( "listing tables...\n" );
    6970$tables = $client->getTableNames();
     
    7374}
    7475}
     76?>
    7577}}}
    7678 == 2.2 刪除table ==
    7779{{{
    7880#!php
     81<?
    7982$name = "hbase table name";
    8083if ($client->isTableEnabled( $name )) {
     
    8588    $client->deleteTable( $name );
    8689}
     90?>
    8791}}}
    8892 == 2.3 新增table ==
     
    9195{{{
    9296#!php
     97<?
    9398$columns = array(
    9499  new ColumnDescriptor( array(
     
    100105  ) )
    101106);
     107?>
    102108}}}
    103109
     
    105111{{{
    106112#!php
     113<?
    107114$t = "table name";
    108115echo( "creating table: {$t}\n" );
     
    114121}
    115122
     123?>
    116124}}}
    117125 == 2.4 列出 table內的家族成員 family ==
    118126{{{
    119127#!php
     128<?
    120129$t = "table name";
    121130echo( "column families in {$t}:\n" );
     
    126135  echo( "  column: {$col->name}, maxVer: {$col->maxVersions}\n" );
    127136}
     137?>
    128138}}}
    129139 == 2.5 寫入資料 ==
    130140{{{
    131141#!php
     142<?
    132143$t = "table name";
    133144$row = "row name"
     
    142153
    143154$client->mutateRow( $t, $row, $mutations );
     155?>
    144156}}}
    145157
     
    150162{{{
    151163#!php
     164<?
    152165$table_name = 't1';
    153166$row_name = '1';
     
    162175        }
    163176}
     177?>
    164178}}}
    165179 ===  getRow 取得一整個row ===
     
    167181{{{
    168182#!php
     183<?
    169184$table_name = "table name";
    170185$row_name = "row name";
     
    177192                printTRowResult($TRowResult);
    178193}
     194?>
    179195}}}
    180196
     
    183199{{{
    184200#!php
     201<?
    185202$table_name = 't1';
    186203$start_row = ""; // 從row 的起點開始
     
    214231echo( "<br> Scanner finished <br>" );
    215232$client->scannerClose( $scanner );
    216 
    217 }}}
     233?>
     234}}}