|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.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 boolean |
isOnline
|
protected ReentrantReadWriteLock |
lock
|
protected HLog |
log
|
protected int |
numRegionsToReport
|
protected Map<Integer,HRegion> |
onlineRegions
|
protected AtomicBoolean |
quiesced
|
static String |
REGIONSERVER
region server process name |
protected HServerInfo |
serverInfo
|
protected AtomicBoolean |
stopRequested
|
protected int |
threadWakeFrequency
|
Fields inherited from interface org.apache.hadoop.hbase.ipc.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 |
abort()
Cause the server to exit without closing the regions it is serving, the log it is using and without notifying the master. |
protected void |
addProcessingMessage(HRegionInfo hri)
|
protected long |
addRowLock(Integer r,
HRegion region)
|
protected long |
addScanner(InternalScanner s)
|
void |
batchUpdate(byte[] regionName,
BatchUpdate b,
long lockId)
Applies a batch of updates via one RPC |
protected boolean |
checkFileSystem()
Checks to see if the file system is still accessible. |
protected void |
checkOpen()
Called to verify that this server is up and running. |
void |
close(long scannerId)
Close a scanner |
void |
deleteAll(byte[] regionName,
byte[] row,
byte[] column,
long timestamp,
long lockId)
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,
long lockId)
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,
long lockId)
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. |
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. |
HBaseConfiguration |
getConfiguration()
|
SortedMap<Long,HRegion> |
getCopyOfOnlineRegionsSortedBySize()
|
protected org.apache.hadoop.fs.FileSystem |
getFileSystem()
|
FlushRequester |
getFlushRequester()
|
long |
getGlobalMemcacheSize()
Return the total size of all memcaches in every region. |
InfoServer |
getInfoServer()
|
protected Leases |
getLeases()
|
protected HRegionInfo[] |
getMostLoadedRegions()
Get the top N most loaded regions this server is serving so we can tell the master which regions it can reallocate if we're overloaded. |
HRegion |
getOnlineRegion(byte[] regionName)
|
Collection<HRegion> |
getOnlineRegions()
|
protected List<HMsg> |
getOutboundMsgs()
|
long |
getProtocolVersion(String protocol,
long clientVersion)
|
protected HRegion |
getRegion(byte[] regionName)
Protected utility method for safely obtaining an HRegion handle. |
HRegionInfo |
getRegionInfo(byte[] regionName)
Get metainfo about an HRegion |
protected Set<HRegion> |
getRegionsToCheck()
|
AtomicInteger |
getRequestCount()
|
protected org.apache.hadoop.fs.Path |
getRootDir()
|
RowResult |
getRow(byte[] regionName,
byte[] row,
byte[][] columns,
long ts,
long lockId)
Get selected columns for the specified row at a given timestamp. |
HServerInfo |
getServerInfo()
|
SortedSet<HRegionInfo> |
getSortedOnlineRegionInfos()
|
protected void |
init(org.apache.hadoop.io.MapWritable c)
|
protected HRegion |
instantiateRegion(HRegionInfo regionInfo)
|
boolean |
isOnline()
Report the status of the server. |
boolean |
isStopRequested()
|
long |
lockRow(byte[] regionName,
byte[] row)
Opens a remote row lock. |
static void |
main(String[] args)
|
RowResult |
next(long scannerId)
Get the next set of values |
long |
openScanner(byte[] regionName,
byte[][] cols,
byte[] firstRow,
long timestamp,
RowFilterInterface filter)
Opens a remote scanner with a RowFilter. |
void |
run()
The HRegionServer sticks in this loop until closed. |
void |
stop()
Sets a flag that will cause all the HRegionServer threads to shut down in an orderly fashion. |
void |
unlockRow(byte[] regionName,
long lockId)
Releases a remote row lock. |
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 final AtomicBoolean quiesced
protected volatile boolean abortRequested
protected volatile boolean fsOk
protected final HServerInfo serverInfo
protected final HBaseConfiguration conf
protected final Map<Integer,HRegion> onlineRegions
protected final ReentrantReadWriteLock lock
protected final int threadWakeFrequency
protected final int numRegionsToReport
public static final String REGIONSERVER
protected HLog log
protected volatile boolean isOnline
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 init(org.apache.hadoop.io.MapWritable c) throws IOException
IOException
public boolean isOnline()
public void stop()
public void abort()
protected HRegion instantiateRegion(HRegionInfo regionInfo) throws IOException
IOException
protected void addProcessingMessage(HRegionInfo hri)
public HRegionInfo getRegionInfo(byte[] regionName) throws NotServingRegionException
HRegionInterface
getRegionInfo
in interface HRegionInterface
regionName
- name of the region
NotServingRegionException
public Cell[] get(byte[] regionName, byte[] row, byte[] column, long timestamp, int numVersions) throws IOException
HRegionInterface
get
in interface HRegionInterface
regionName
- region namerow
- row keycolumn
- column keytimestamp
- timestampnumVersions
- number of versions to return
IOException
public RowResult getRow(byte[] regionName, byte[] row, byte[][] columns, long ts, long lockId) throws IOException
HRegionInterface
getRow
in interface HRegionInterface
regionName
- region namerow
- row keycolumns
- columns to getts
- time stamplockId
- lock id
IOException
public RowResult getClosestRowBefore(byte[] regionName, byte[] row) throws IOException
HRegionInterface
getClosestRowBefore
in interface HRegionInterface
regionName
- region namerow
- row key
IOException
public RowResult next(long scannerId) throws IOException
HRegionInterface
next
in interface HRegionInterface
scannerId
- clientId passed to openScanner
IOException
public void batchUpdate(byte[] regionName, BatchUpdate b, long lockId) throws IOException
HRegionInterface
batchUpdate
in interface HRegionInterface
regionName
- name of the region to updateb
- BatchUpdatelockId
- lock id
IOException
public long openScanner(byte[] regionName, byte[][] cols, byte[] firstRow, long timestamp, RowFilterInterface filter) throws IOException
HRegionInterface
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
protected long addScanner(InternalScanner s) throws Leases.LeaseStillHeldException
Leases.LeaseStillHeldException
public void close(long scannerId) throws IOException
HRegionInterface
close
in interface HRegionInterface
scannerId
- the scanner id returned by openScanner
IOException
public void deleteAll(byte[] regionName, byte[] row, byte[] column, long timestamp, long lockId) throws IOException
HRegionInterface
deleteAll
in interface HRegionInterface
regionName
- region namerow
- row keycolumn
- column keytimestamp
- Delete all entries that have this timestamp or olderlockId
- lock id
IOException
public void deleteAll(byte[] regionName, byte[] row, long timestamp, long lockId) throws IOException
HRegionInterface
deleteAll
in interface HRegionInterface
regionName
- region namerow
- row keytimestamp
- Delete all entries that have this timestamp or olderlockId
- lock id
IOException
public void deleteFamily(byte[] regionName, byte[] row, byte[] family, long timestamp, long lockId) throws IOException
HRegionInterface
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 matchlockId
- lock id
IOException
public long lockRow(byte[] regionName, byte[] row) throws IOException
HRegionInterface
lockRow
in interface HRegionInterface
regionName
- name of regionrow
- row to lock
IOException
protected long addRowLock(Integer r, HRegion region) throws Leases.LeaseStillHeldException
Leases.LeaseStillHeldException
public void unlockRow(byte[] regionName, long lockId) throws IOException
HRegionInterface
unlockRow
in interface HRegionInterface
lockId
- the lock id returned by lockRow
IOException
public HServerInfo getServerInfo()
public InfoServer getInfoServer()
public boolean isStopRequested()
public HBaseConfiguration getConfiguration()
public Collection<HRegion> getOnlineRegions()
public SortedSet<HRegionInfo> getSortedOnlineRegionInfos()
public SortedMap<Long,HRegion> getCopyOfOnlineRegionsSortedBySize()
public HRegion getOnlineRegion(byte[] regionName)
regionName
-
regionName
or null if named
region is not member of the online regions.public AtomicInteger getRequestCount()
public FlushRequester getFlushRequester()
protected HRegion getRegion(byte[] regionName) throws NotServingRegionException
regionName
- Name of online HRegion
to return
HRegion
for regionName
NotServingRegionException
protected HRegionInfo[] getMostLoadedRegions()
protected void checkOpen() throws IOException
IOException
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()
public long getGlobalMemcacheSize()
protected Leases getLeases()
protected org.apache.hadoop.fs.Path getRootDir()
protected org.apache.hadoop.fs.FileSystem getFileSystem()
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 |