|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.HRegionServer
public class HRegionServer
HRegionServer makes a set of HRegions available to clients. It checks in with the HMaster. There are many HRegionServers in a single HBase deployment.
| Field Summary | |
|---|---|
protected boolean |
abortRequested
|
protected HBaseConfiguration |
conf
|
protected boolean |
fsOk
|
protected ReentrantReadWriteLock |
lock
|
protected HLog |
log
|
protected SortedMap<Text,HRegion> |
onlineRegions
|
protected AtomicBoolean |
quiesced
|
static String |
REGIONSERVER
region server process name |
protected Map<Text,HRegion> |
retiringRegions
|
protected HServerInfo |
serverInfo
|
protected AtomicBoolean |
stopRequested
|
protected int |
threadWakeFrequency
|
| Fields inherited from interface org.apache.hadoop.hbase.HRegionInterface |
|---|
versionID |
| Constructor Summary | |
|---|---|
HRegionServer(HBaseConfiguration conf)
Starts a HRegionServer at the default location |
|
HRegionServer(HServerAddress address,
HBaseConfiguration conf)
Starts a HRegionServer at the specified location |
|
| Method Summary | |
|---|---|
void |
batchUpdate(Text regionName,
long timestamp,
BatchUpdate b)
Applies a batch of updates via one RPC |
protected boolean |
checkFileSystem()
Checks to see if the file system is still accessible. |
void |
close(long scannerId)
Close a scanner |
void |
deleteAll(Text regionName,
Text row,
long timestamp)
Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp. |
void |
deleteAll(Text regionName,
Text row,
Text 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 |
deleteFamily(Text regionName,
Text row,
Text family,
long timestamp)
Delete all cells for a row with matching column family with timestamps less than or equal to timestamp. |
protected static void |
doMain(String[] args,
Class<? extends HRegionServer> regionServerClass)
Do class main. |
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. |
CacheFlushListener |
getCacheFlushListener()
|
HbaseMapWritable |
getClosestRowBefore(Text regionName,
Text row)
Return all the data for the row that matches row exactly, or the one that immediately preceeds it. |
HbaseMapWritable |
getClosestRowBefore(Text regionName,
Text row,
long ts)
Return all the data for the row that matches row exactly, or the one that immediately preceeds it, at or immediately before ts. |
SortedMap<Text,HRegion> |
getOnlineRegions()
|
long |
getProtocolVersion(String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
protected HRegion |
getRegion(Text regionName)
Protected utility method for safely obtaining an HRegion handle. |
protected HRegion |
getRegion(Text regionName,
boolean checkRetiringRegions)
Protected utility method for safely obtaining an HRegion handle. |
HRegionInfo |
getRegionInfo(Text regionName)
Get metainfo about an HRegion |
protected Set<HRegion> |
getRegionsToCheck()
|
AtomicInteger |
getRequestCount()
|
HbaseMapWritable |
getRow(Text regionName,
Text row)
Get all the data for the specified row |
HbaseMapWritable |
getRow(Text regionName,
Text row,
long ts)
Get all the data for the specified row at a given timestamp |
HServerInfo |
getServerInfo()
|
static void |
main(String[] args)
|
HbaseMapWritable |
next(long scannerId)
Get the next set of values |
long |
openScanner(Text regionName,
Text[] cols,
Text firstRow,
long timestamp,
RowFilterInterface filter)
Opens a remote scanner with a RowFilter. |
void |
run()
The HRegionServer sticks in this loop until closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected volatile AtomicBoolean stopRequested
protected volatile AtomicBoolean quiesced
protected volatile boolean abortRequested
protected volatile boolean fsOk
protected final HServerInfo serverInfo
protected final HBaseConfiguration conf
protected volatile SortedMap<Text,HRegion> onlineRegions
protected volatile Map<Text,HRegion> retiringRegions
protected final ReentrantReadWriteLock lock
protected final int threadWakeFrequency
public static final String REGIONSERVER
protected HLog log
| Constructor Detail |
|---|
public HRegionServer(HBaseConfiguration conf)
throws IOException
conf -
IOException
public HRegionServer(HServerAddress address,
HBaseConfiguration conf)
throws IOException
address - conf -
IOException| Method Detail |
|---|
public void run()
run in interface Runnable
public HRegionInfo getRegionInfo(Text regionName)
throws NotServingRegionException
getRegionInfo in interface HRegionInterfaceregionName - name of the region
NotServingRegionException
public byte[] get(Text regionName,
Text row,
Text column)
throws IOException
get in interface HRegionInterfaceregionName - name of regionrow - row keycolumn - column key
IOException
public byte[][] get(Text regionName,
Text row,
Text column,
int numVersions)
throws IOException
get in interface HRegionInterfaceregionName - region namerow - row keycolumn - column keynumVersions - number of versions to return
IOException
public byte[][] get(Text regionName,
Text row,
Text column,
long timestamp,
int numVersions)
throws IOException
get in interface HRegionInterfaceregionName - region namerow - row keycolumn - column keytimestamp - timestampnumVersions - number of versions to return
IOException
public HbaseMapWritable getRow(Text regionName,
Text row)
throws IOException
getRow in interface HRegionInterfaceregionName - region namerow - row key
IOException
public HbaseMapWritable getRow(Text regionName,
Text row,
long ts)
throws IOException
getRow in interface HRegionInterfaceregionName - region namerow - row key
IOException
public HbaseMapWritable getClosestRowBefore(Text regionName,
Text row)
throws IOException
getClosestRowBefore in interface HRegionInterfaceregionName - region namerow - row key
IOException
public HbaseMapWritable getClosestRowBefore(Text regionName,
Text row,
long ts)
throws IOException
getClosestRowBefore in interface HRegionInterfaceregionName - region namerow - row key
IOException
public HbaseMapWritable next(long scannerId)
throws IOException
next in interface HRegionInterfacescannerId - clientId passed to openScanner
IOException
public void batchUpdate(Text regionName,
long timestamp,
BatchUpdate b)
throws IOException
batchUpdate in interface HRegionInterfaceregionName - name of the region to updatetimestamp - the time to be associated with the changesb - BatchUpdate
IOException
public long openScanner(Text regionName,
Text[] cols,
Text firstRow,
long timestamp,
RowFilterInterface filter)
throws IOException
openScanner in interface HRegionInterfaceregionName - name of region to scancols - 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:
\+|^&*$[]]}{)(.firstRow - starting row to scantimestamp - only return values whose timestamp is <= this valuefilter - RowFilter for filtering results at the row-level.
IOException
public void close(long scannerId)
throws IOException
close in interface HRegionInterfacescannerId - the scanner id returned by openScanner
IOException
public void deleteAll(Text regionName,
Text row,
Text column,
long timestamp)
throws IOException
deleteAll in interface HRegionInterfaceregionName - region namerow - row keycolumn - column keytimestamp - Delete all entries that have this timestamp or older
IOException
public void deleteAll(Text regionName,
Text row,
long timestamp)
throws IOException
deleteAll in interface HRegionInterfaceregionName - region namerow - row keytimestamp - Delete all entries that have this timestamp or older
IOException
public void deleteFamily(Text regionName,
Text row,
Text family,
long timestamp)
throws IOException
deleteFamily in interface HRegionInterfaceregionName - The name of the region to operate onrow - The row to operate onfamily - The column family to matchtimestamp - Timestamp to match
IOExceptionpublic HServerInfo getServerInfo()
public SortedMap<Text,HRegion> getOnlineRegions()
public AtomicInteger getRequestCount()
public CacheFlushListener getCacheFlushListener()
protected HRegion getRegion(Text regionName)
throws NotServingRegionException
regionName - Name of online HRegion to return
HRegion for regionName
NotServingRegionException
protected HRegion getRegion(Text regionName,
boolean checkRetiringRegions)
throws NotServingRegionException
regionName - Name of online HRegion to returncheckRetiringRegions - Set true if we're to check retiring regions
as well as online regions.
HRegion for regionName
NotServingRegionExceptionprotected boolean checkFileSystem()
protected Set<HRegion> getRegionsToCheck()
public long getProtocolVersion(String protocol,
long clientVersion)
throws IOException
getProtocolVersion in interface VersionedProtocolprotocol - The classname of the protocol interfaceclientVersion - The version of the protocol that the client speaks
IOException
protected static void doMain(String[] args,
Class<? extends HRegionServer> regionServerClass)
args - regionServerClass - HRegionServer to instantiate.public static void main(String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||