|
||||||||||
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
|
CompactSplitThread |
compactSplitThread
|
protected org.apache.hadoop.conf.Configuration |
conf
|
protected boolean |
fsOk
|
protected AtomicBoolean |
haveRootRegion
|
protected HLog |
hlog
|
protected boolean |
isOnline
|
protected ReentrantReadWriteLock |
lock
|
static org.apache.commons.logging.Log |
LOG
|
protected int |
numRegionsToReport
|
protected Map<String,HRegion> |
onlineRegions
Map of regions currently being served by this region server. |
static String |
REGIONSERVER
region server process name |
protected boolean |
stopped
|
protected int |
threadWakeFrequency
|
Fields inherited from interface org.apache.hadoop.hbase.ipc.HRegionInterface |
---|
VERSION |
Constructor Summary | |
---|---|
HRegionServer(org.apache.hadoop.conf.Configuration conf)
Starts a HRegionServer at the default location |
Method Summary | ||
---|---|---|
void |
abort(String reason)
|
|
void |
abort(String reason,
Throwable cause)
Cause the server to exit without closing the regions it is serving, the log it is using and without notifying the master. |
|
protected long |
addRowLock(Integer r,
HRegion region)
|
|
protected long |
addScanner(RegionScanner s)
|
|
void |
addToOnlineRegions(HRegion region)
Add to online regions. |
|
boolean |
bulkLoadHFiles(List<Pair<byte[],String>> familyPaths,
byte[] regionName)
Atomically bulk load several HFiles into an open region |
|
boolean |
checkAndDelete(byte[] regionName,
byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Delete delete)
Atomically checks if a row/family/qualifier value match the expectedValue. |
|
boolean |
checkAndDelete(byte[] regionName,
byte[] row,
byte[] family,
byte[] qualifier,
CompareFilter.CompareOp compareOp,
WritableByteArrayComparable comparator,
Delete delete)
Atomically checks if a row/family/qualifier value match the expectedValue. |
|
boolean |
checkAndPut(byte[] regionName,
byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Put put)
Atomically checks if a row/family/qualifier value match the expectedValue. |
|
boolean |
checkAndPut(byte[] regionName,
byte[] row,
byte[] family,
byte[] qualifier,
CompareFilter.CompareOp compareOp,
WritableByteArrayComparable comparator,
Put put)
Atomically checks if a row/family/qualifier value match the expectedValue. |
|
boolean |
checkFileSystem()
Checks to see if the file system is still accessible. |
|
boolean |
checkOOME(Throwable e)
Take actions on the event of an OutOfMemoryError. |
|
protected void |
checkOpen()
Called to verify that this server is up and running. |
|
void |
close(long scannerId)
Close a scanner |
|
protected void |
closeAllRegions(boolean abort)
Closes all regions. |
|
boolean |
closeRegion(byte[] encodedRegionName,
boolean zk)
Closes the region in the RS with the specified encoded regionName and will use or not use ZK during the close according to the specified flag. |
|
protected boolean |
closeRegion(byte[] encodedRegionName,
boolean abort,
boolean zk)
|
|
boolean |
closeRegion(HRegionInfo region)
Closes the specified region. |
|
boolean |
closeRegion(HRegionInfo region,
boolean zk)
Closes the specified region and will use or not use ZK during the close according to the specified flag. |
|
protected boolean |
closeRegion(HRegionInfo region,
boolean abort,
boolean zk)
|
|
protected boolean |
closeRegion(HRegionInfo region,
boolean abort,
boolean zk,
int versionOfClosingNode)
|
|
protected boolean |
closeRegion(HRegionInfo region,
boolean zk,
int versionOfClosingNode)
|
|
boolean |
closeRegion(HRegionInfo region,
int versionOfClosingNode)
Closes the specified region. |
|
void |
compactRegion(HRegionInfo regionInfo,
boolean major)
Compacts the specified region. |
|
static HRegionServer |
constructRegionServer(Class<? extends HRegionServer> regionServerClass,
org.apache.hadoop.conf.Configuration conf2)
Utility for constructing an instance of the passed HRegionServer class. |
|
HServerLoad.RegionLoad |
createRegionLoad(String encodedRegionName)
|
|
void |
delete(byte[] regionName,
Delete delete)
Deletes all the KeyValues that match those found in the Delete object, if their ts <= to the Delete. |
|
int |
delete(byte[] regionName,
List<Delete> deletes)
Put an array of deletes into the specified region |
|
protected void |
doMetrics()
|
|
ExecResult |
execCoprocessor(byte[] regionName,
Exec call)
Executes a single CoprocessorProtocol
method using the registered protocol handlers. |
|
boolean |
exists(byte[] regionName,
Get get)
Perform exists operation. |
|
void |
flushRegion(HRegionInfo regionInfo)
Flushes the MemStore of the specified region. |
|
Result |
get(byte[] regionName,
Get get)
Perform Get operation. |
|
List<BlockCacheColumnFamilySummary> |
getBlockCacheColumnFamilySummaries()
Performs a BlockCache summary and returns a List of BlockCacheColumnFamilySummary objects. |
|
CatalogTracker |
getCatalogTracker()
|
|
Result |
getClosestRowBefore(byte[] regionName,
byte[] row,
byte[] family)
Return all the data for the row that matches row exactly, or the one that immediately preceeds it. |
|
CompactionRequestor |
getCompactionRequester()
|
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the configuration object for this server. |
|
String[] |
getCoprocessors()
|
|
SortedMap<Long,HRegion> |
getCopyOfOnlineRegionsSortedBySize()
|
|
ExecutorService |
getExecutorService()
|
|
protected org.apache.hadoop.fs.FileSystem |
getFileSystem()
|
|
FlushRequester |
getFlushRequester()
|
|
HRegion |
getFromOnlineRegions(String encodedRegionName)
Return HRegion instance. |
|
HServerInfo |
getHServerInfo()
Deprecated. Use getServerName() instead. |
|
InfoServer |
getInfoServer()
|
|
protected Leases |
getLeases()
|
|
protected org.apache.hadoop.hbase.regionserver.LogRoller |
getLogRoller()
|
|
RegionServerMetrics |
getMetrics()
|
|
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. |
|
int |
getNumberOfOnlineRegions()
|
|
HRegion |
getOnlineRegion(byte[] regionName)
|
|
List<HRegionInfo> |
getOnlineRegions()
|
|
Collection<HRegion> |
getOnlineRegionsLocalContext()
For tests and web ui. |
|
ProtocolSignature |
getProtocolSignature(String protocol,
long version,
int clientMethodsHashCode)
Return protocol version corresponding to protocol interface. |
|
long |
getProtocolVersion(String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
|
protected HRegion |
getRegion(byte[] regionName)
Protected utility method for safely obtaining an HRegion handle. |
|
HRegionInfo |
getRegionInfo(byte[] regionName)
Get metainfo about an HRegion |
|
RegionServerAccounting |
getRegionServerAccounting()
|
|
ConcurrentSkipListMap<byte[],Boolean> |
getRegionsInTransitionInRS()
Get the regions that are currently being opened or closed in the RS |
|
byte[] |
getRegionStats(String encodedRegionName)
|
|
AtomicInteger |
getRequestCount()
|
|
protected org.apache.hadoop.fs.Path |
getRootDir()
|
|
HBaseRpcMetrics |
getRpcMetrics()
Return a reference to the metrics instance used for counting RPC calls. |
|
RpcServer |
getRpcServer()
Returns a reference to the region server's RPC server |
|
HServerInfo |
getServerInfo()
|
|
ServerName |
getServerName()
|
|
long |
getStartcode()
|
|
int |
getThreadWakeFrequency()
Interval at which threads should run |
|
HLog |
getWAL()
|
|
protected List<WALActionsListener> |
getWALActionListeners()
Called by instantiateHLog(Path, Path) setting up WAL instance. |
|
ZooKeeperWatcher |
getZooKeeper()
Gets the ZooKeeper instance for this server. |
|
ZooKeeperWatcher |
getZooKeeperWatcher()
|
|
protected void |
handleReportForDutyResponse(org.apache.hadoop.io.MapWritable c)
|
|
Result |
increment(byte[] regionName,
Increment increment)
Increments one or more columns values in a row. |
|
long |
incrementColumnValue(byte[] regionName,
byte[] row,
byte[] family,
byte[] qualifier,
long amount,
boolean writeToWAL)
Atomically increments a column value. |
|
protected HLog |
instantiateHLog(org.apache.hadoop.fs.Path logdir,
org.apache.hadoop.fs.Path oldLogDir)
Called by setupWALAndReplication() creating WAL instance. |
|
boolean |
isAborted()
Check if the server or client was aborted. |
|
boolean |
isOnline()
Report the status of the server. |
|
boolean |
isStopped()
|
|
boolean |
isStopping()
|
|
protected void |
join()
Wait on all threads to finish. |
|
protected void |
kill()
|
|
long |
lockRow(byte[] regionName,
byte[] row)
Opens a remote row lock. |
|
static void |
main(String[] args)
|
|
protected void |
metrics()
|
|
|
multi(MultiAction<R> multi)
Method used for doing multiple actions(Deletes, Gets and Puts) in one call |
|
Result |
next(long scannerId)
Get the next set of values |
|
Result[] |
next(long scannerId,
int nbRows)
Get the next set of values |
|
RegionOpeningState |
openRegion(HRegionInfo region)
Opens the specified region. |
|
RegionOpeningState |
openRegion(HRegionInfo region,
int versionOfOfflineNode)
Opens the specified region. |
|
void |
openRegions(List<HRegionInfo> regions)
Opens the specified regions. |
|
long |
openScanner(byte[] regionName,
Scan scan)
Opens a remote scanner with a RowFilter. |
|
void |
postOpenDeployTasks(HRegion r,
CatalogTracker ct,
boolean daughter)
Tasks to perform after region open to complete deploy of region on regionserver |
|
int |
put(byte[] regionName,
List<Put> puts)
Put an array of puts into the specified region |
|
void |
put(byte[] regionName,
Put put)
Put data into the specified region |
|
boolean |
removeFromOnlineRegions(String encodedName)
This method removes HRegion corresponding to hri from the Map of onlineRegions. |
|
void |
replicateLogEntries(HLog.Entry[] entries)
Replicates the given entries. |
|
byte[][] |
rollHLogWriter()
Roll the log writer. |
|
void |
run()
The HRegionServer sticks in this loop until closed. |
|
void |
splitRegion(HRegionInfo regionInfo)
Splits the specified region. |
|
void |
splitRegion(HRegionInfo regionInfo,
byte[] splitPoint)
Splits the specified region. |
|
static Thread |
startRegionServer(HRegionServer hrs)
|
|
static Thread |
startRegionServer(HRegionServer hrs,
String name)
|
|
void |
stop(String msg)
Stop this service. |
|
String |
toString()
|
|
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, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
protected volatile boolean stopped
protected volatile boolean abortRequested
protected volatile boolean fsOk
protected final org.apache.hadoop.conf.Configuration conf
protected final AtomicBoolean haveRootRegion
protected final Map<String,HRegion> onlineRegions
protected final ReentrantReadWriteLock lock
protected final int threadWakeFrequency
protected final int numRegionsToReport
public static final String REGIONSERVER
public CompactSplitThread compactSplitThread
protected volatile HLog hlog
protected volatile boolean isOnline
Constructor Detail |
---|
public HRegionServer(org.apache.hadoop.conf.Configuration conf) throws IOException, InterruptedException
conf
-
IOException
InterruptedException
Method Detail |
---|
public void run()
run
in interface Runnable
protected void handleReportForDutyResponse(org.apache.hadoop.io.MapWritable c) throws IOException
IOException
public RegionServerAccounting getRegionServerAccounting()
getRegionServerAccounting
in interface RegionServerServices
public HServerLoad.RegionLoad createRegionLoad(String encodedRegionName)
encodedRegionName
-
public boolean checkOOME(Throwable e)
HBaseRPCErrorHandler
checkOOME
in interface HBaseRPCErrorHandler
e
- the throwable
public boolean checkFileSystem()
public boolean isOnline()
protected HLog instantiateHLog(org.apache.hadoop.fs.Path logdir, org.apache.hadoop.fs.Path oldLogDir) throws IOException
setupWALAndReplication()
creating WAL instance.
logdir
- oldLogDir
-
IOException
protected List<WALActionsListener> getWALActionListeners()
instantiateHLog(Path, Path)
setting up WAL instance.
Add any WALActionsListener
s you want inserted before WAL startup.
HLog
on construction.protected org.apache.hadoop.hbase.regionserver.LogRoller getLogRoller()
protected void doMetrics()
protected void metrics()
public RegionServerMetrics getMetrics()
public HLog getWAL()
getWAL
in interface RegionServerServices
public CatalogTracker getCatalogTracker()
CatalogTracker
public void stop(String msg)
Stoppable
stop
in interface HRegionInterface
stop
in interface Stoppable
msg
- Why we're stopping.public void postOpenDeployTasks(HRegion r, CatalogTracker ct, boolean daughter) throws org.apache.zookeeper.KeeperException, IOException
RegionServerServices
postOpenDeployTasks
in interface RegionServerServices
r
- Region to open.ct
- Instance of CatalogTracker
daughter
- True if this is daughter of a split
org.apache.zookeeper.KeeperException
IOException
public HBaseRpcMetrics getRpcMetrics()
public RpcServer getRpcServer()
RegionServerServices
getRpcServer
in interface RegionServerServices
public void abort(String reason, Throwable cause)
abort
in interface Abortable
reason
- the reason we are abortingcause
- the exception that caused the abort, or nullpublic void abort(String reason)
abort(String, Throwable)
public boolean isAborted()
Abortable
isAborted
in interface Abortable
protected void kill()
protected void join()
protected void closeAllRegions(boolean abort)
public HRegionInfo getRegionInfo(byte[] regionName) throws NotServingRegionException, IOException
HRegionInterface
getRegionInfo
in interface HRegionInterface
regionName
- name of the region
NotServingRegionException
ConnectException
IOException
- This can manifest as an Hadoop ipc RemoteException
public Result getClosestRowBefore(byte[] regionName, byte[] row, byte[] family) throws IOException
HRegionInterface
getClosestRowBefore
in interface HRegionInterface
regionName
- region namerow
- row keyfamily
- Column family to look for row in.
IOException
- epublic Result get(byte[] regionName, Get get) throws IOException
get
in interface HRegionInterface
regionName
- name of region to get fromget
- Get operation
IOException
- epublic boolean exists(byte[] regionName, Get get) throws IOException
HRegionInterface
exists
in interface HRegionInterface
regionName
- name of region to get fromget
- Get operation describing cell to test
IOException
- epublic void put(byte[] regionName, Put put) throws IOException
HRegionInterface
put
in interface HRegionInterface
regionName
- region nameput
- the data to be put
IOException
- epublic int put(byte[] regionName, List<Put> puts) throws IOException
HRegionInterface
put
in interface HRegionInterface
regionName
- region nameputs
- List of puts to execute
IOException
- epublic boolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) throws IOException
HRegionInterface
checkAndPut
in interface HRegionInterface
regionName
- row
- family
- qualifier
- value
- the expected valueput
-
IOException
public boolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put) throws IOException
HRegionInterface
checkAndPut
in interface HRegionInterface
regionName
- row
- family
- qualifier
- compareOp
- comparator
- put
-
IOException
public boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException
HRegionInterface
checkAndDelete
in interface HRegionInterface
regionName
- row
- family
- qualifier
- value
- the expected valuedelete
-
IOException
public boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete) throws IOException
HRegionInterface
checkAndDelete
in interface HRegionInterface
regionName
- row
- family
- qualifier
- compareOp
- comparator
- delete
-
IOException
public long openScanner(byte[] regionName, Scan scan) throws IOException
HRegionInterface
openScanner
in interface HRegionInterface
regionName
- name of region to scanscan
- configured scan object
IOException
- eprotected long addScanner(RegionScanner s) throws Leases.LeaseStillHeldException
Leases.LeaseStillHeldException
public Result next(long scannerId) throws IOException
HRegionInterface
next
in interface HRegionInterface
scannerId
- clientId passed to openScanner
IOException
- epublic Result[] next(long scannerId, int nbRows) throws IOException
HRegionInterface
next
in interface HRegionInterface
scannerId
- clientId passed to openScannernbRows
- the number of rows to fetch
IOException
- epublic void close(long scannerId) throws IOException
HRegionInterface
close
in interface HRegionInterface
scannerId
- the scanner id returned by openScanner
IOException
- epublic void delete(byte[] regionName, Delete delete) throws IOException
HRegionInterface
delete
in interface HRegionInterface
regionName
- region namedelete
- delete object
IOException
- epublic int delete(byte[] regionName, List<Delete> deletes) throws IOException
HRegionInterface
delete
in interface HRegionInterface
regionName
- region namedeletes
- delete List to execute
IOException
- epublic long lockRow(byte[] regionName, byte[] row) throws IOException
HRegionInterface
lockRow
in interface HRegionInterface
regionName
- name of regionrow
- row to lock
IOException
- eprotected 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
regionName
- region namelockId
- the lock id returned by lockRow
IOException
- epublic boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths, byte[] regionName) throws IOException
bulkLoadHFiles
in interface HRegionInterface
familyPaths
- List of (family, hfile path) pairsregionName
- name of region to load hfiles into
IOException
- if failed unrecoverablypublic RegionOpeningState openRegion(HRegionInfo region) throws IOException
HRegionInterface
openRegion
in interface HRegionInterface
region
- region to open
IOException
public RegionOpeningState openRegion(HRegionInfo region, int versionOfOfflineNode) throws IOException
HRegionInterface
openRegion
in interface HRegionInterface
region
- region to openversionOfOfflineNode
- the version of znode to compare when RS transitions the znode from
OFFLINE state.
IOException
public void openRegions(List<HRegionInfo> regions) throws IOException
HRegionInterface
openRegions
in interface HRegionInterface
regions
- regions to open
IOException
public boolean closeRegion(HRegionInfo region) throws IOException
HRegionInterface
closeRegion
in interface HRegionInterface
region
- region to close
IOException
public boolean closeRegion(HRegionInfo region, int versionOfClosingNode) throws IOException
HRegionInterface
closeRegion
in interface HRegionInterface
region
- region to closeversionOfClosingNode
- the version of znode to compare when RS transitions the znode
from CLOSING state.
IOException
public boolean closeRegion(HRegionInfo region, boolean zk) throws IOException
HRegionInterface
closeRegion
in interface HRegionInterface
region
- region to closezk
- true if transitions should be done in ZK, false if not
IOException
protected boolean closeRegion(HRegionInfo region, boolean zk, int versionOfClosingNode) throws IOException
IOException
public boolean closeRegion(byte[] encodedRegionName, boolean zk) throws IOException
HRegionInterface
closeRegion
in interface HRegionInterface
encodedRegionName
- in byteszk
- true if to use zookeeper, false if need not.
IOException
protected boolean closeRegion(HRegionInfo region, boolean abort, boolean zk)
region
- Region to closeabort
- True if we are abortingzk
- True if we are to update zk about the region close; if the close
was orchestrated by master, then update zk. If the close is being run by
the regionserver because its going down, don't update zk.
protected boolean closeRegion(HRegionInfo region, boolean abort, boolean zk, int versionOfClosingNode)
region
- Region to closeabort
- True if we are abortingzk
- True if we are to update zk about the region close; if the close
was orchestrated by master, then update zk. If the close is being run by
the regionserver because its going down, don't update zk.versionOfClosingNode
- the version of znode to compare when RS transitions the znode from
CLOSING state.
protected boolean closeRegion(byte[] encodedRegionName, boolean abort, boolean zk) throws IOException
encodedRegionName
- encodedregionName to closeabort
- True if we are abortingzk
- True if we are to update zk about the region close; if the close
was orchestrated by master, then update zk. If the close is being
run by the regionserver because its going down, don't update zk.
IOException
public void flushRegion(HRegionInfo regionInfo) throws NotServingRegionException, IOException
HRegionInterface
This method is synchronous.
flushRegion
in interface HRegionInterface
regionInfo
- region to flush
NotServingRegionException
IOException
public void splitRegion(HRegionInfo regionInfo) throws NotServingRegionException, IOException
HRegionInterface
This method currently flushes the region and then forces a compaction which will then trigger a split. The flush is done synchronously but the compaction is asynchronous.
splitRegion
in interface HRegionInterface
regionInfo
- region to split
NotServingRegionException
IOException
public void splitRegion(HRegionInfo regionInfo, byte[] splitPoint) throws NotServingRegionException, IOException
HRegionInterface
This method currently flushes the region and then forces a compaction which will then trigger a split. The flush is done synchronously but the compaction is asynchronous.
splitRegion
in interface HRegionInterface
regionInfo
- region to splitsplitPoint
- the explicit row to split on
NotServingRegionException
IOException
public void compactRegion(HRegionInfo regionInfo, boolean major) throws NotServingRegionException, IOException
HRegionInterface
This method is asynchronous.
compactRegion
in interface HRegionInterface
regionInfo
- region to compactmajor
- true to force major compaction
NotServingRegionException
IOException
public InfoServer getInfoServer()
public boolean isStopped()
isStopped
in interface Stoppable
public boolean isStopping()
isStopping
in interface RegionServerServices
public org.apache.hadoop.conf.Configuration getConfiguration()
Server
public List<HRegionInfo> getOnlineRegions() throws IOException
getOnlineRegions
in interface HRegionInterface
IOException
- epublic int getNumberOfOnlineRegions()
public byte[] getRegionStats(String encodedRegionName) throws IOException
encodedRegionName
-
encodedRegionName
IOException
public Collection<HRegion> getOnlineRegionsLocalContext()
getOnlineRegions()
public void addToOnlineRegions(HRegion region)
public boolean removeFromOnlineRegions(String encodedName)
public SortedMap<Long,HRegion> getCopyOfOnlineRegionsSortedBySize()
public HRegion getFromOnlineRegions(String encodedRegionName)
HRegion
instance.
Only works if caller is in same context, in same JVM. HRegion is not
serializable.
encodedRegionName
or
null if named region is not member of the online regions.public HRegion getOnlineRegion(byte[] regionName)
regionName
-
regionName
or null if
named region is not member of the online regions.public AtomicInteger getRequestCount()
public long getStartcode()
public FlushRequester getFlushRequester()
getFlushRequester
in interface RegionServerServices
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
public ProtocolSignature getProtocolSignature(String protocol, long version, int clientMethodsHashCode) throws IOException
VersionedProtocol
getProtocolSignature
in interface VersionedProtocol
protocol
- The classname of the protocol interfaceversion
- The version of the protocol that the client speaksclientMethodsHashCode
- the hashcode of client protocol methods
IOException
for a default implementation
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
VersionedProtocol
getProtocolVersion
in interface VersionedProtocol
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaks
IOException
- if any IO error occursprotected Leases getLeases()
protected org.apache.hadoop.fs.Path getRootDir()
protected org.apache.hadoop.fs.FileSystem getFileSystem()
public HServerInfo getServerInfo()
HServerInfo
public Result increment(byte[] regionName, Increment increment) throws IOException
HRegionInterface
This operation does not appear atomic to readers. Increments are done under a row lock but readers do not take row locks.
increment
in interface HRegionInterface
regionName
- region nameincrement
- increment operation
IOException
public long incrementColumnValue(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException
incrementColumnValue
in interface HRegionInterface
regionName
- region namerow
- row to checkfamily
- column familyqualifier
- column qualifieramount
- long amount to incrementwriteToWAL
- whether to write the increment to the WAL
IOException
- epublic HServerInfo getHServerInfo() throws IOException
getServerName()
instead.
getHServerInfo
in interface HRegionInterface
HServerInfo
; it has RegionServer POV on the
hostname which may not agree w/ how the Master sees this server.
IOException
- epublic <R> MultiResponse multi(MultiAction<R> multi) throws IOException
HRegionInterface
multi
in interface HRegionInterface
IOException
public ExecResult execCoprocessor(byte[] regionName, Exec call) throws IOException
CoprocessorProtocol
method using the registered protocol handlers.
CoprocessorProtocol
implementations must be registered per-region
via the
HRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)
method before they are available.
execCoprocessor
in interface HRegionInterface
regionName
- name of the region against which the invocation is executedcall
- an Exec
instance identifying the protocol, method name,
and parameters for the method invocation
ExecResult
instance containing the region name of the
invocation and the return value
IOException
- if no registered protocol handler is found or an error
occurs during the invocationHRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)
public String toString()
toString
in class Object
public int getThreadWakeFrequency()
public ZooKeeperWatcher getZooKeeper()
Server
public ServerName getServerName()
public CompactionRequestor getCompactionRequester()
getCompactionRequester
in interface RegionServerServices
CompactionRequestor
or null.public ZooKeeperWatcher getZooKeeperWatcher()
public ConcurrentSkipListMap<byte[],Boolean> getRegionsInTransitionInRS()
RegionServerServices
getRegionsInTransitionInRS
in interface RegionServerServices
public ExecutorService getExecutorService()
public static Thread startRegionServer(HRegionServer hrs) throws IOException
hrs
-
IOException
public static Thread startRegionServer(HRegionServer hrs, String name) throws IOException
hrs
- name
-
IOException
public static HRegionServer constructRegionServer(Class<? extends HRegionServer> regionServerClass, org.apache.hadoop.conf.Configuration conf2)
regionServerClass
- conf2
-
public void replicateLogEntries(HLog.Entry[] entries) throws IOException
HRegionInterface
replicateLogEntries
in interface HRegionInterface
entries
- entries to replicate
IOException
public static void main(String[] args) throws Exception
Exception
HRegionServerCommandLine
public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries() throws IOException
HRegionInterface
getBlockCacheColumnFamilySummaries
in interface HRegionInterface
IOException
- exceptionpublic byte[][] rollHLogWriter() throws IOException, FailedLogCloseException
HRegionInterface
rollHLogWriter
in interface HRegionInterface
HRegionInfo.getEncodedName()
IOException
FailedLogCloseException
public String[] getCoprocessors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |