|
||||||||||
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 ReentrantReadWriteLock |
lock
|
protected HLog |
log
|
protected Integer |
logRollerLock
|
protected SortedMap<Text,HRegion> |
onlineRegions
|
protected Map<Text,HRegion> |
retiringRegions
|
protected HServerInfo |
serverInfo
|
protected long |
splitOrCompactCheckFrequency
|
protected Integer |
splitOrCompactLock
|
protected boolean |
stopRequested
|
protected long |
threadWakeFrequency
|
Fields inherited from interface org.apache.hadoop.hbase.HRegionInterface |
---|
versionID |
Constructor Summary | |
---|---|
HRegionServer(Configuration conf)
Starts a HRegionServer at the default location |
|
HRegionServer(Path rootDir,
HServerAddress address,
Configuration conf)
Starts a HRegionServer at the specified location |
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. |
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 |
KeyedData[] |
getRow(Text regionName,
Text row)
Get all the data for the specified row |
static void |
main(String[] args)
|
KeyedData[] |
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 |
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 |
void |
run()
The HRegionServer sticks in this loop until closed. |
long |
startUpdate(Text regionName,
long clientid,
Text row)
Start an atomic row insertion/update. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected volatile boolean stopRequested
protected volatile boolean abortRequested
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 long threadWakeFrequency
protected final long splitOrCompactCheckFrequency
protected final Integer splitOrCompactLock
protected final Integer cacheFlusherLock
protected final HLog log
protected final Integer logRollerLock
Constructor Detail |
---|
public HRegionServer(Configuration conf) throws IOException
conf
-
IOException
public HRegionServer(Path rootDir, HServerAddress address, Configuration conf) throws IOException
rootDir
- address
- conf
-
IOException
Method Detail |
---|
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
getProtocolVersion
in interface VersionedProtocol
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaks
IOException
public void run()
run
in interface Runnable
public HRegionInfo getRegionInfo(Text regionName) throws NotServingRegionException
getRegionInfo
in interface HRegionInterface
regionName
- - name of the region
NotServingRegionException
public void batchUpdate(Text regionName, long timestamp, BatchUpdate b) throws IOException
batchUpdate
in interface HRegionInterface
regionName
- name of the region to updatetimestamp
- the time to be associated with the changesb
- BatchUpdate
IOException
public byte[] get(Text regionName, Text row, Text column) throws IOException
get
in interface HRegionInterface
regionName
- name of regionrow
- row keycolumn
- column key
IOException
public byte[][] get(Text regionName, Text row, Text column, int numVersions) throws IOException
get
in interface HRegionInterface
regionName
- 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 HRegionInterface
regionName
- region namerow
- row keycolumn
- column keytimestamp
- timestampnumVersions
- number of versions to return
IOException
public KeyedData[] getRow(Text regionName, Text row) throws IOException
getRow
in interface HRegionInterface
regionName
- region namerow
- row key
IOException
public KeyedData[] next(long scannerId) throws IOException
next
in interface HRegionInterface
scannerId
- clientId passed to openScanner
IOException
public long startUpdate(Text regionName, long clientid, Text row) throws IOException
startUpdate
in interface HRegionInterface
regionName
- region nameclientid
- a unique value to identify the clientrow
- Name of row to start update against.
IOException
public void put(Text regionName, long clientid, long lockid, Text column, byte[] val) throws IOException
put
in interface HRegionInterface
regionName
- region nameclientid
- a unique value to identify the clientlockid
- lock id returned from startUpdatecolumn
- column whose value is being setval
- new value for column
IOException
public void delete(Text regionName, long clientid, long lockid, Text column) throws IOException
delete
in interface HRegionInterface
regionName
- region nameclientid
- a unique value to identify the clientlockid
- lock id returned from startUpdatecolumn
- name of column whose value is to be deleted
IOException
public void abort(Text regionName, long clientid, long lockid) throws IOException
abort
in interface HRegionInterface
regionName
- region nameclientid
- a unique value to identify the clientlockid
- lock id returned from startUpdate
IOException
public void commit(Text regionName, long clientid, long lockid, long timestamp) throws IOException
commit
in interface HRegionInterface
regionName
- region nameclientid
- a unique value to identify the clientlockid
- lock id returned from startUpdatetimestamp
- the time (in milliseconds to associate with this change)
IOException
public void renewLease(long lockid, long clientid) throws IOException
renewLease
in interface HRegionInterface
lockid
- lock id returned from startUpdateclientid
- a unique value to identify the client
IOException
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
NotServingRegionException
public long openScanner(Text regionName, Text[] cols, Text firstRow, long timestamp, RowFilterInterface filter) throws IOException
openScanner
in interface HRegionInterface
regionName
- name of region to scancols
- columns to scanfirstRow
- 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 HRegionInterface
scannerId
- the scanner id returned by openScanner
IOException
public static void main(String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |