@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public interface RegionCoprocessorEnvironment extends CoprocessorEnvironment<RegionCoprocessor>
| Modifier and Type | Method and Description |
|---|---|
default OperationQuota |
checkBatchQuota(Region region,
int numWrites,
int numReads)
Check the quota for the current (rpc-context) user.
|
default OperationQuota |
checkBatchQuota(Region region,
OperationQuota.OperationType type)
Check the quota for the current (rpc-context) user.
|
default OperationQuota |
checkScanQuota(Scan scan,
long maxBlockBytesScanned,
long prevBlockBytesScannedDifference)
Check the quota for the current (rpc-context) user.
|
Connection |
createConnection(org.apache.hadoop.conf.Configuration conf)
Creates a cluster connection using the passed Configuration.
|
RawCellBuilder |
getCellBuilder()
Returns a CellBuilder so that coprocessors can build cells.
|
Connection |
getConnection()
Returns the hosts' Connection to the Cluster.
|
MetricRegistry |
getMetricRegistryForRegionServer()
Returns a MetricRegistry that can be used to track metrics at the region server level.
|
OnlineRegions |
getOnlineRegions()
Returns Interface to Map of regions online on this RegionServer
getServerName()}. |
Region |
getRegion()
Returns the region associated with this coprocessor
|
RegionInfo |
getRegionInfo()
Returns region information for the region this coprocessor is running on
|
default RpcQuotaManager |
getRpcQuotaManager()
Returns an RpcQuotaManager that can be used to apply quota checks against the workloads
generated by the coprocessor.
|
ServerName |
getServerName()
Returns Hosting Server's ServerName
|
ConcurrentMap<String,Object> |
getSharedData()
Returns shared data between all instances of this coprocessor
|
getClassLoader, getConfiguration, getHBaseVersion, getInstance, getLoadSequence, getPriority, getVersionRegion getRegion()
RegionInfo getRegionInfo()
OnlineRegions getOnlineRegions()
getServerName()}.ConcurrentMap<String,Object> getSharedData()
ServerName getServerName()
Connection getConnection()
UnsupportedOperationException if you try to close or abort
it. For light-weight usage only. Heavy-duty usage will pull down the hosting RegionServer
responsiveness as well as that of other Coprocessors making use of this Connection. Use to
create table on start or to do administrative operations. Coprocessors should create their own
Connections if heavy usage to avoid impinging on hosting Server operation. To create a
Connection or if a Coprocessor requires a region with a particular Configuration, use
ConnectionFactory or
createConnection(Configuration)}.
Be aware that operations that make use of this Connection are executed as the RegionServer
User, the hbase super user that started this server process. Exercise caution running
operations as this User (See createConnection(Configuration)} to run as other than the
RegionServer User).
Be careful RPC'ing from a Coprocessor context. RPC's will fail, stall, retry, and/or crawl because the remote side is not online, is struggling or it is on the other side of a network partition. Any use of Connection from inside a Coprocessor must be able to handle all such hiccups.
NOTE: the returned Connection is created using User.getCurrent(),so the Connection is as
the System User who running the RegionServer, not the client User who initiate the RPC.
createConnection(Configuration)Connection createConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
ConnectionFactory.createConnection(Configuration)
returns a Connection that will short-circuit RPC if the target is a local resource. Use
ConnectionFactory if you don't need this ability.
Be careful RPC'ing from a Coprocessor context. RPC's will fail, stall, retry, and/or crawl because the remote side is not online, is struggling or it is on the other side of a network partition. Any use of Connection from inside a Coprocessor must be able to handle all such hiccups.
NOTE: the returned Connection is created using User.getCurrent(),so the Connection is as
the System User who running the RegionServer, not the client User who initiate the RPC.
IOExceptionMetricRegistry getMetricRegistryForRegionServer()
See ExampleRegionObserverWithMetrics class in the hbase-examples modules to see examples of how metrics can be instantiated and used.
RawCellBuilder getCellBuilder()
default RpcQuotaManager getRpcQuotaManager()
Introduced in 2.6.1. Any custom implementations of this class should implement this method in order to take advantage of the new behavior.
default OperationQuota checkScanQuota(Scan scan, long maxBlockBytesScanned, long prevBlockBytesScannedDifference) throws IOException, RpcThrottlingException
Introduced in 2.6.1. Any custom implementations of this class should implement this method in order to take advantage of the new behavior.
scan - the scan to be estimated against the quotamaxBlockBytesScanned - the maximum bytes scanned in a single RPC call by the
scannerprevBlockBytesScannedDifference - the difference between BBS of the previous two next
callsRpcThrottlingException - if the operation cannot be executed due to quota exceeded.IOExceptiondefault OperationQuota checkBatchQuota(Region region, OperationQuota.OperationType type) throws IOException, RpcThrottlingException
Introduced in 2.6.1. Any custom implementations of this class should implement this method in order to take advantage of the new behavior.
region - the region where the operation will be performedtype - the operation typeRpcThrottlingException - if the operation cannot be executed due to quota exceeded.IOExceptiondefault OperationQuota checkBatchQuota(Region region, int numWrites, int numReads) throws IOException, RpcThrottlingException
Introduced in 2.6.1. Any custom implementations of this class should implement this method in order to take advantage of the new behavior.
region - the region where the operation will be performednumWrites - number of writes to count against quotanumReads - number of reads to count against quotaRpcThrottlingException - if the operation cannot be executed due to quota exceeded.IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.