org.apache.hadoop.hbase
Interface HRegionInterface

All Superinterfaces:
VersionedProtocol
All Known Implementing Classes:
HRegionServer

public interface HRegionInterface
extends VersionedProtocol

Clients interact with HRegionServers using a handle to the HRegionInterface.


Field Summary
static long versionID
          initial version
 
Method Summary
 void abort(Text regionName, long clientid, long lockid)
          Abort a row mutation
 void batchUpdate(Text regionName, long timestamp, BatchUpdate b)
          Applies a batch of updates via one RPC
 void close(long scannerId)
          Close a scanner
 void commit(Text regionName, long clientid, long lockid, long timestamp)
          Finalize a row mutation
 void delete(Text regionName, long clientid, long lockid, Text column)
          Delete the value for a column
 byte[] get(Text regionName, Text row, Text column)
          Retrieve a single value from the specified region for the specified row and column keys
 byte[][] get(Text regionName, Text row, Text column, int numVersions)
          Get the specified number of versions of the specified row and column
 byte[][] get(Text regionName, Text row, Text column, long timestamp, int numVersions)
          Get the specified number of versions of the specified row and column with the specified timestamp.
 HRegionInfo getRegionInfo(Text regionName)
          Get metainfo about an HRegion
 KeyedData[] getRow(Text regionName, Text row)
          Get all the data for the specified row
 KeyedData[] next(long scannerId)
          Get the next set of values
 long openScanner(Text regionName, Text[] columns, Text startRow, long timestamp, RowFilterInterface filter)
          Opens a remote scanner with a RowFilter.
 void put(Text regionName, long clientid, long lockid, Text column, byte[] val)
          Change a value for the specified column
 void renewLease(long lockid, long clientid)
          Renew lease on update
 long startUpdate(Text regionName, long clientid, Text row)
          Start an atomic row insertion/update.
 
Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol
getProtocolVersion
 

Field Detail

versionID

static final long versionID
initial version

See Also:
Constant Field Values
Method Detail

getRegionInfo

HRegionInfo getRegionInfo(Text regionName)
                          throws NotServingRegionException
Get metainfo about an HRegion

Parameters:
regionName - - name of the region
Returns:
- HRegionInfo object for region
Throws:
NotServingRegionException

get

byte[] get(Text regionName,
           Text row,
           Text column)
           throws IOException
Retrieve a single value from the specified region for the specified row and column keys

Parameters:
regionName - name of region
row - row key
column - column key
Returns:
alue for that region/row/column
Throws:
IOException

get

byte[][] get(Text regionName,
             Text row,
             Text column,
             int numVersions)
             throws IOException
Get the specified number of versions of the specified row and column

Parameters:
regionName - region name
row - row key
column - column key
numVersions - number of versions to return
Returns:
array of values
Throws:
IOException

get

byte[][] get(Text regionName,
             Text row,
             Text column,
             long timestamp,
             int numVersions)
             throws IOException
Get the specified number of versions of the specified row and column with the specified timestamp.

Parameters:
regionName - region name
row - row key
column - column key
timestamp - timestamp
numVersions - number of versions to return
Returns:
array of values
Throws:
IOException

getRow

KeyedData[] getRow(Text regionName,
                   Text row)
                   throws IOException
Get all the data for the specified row

Parameters:
regionName - region name
row - row key
Returns:
array of values
Throws:
IOException

startUpdate

long startUpdate(Text regionName,
                 long clientid,
                 Text row)
                 throws IOException
Start an atomic row insertion/update. No changes are committed until the call to commit() returns. A call to abort() will abandon any updates in progress. Callers to this method are given a lease for each unique lockid; before the lease expires, either abort() or commit() must be called. If it is not called, the system will automatically call abort() on the client's behalf. The client can gain extra time with a call to renewLease(). Start an atomic row insertion or update

Parameters:
regionName - region name
clientid - a unique value to identify the client
row - Name of row to start update against.
Returns:
Row lockid.
Throws:
IOException

put

void put(Text regionName,
         long clientid,
         long lockid,
         Text column,
         byte[] val)
         throws IOException
Change a value for the specified column

Parameters:
regionName - region name
clientid - a unique value to identify the client
lockid - lock id returned from startUpdate
column - column whose value is being set
val - new value for column
Throws:
IOException

delete

void delete(Text regionName,
            long clientid,
            long lockid,
            Text column)
            throws IOException
Delete the value for a column

Parameters:
regionName - region name
clientid - a unique value to identify the client
lockid - lock id returned from startUpdate
column - name of column whose value is to be deleted
Throws:
IOException

abort

void abort(Text regionName,
           long clientid,
           long lockid)
           throws IOException
Abort a row mutation

Parameters:
regionName - region name
clientid - a unique value to identify the client
lockid - lock id returned from startUpdate
Throws:
IOException

commit

void commit(Text regionName,
            long clientid,
            long lockid,
            long timestamp)
            throws IOException
Finalize a row mutation

Parameters:
regionName - region name
clientid - a unique value to identify the client
lockid - lock id returned from startUpdate
timestamp - the time (in milliseconds to associate with this change)
Throws:
IOException

renewLease

void renewLease(long lockid,
                long clientid)
                throws IOException
Renew lease on update

Parameters:
lockid - lock id returned from startUpdate
clientid - a unique value to identify the client
Throws:
IOException

openScanner

long openScanner(Text regionName,
                 Text[] columns,
                 Text startRow,
                 long timestamp,
                 RowFilterInterface filter)
                 throws IOException
Opens a remote scanner with a RowFilter.

Parameters:
regionName - name of region to scan
columns - columns to scan
startRow - starting row to scan
timestamp - only return values whose timestamp is <= this value
filter - RowFilter for filtering results at the row-level.
Returns:
scannerId scanner identifier used in other calls
Throws:
IOException

batchUpdate

void batchUpdate(Text regionName,
                 long timestamp,
                 BatchUpdate b)
                 throws IOException
Applies a batch of updates via one RPC

Parameters:
regionName - name of the region to update
timestamp - the time to be associated with the changes
b - BatchUpdate
Throws:
IOException

next

KeyedData[] next(long scannerId)
                 throws IOException
Get the next set of values

Parameters:
scannerId - clientId passed to openScanner
Returns:
array of values
Throws:
IOException

close

void close(long scannerId)
           throws IOException
Close a scanner

Parameters:
scannerId - the scanner id returned by openScanner
Throws:
IOException


Copyright © 2006 The Apache Software Foundation