org.apache.hadoop.hbase.ipc
Interface HRegionInterface

All Superinterfaces:
org.apache.hadoop.ipc.VersionedProtocol
All Known Implementing Classes:
HRegionServer

public interface HRegionInterface
extends org.apache.hadoop.ipc.VersionedProtocol

Clients interact with HRegionServers using a handle to the HRegionInterface.


Field Summary
static long versionID
          Protocol version.
 
Method Summary
 void batchUpdate(byte[] regionName, BatchUpdate b)
          Applies a batch of updates via one RPC
 void close(long scannerId)
          Close a scanner
 void deleteAll(byte[] regionName, byte[] row, byte[] column, long timestamp)
          Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.
 void deleteAll(byte[] regionName, byte[] row, long timestamp)
          Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp.
 void deleteFamily(byte[] regionName, byte[] row, byte[] family, long timestamp)
          Delete all cells for a row with matching column family with timestamps less than or equal to timestamp.
 Cell get(byte[] regionName, byte[] row, byte[] column)
          Retrieve a single value from the specified region for the specified row and column keys
 Cell[] get(byte[] regionName, byte[] row, byte[] column, int numVersions)
          Get the specified number of versions of the specified row and column
 Cell[] get(byte[] regionName, byte[] row, byte[] column, long timestamp, int numVersions)
          Get the specified number of versions of the specified row and column with the specified timestamp.
 RowResult getClosestRowBefore(byte[] regionName, byte[] row)
          Return all the data for the row that matches row exactly, or the one that immediately preceeds it.
 HRegionInfo getRegionInfo(byte[] regionName)
          Get metainfo about an HRegion
 RowResult getRow(byte[] regionName, byte[] row, byte[][] columns, long ts)
          Get selected columns for the specified row at a given timestamp.
 RowResult next(long scannerId)
          Get the next set of values
 long openScanner(byte[] regionName, byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
          Opens a remote scanner with a RowFilter.
 
Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol
getProtocolVersion
 

Field Detail

versionID

static final long versionID
Protocol version. Upped to 3 when we went from Text to byte arrays for row and column names.

See Also:
Constant Field Values
Method Detail

getRegionInfo

HRegionInfo getRegionInfo(byte[] regionName)
                          throws NotServingRegionException
Get metainfo about an HRegion

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

get

Cell get(byte[] regionName,
         byte[] row,
         byte[] 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

Cell[] get(byte[] regionName,
           byte[] row,
           byte[] 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

Cell[] get(byte[] regionName,
           byte[] row,
           byte[] 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

getClosestRowBefore

RowResult getClosestRowBefore(byte[] regionName,
                              byte[] row)
                              throws IOException
Return all the data for the row that matches row exactly, or the one that immediately preceeds it.

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

getRow

RowResult getRow(byte[] regionName,
                 byte[] row,
                 byte[][] columns,
                 long ts)
                 throws IOException
Get selected columns for the specified row at a given timestamp.

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

batchUpdate

void batchUpdate(byte[] regionName,
                 BatchUpdate b)
                 throws IOException
Applies a batch of updates via one RPC

Parameters:
regionName - name of the region to update
b - BatchUpdate
Throws:
IOException

deleteAll

void deleteAll(byte[] regionName,
               byte[] row,
               byte[] column,
               long timestamp)
               throws IOException
Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
regionName - region name
row - row key
column - column key
timestamp - Delete all entries that have this timestamp or older
Throws:
IOException

deleteAll

void deleteAll(byte[] regionName,
               byte[] row,
               long timestamp)
               throws IOException
Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
regionName - region name
row - row key
timestamp - Delete all entries that have this timestamp or older
Throws:
IOException

deleteFamily

void deleteFamily(byte[] regionName,
                  byte[] row,
                  byte[] family,
                  long timestamp)
                  throws IOException
Delete all cells for a row with matching column family with timestamps less than or equal to timestamp.

Parameters:
regionName - The name of the region to operate on
row - The row to operate on
family - The column family to match
timestamp - Timestamp to match
Throws:
IOException

openScanner

long openScanner(byte[] regionName,
                 byte[][] columns,
                 byte[] 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. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex for column family name. A column name is judged to be regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
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

next

RowResult next(long scannerId)
               throws IOException
Get the next set of values

Parameters:
scannerId - clientId passed to openScanner
Returns:
map 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 © 2008 The Apache Software Foundation