|
||||||||||
| 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 Integer |
cacheFlusherLock
|
protected Configuration |
conf
|
protected boolean |
fsOk
|
protected ReentrantReadWriteLock |
lock
|
protected HLog |
log
|
protected Integer |
logRollerLock
|
protected SortedMap<Text,HRegion> |
onlineRegions
|
static String |
REGIONSERVER
|
protected Map<Text,HRegion> |
retiringRegions
|
protected HServerInfo |
serverInfo
|
protected Integer |
splitOrCompactLock
|
protected AtomicBoolean |
stopRequested
|
protected int |
threadWakeFrequency
|
| Fields inherited from interface org.apache.hadoop.hbase.HRegionInterface |
|---|
versionID |
| Constructor Summary | |
|---|---|
HRegionServer(Configuration conf)
Starts a HRegionServer at the default location |
|
HRegionServer(HServerAddress address,
Configuration 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 |
protected void |
commit(Text regionName,
long lockid,
long timestamp)
|
protected void |
delete(Text regionName,
long lockid,
Text column)
|
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. |
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. |
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 List<HRegion> |
getRegionsToCheck()
|
AtomicInteger |
getRequestCount()
|
MapWritable |
getRow(Text regionName,
Text row)
Get all the data for the specified row |
HServerInfo |
getServerInfo()
|
static void |
main(String[] args)
|
MapWritable |
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. |
protected void |
put(Text regionName,
long lockid,
Text column,
byte[] val)
|
void |
run()
The HRegionServer sticks in this loop until closed. |
protected long |
startUpdate(Text regionName,
Text row)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final AtomicBoolean stopRequested
protected volatile boolean abortRequested
protected volatile boolean fsOk
protected final HServerInfo serverInfo
protected final Configuration conf
protected final SortedMap<Text,HRegion> onlineRegions
protected final Map<Text,HRegion> retiringRegions
protected final ReentrantReadWriteLock lock
protected final int threadWakeFrequency
public static final String REGIONSERVER
protected final Integer splitOrCompactLock
protected final Integer cacheFlusherLock
protected HLog log
protected final Integer logRollerLock
| Constructor Detail |
|---|
public HRegionServer(Configuration conf)
throws IOException
conf -
IOException
public HRegionServer(HServerAddress address,
Configuration 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 MapWritable getRow(Text regionName,
Text row)
throws IOException
getRow in interface HRegionInterfaceregionName - region namerow - row key
IOException
public MapWritable 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
HRegionInterface
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
protected long startUpdate(Text regionName,
Text row)
throws IOException
IOException
protected void put(Text regionName,
long lockid,
Text column,
byte[] val)
throws IOException
IOException
protected void delete(Text regionName,
long lockid,
Text column)
throws IOException
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
protected void commit(Text regionName,
long lockid,
long timestamp)
throws IOException
IOExceptionpublic HServerInfo getServerInfo()
public SortedMap<Text,HRegion> getOnlineRegions()
public AtomicInteger getRequestCount()
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 List<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 | |||||||||