|
||||||||||
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<org.apache.hadoop.io.Text,HRegion> |
onlineRegions
|
protected AtomicBoolean |
quiesced
|
static String |
REGIONSERVER
region server process name |
protected Map<org.apache.hadoop.io.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 | |
---|---|
protected void |
addProcessingMessage(HRegionInfo hri)
|
void |
batchUpdate(org.apache.hadoop.io.Text regionName,
BatchUpdate b)
Used by master so it can add an update with the current time of this server rather than current time on master Applies a batch of updates via one RPC |
void |
batchUpdate(org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row,
org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row,
org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text column)
Retrieve a single value from the specified region for the specified row and column keys |
byte[][] |
get(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text column,
int numVersions)
Get the specified number of versions of the specified row and column |
byte[][] |
get(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row,
org.apache.hadoop.io.Text column,
long timestamp,
int numVersions)
Get the specified number of versions of the specified row and column with the specified timestamp. |
HbaseMapWritable |
getClosestRowBefore(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row)
Return all the data for the row that matches row exactly, or the one that immediately preceeds it. |
FlushRequester |
getFlushRequester()
|
SortedMap<org.apache.hadoop.io.Text,HRegion> |
getOnlineRegions()
|
protected List<HMsg> |
getOutboundMsgs()
|
long |
getProtocolVersion(String protocol,
long clientVersion)
|
protected HRegion |
getRegion(org.apache.hadoop.io.Text regionName)
Protected utility method for safely obtaining an HRegion handle. |
protected HRegion |
getRegion(org.apache.hadoop.io.Text regionName,
boolean checkRetiringRegions)
Protected utility method for safely obtaining an HRegion handle. |
HRegionInfo |
getRegionInfo(org.apache.hadoop.io.Text regionName)
Get metainfo about an HRegion |
protected Set<HRegion> |
getRegionsToCheck()
|
AtomicInteger |
getRequestCount()
|
HbaseMapWritable |
getRow(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text row)
Get all the data for the specified row |
HbaseMapWritable |
getRow(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName,
org.apache.hadoop.io.Text[] cols,
org.apache.hadoop.io.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<org.apache.hadoop.io.Text,HRegion> onlineRegions
protected volatile Map<org.apache.hadoop.io.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
protected void addProcessingMessage(HRegionInfo hri)
public HRegionInfo getRegionInfo(org.apache.hadoop.io.Text regionName) throws NotServingRegionException
getRegionInfo
in interface HRegionInterface
regionName
- name of the region
NotServingRegionException
public byte[] get(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column) throws IOException
get
in interface HRegionInterface
regionName
- name of regionrow
- row keycolumn
- column key
IOException
public byte[][] get(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, org.apache.hadoop.io.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(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, org.apache.hadoop.io.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 HbaseMapWritable getRow(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row) throws IOException
getRow
in interface HRegionInterface
regionName
- region namerow
- row key
IOException
public HbaseMapWritable getRow(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, long ts) throws IOException
getRow
in interface HRegionInterface
regionName
- region namerow
- row key
IOException
public HbaseMapWritable getClosestRowBefore(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row) throws IOException
getClosestRowBefore
in interface HRegionInterface
regionName
- region namerow
- row key
IOException
public HbaseMapWritable next(long scannerId) throws IOException
next
in interface HRegionInterface
scannerId
- clientId passed to openScanner
IOException
public void batchUpdate(org.apache.hadoop.io.Text regionName, BatchUpdate b) throws IOException
batchUpdate
in interface HRegionInterface
regionName
- name of the region to updateb
- BatchUpdate
IOException
public void batchUpdate(org.apache.hadoop.io.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 long openScanner(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text[] cols, org.apache.hadoop.io.Text firstRow, long timestamp, RowFilterInterface filter) throws IOException
openScanner
in interface HRegionInterface
regionName
- 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 HRegionInterface
scannerId
- the scanner id returned by openScanner
IOException
public void deleteAll(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column, long timestamp) throws IOException
deleteAll
in interface HRegionInterface
regionName
- region namerow
- row keycolumn
- column keytimestamp
- Delete all entries that have this timestamp or older
IOException
public void deleteAll(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, long timestamp) throws IOException
deleteAll
in interface HRegionInterface
regionName
- region namerow
- row keytimestamp
- Delete all entries that have this timestamp or older
IOException
public void deleteFamily(org.apache.hadoop.io.Text regionName, org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text family, long timestamp) throws IOException
deleteFamily
in interface HRegionInterface
regionName
- The name of the region to operate onrow
- The row to operate onfamily
- The column family to matchtimestamp
- Timestamp to match
IOException
public HServerInfo getServerInfo()
public SortedMap<org.apache.hadoop.io.Text,HRegion> getOnlineRegions()
public AtomicInteger getRequestCount()
public FlushRequester getFlushRequester()
protected HRegion getRegion(org.apache.hadoop.io.Text regionName) throws NotServingRegionException
regionName
- Name of online HRegion
to return
HRegion
for regionName
NotServingRegionException
protected HRegion getRegion(org.apache.hadoop.io.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
protected boolean checkFileSystem()
protected Set<HRegion> getRegionsToCheck()
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
getProtocolVersion
in interface org.apache.hadoop.ipc.VersionedProtocol
IOException
protected List<HMsg> getOutboundMsgs()
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 |