• Type: New Feature New Feature
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: REST
    • Labels:


      This is a php class to interact with the rest interface this is my first copy so there could be bugs and changes to come as the rest interface changes. I will make this in to a patch once I am done with it. there is lots of comments in the file and notes on usage but here is some basic stuff to get you started. you are welcome to suggest changes to make it faster or more usable.

      Basic Usage here more details in notes with each function

      // open a new connection to rest server. Hbase Master default port is 60010
      $hbase = new hbase_rest($ip, $port);

      // get list of tables
      $tables = $hbase->list_tables();

      // get table column family names and compression stuff
      $table_info = $hbase->table_schema("search_index");

      // get start and end row keys of each region
      $regions = $hbase->regions($table);

      // select data from hbase
      $results = $hbase->select($table,$row_key);

      // insert data into hbase the $column and $data can be arrays with more then one column inserted in one request

      // delete a column from a row. Can not use * at this point to remove all I thank there is plans to add this.

      // start a scanner on a set range of table
      $handle = $hbase->scanner_start($table,$cols,$start_row,$end_row);

      // pull the next row of data for a scanner handle
      $results = $hbase->scanner_get($handle);

      // delete a scanner handle

      Example of using a scanner this will loop each row until it out of rows.

      $hbase = new hbase_rest($ip, $port);
      $handle = $hbase->scanner_start($table,$cols,$start_row,$end_row);
      $results = true;
      while ($results){
      $results = $hbase->scanner_get($handle);
      if ($results){
      foreach($results['column'] as $key => $value)

      { .... code here to work with the $key/column name and the $value of the column .... }

      // end foreach
      } // end if
      }// end while

      1. hbase_rest.php
        17 kB
        Billy Pearson
      2. hbase_restv2.php
        17 kB
        Billy Pearson

        Issue Links


          Billy Pearson created issue -
          Billy Pearson made changes -
          Field Original Value New Value
          Attachment hbase_rest.php [ 12372688 ]
          Billy Pearson made changes -
          Link This issue depends on HADOOP-2068 [ HADOOP-2068 ]
          Billy Pearson made changes -
          Attachment hbase_restv2.php [ 12372876 ]
          Owen O'Malley made changes -
          Component/s contrib/hbase [ 12311752 ]
          Project Hadoop Core [ 12310240 ] Hadoop HBase [ 12310753 ]
          Key HADOOP-2546 HBASE-37
          Bryan Duxbury made changes -
          Component/s rest [ 12312140 ]
          Zinnur Temerbekov made changes -
          Comment [
          GET /[table_name]/row/[row_key]/timestamps

          "St.Ack comment: Currently not supported in native hbase client but we should add it"

          Somebody knows as soon to appear given functionality? ]
          Billy Pearson made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Gavin made changes -
          Link This issue depends on HBASE-269 [ HBASE-269 ]
          Gavin made changes -
          Link This issue depends upon HBASE-269 [ HBASE-269 ]


            • Assignee:
              Billy Pearson
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: