hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-hadoop Wiki] Update of "Hbase/HbaseRest" by BryanDuxbury
Date Thu, 15 Nov 2007 02:10:57 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-hadoop Wiki" for change notification.

The following page has been changed by BryanDuxbury:
http://wiki.apache.org/lucene-hadoop/Hbase/HbaseRest

New page:
This is a provisional spec for the Hbase-REST api.


== System Information ==

GET /
    Retrieve a list of all the tables in HBase.
    
    Returns: 
        XML entity body that contains a list of the tables like so:
        <tables>
            <table name="first_table" uri="/first_table" />
            <table name="second_table" uri="/second_table" />        
        </tables>
    
GET /[table_name]
    Retrieve metadata about the table. This includes column family descriptors.

    Returns: 
        XML entity body that contains all the metadata about the table:
        <table>
            <columnFamilies>
                <columnFamily name="meta" />
                <columnFamily name="content" />
                <columnFamily name="stats" />
            </columnFamilies>
        </table>
    
GET /[table_name]/regions
    Retrieve a list of the regions for this table so that you can efficiently split up work
(a la MapReduce).
    
    Options: 
        start_key, end_key: Only return the list of regions that contain the range start_key...end_key
    Returns: 
        XML entity body that describes the regions:
        <regions>
            <region start_key="0001" server="region_server_1" />
            <region start_key="0101" server="region_server_2" />
            <region start_key="0201" server="region_server_3" />
        </regions>


== Row Interaction ==

GET /[table_name]/row/[row_key]/timestamps
    Retrieve a list of all the timestamps available for this row key.

    Returns: 
        XML entity body that describes the list of available timestamps:
        <timestamps>
            <timestamp value="20071115T000000" uri="/first_table/row/0001/20071115T000000"
/>
            <timestamp value="20071115T000800" uri="/first_table/row/0001/20071115T000800"
/>
            <timestamp value="20071115T001200" uri="/first_table/row/0001/20071115T001200"
/>
        </timestamps>
    
GET /[table_name]/row/[row_key]/
GET /[table_name]/row/[row_key]/[timestamp]
    Retrieve data from a row, constrained by an optional timestamp value.

    Headers:
        Accept:
            application/xml:    The client is expecting an XML entity body that contains the

                                columns and data together.
            octet-stream:       The client is expecting raw binary data. This implies that

                                there is only a single column being retrieved.
            Multipart/related:  The client is expecting raw binary data, but organized into
a 
                                multipart response. The client must be prepared to parse the

                                column values out of the data.
    Options: 
        columns: A semicolon-delimited list of column names. If omitted, the result will contain
all columns in the row.
    
POST/PUT /[table_name]/row/[row_key]/
POST/PUT /[table_name]/row/[row_key]/[timestamp]
    Set the value of one or more columns for a given row key with an optional timestamp.

    Headers:
        Content-type:
            application/xml:    The client is sending one or more columns of data in an XML
entity.
            octet-stream:       The client is sending EXACTLY ONE column value as raw binary
                                as specified in the columns attribute.
            Multipart/related:  The client is sending multiple columns of data encoded with
boundaries.
            
    Options:
        columns: A semicolon-delimited list of column names. This attribute is ignored when
the Content-type is application/xml.
    
    Returns:
        HTTP 201 (Created) if the column(s) could successfully be saved. HTTP 415 (Unsupported
Media Type) if 
        the query string column options do not match the Content-type header, or if the binary
data of either
        octet-stream or Multipart/related is unreadable.
    
DELETE /[table_name]/row/[row_key]/
DELETE /[table_name]/row/[row_key]/[timestamp]
    Delete the specified columns from the row. If there are no columns specified, then it
will delete ALL columns. Optionally, specify a timestamp.
    
    Options:
        columns: A semicolon-delimited list of column names. If omitted, the result will delete
all columns in the row.
    
    Returns:
        HTTP 202 (Accepted) if the column(s) were deleted.

    
== Scanning ==    

POST/PUT /[table_name]/scanner
    Request that a scanner be created with the specified options. Returns a scanner ID that
can be used to iterate over the results of the scanner.
    Options: 
        columns: A semicolon-delimited list of column names. If omitted, each result will
contain all columns in the row.
        start_key, end_key: Starting and ending keys that enclose the region that should be
scanned.

    Returns:
        HTTP 201 (Created) with a Location header that references the scanner URI. Example:
        /first_table/scanner/1234348890231890
        
GET /[table_name]/scanner/[scanner_id]/current
    Get the row and columns for the current item in the scanner without advancing the scanner.

    Equivalent to a queue peek operation. Multiple requests to this URI will return the same
result.
    
    Headers:
        Accept:
            application/xml:    The client is expecting an XML entity body that contains the

                                columns and data together.
            octet-stream:       The client is expecting raw binary data. This implies that

                                there is only a single column being retrieved.
            Multipart/related:  The client is expecting raw binary data, but organized into
a 
                                multipart response. The client must be prepared to parse the

                                column values out of the data.
    Returns:
        HTTP 200 (OK) and an entity that describes the current row in the scanner. The entity
value of this request 
        depends on the Accept header. See the documentation for getting an individual row
for data format.
        
        If the scanner is used up, HTTP 404 (Not Found).
    
DELETE /[table_name]/scanner/[scanner_id]/current
    Return the current item in the scanner and advance to the next one. Think of it as a queue
dequeue operation.
    
    Headers:
        Accept:
            application/xml:    The client is expecting an XML entity body that contains the

                                columns and data together.
            octet-stream:       The client is expecting raw binary data. This implies that

                                there is only a single column being retrieved.
            Multipart/related:  The client is expecting raw binary data, but organized into
a 
                                multipart response. The client must be prepared to parse the

                                column values out of the data.
    Returns:
        HTTP 200 (OK) and an entity that describes the current row in the scanner. The entity
value of this request 
        depends on the Accept header. See the documentation for getting an individual row
for data format.
        
        If the scanner is used up, HTTP 404 (Not Found).
    
DELETE /[table_name]/scanner/[scanner_id]
    Close a scanner. You must call this when you are done using a scanner to deallocate it.
    
    Returns:
        HTTP 202 (Accepted) if it can be closed. HTTP 404 (Not Found) if the scanner id is
invalid. 
        HTTP 410 (Gone) if the scanner is already closed or the lease time has expired.

Mime
View raw message