public interface HRegionInterface extends VersionedProtocol, Stoppable, Abortable
NOTE: if you change the interface, you must change the RPC version number in HBaseRPCProtocolVersion
Modifier and Type | Field and Description |
---|---|
static long |
VERSION
This Interfaces' version.
|
Modifier and Type | Method and Description |
---|---|
Result |
append(byte[] regionName,
Append append)
Appends values to one or more columns values in a row.
|
boolean |
bulkLoadHFiles(List<Pair<byte[],String>> familyPaths,
byte[] regionName)
Atomically bulk load multiple HFiles (say from different column families)
into an open region.
|
boolean |
bulkLoadHFiles(List<Pair<byte[],String>> familyPaths,
byte[] regionName,
boolean assignSeqNum)
Atomically bulk load multiple HFiles (say from different column families)
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.
|
void |
close(long scannerId)
Close a scanner
|
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.
|
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.
|
boolean |
closeRegion(HRegionInfo region,
int versionOfClosingNode)
Closes the specified region.
|
void |
compactRegion(HRegionInfo regionInfo,
boolean major)
Compacts the specified region.
|
void |
compactRegion(HRegionInfo regionInfo,
boolean major,
byte[] columnFamily)
Compacts a column-family within a specified region.
|
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
|
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(byte[] regionName)
Flush the given region
|
void |
flushRegion(byte[] regionName,
long ifOlderThanTS)
Flush the given region if lastFlushTime < ifOlderThanTS
|
void |
flushRegion(HRegionInfo regionInfo)
Deprecated.
use
flushRegion(byte[]) instead |
Result |
get(byte[] regionName,
Get get)
Perform Get operation.
|
List<BlockCacheColumnFamilySummary> |
getBlockCacheColumnFamilySummaries()
Performs a BlockCache summary and returns a List of BlockCacheColumnFamilySummary objects.
|
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.
|
String |
getCompactionState(byte[] regionName)
Get the current compaction state of the region.
|
HServerInfo |
getHServerInfo()
Deprecated.
|
long |
getLastFlushTime(byte[] regionName)
Gets last flush time for the given region
|
List<HRegionInfo> |
getOnlineRegions() |
HRegionInfo |
getRegionInfo(byte[] regionName)
Get metainfo about an HRegion
|
List<String> |
getStoreFileList(byte[] regionName)
Get a list of store files for all CFs in a particular region
|
List<String> |
getStoreFileList(byte[] regionName,
byte[] columnFamily)
Get a list of store files for a particular CF in a particular region
|
List<String> |
getStoreFileList(byte[] regionName,
byte[][] columnFamilies)
Get a list of store files for a set of CFs in a particular region
|
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.
|
long |
lockRow(byte[] regionName,
byte[] row)
Opens a remote row lock.
|
<R> MultiResponse |
multi(MultiAction<R> multi)
Method used for doing multiple actions(Deletes, Gets and Puts) in one call
|
void |
mutateRow(byte[] regionName,
RowMutations rm) |
Result |
next(long scannerId)
Get the next set of values
|
Result[] |
next(long scannerId,
int numberOfRows)
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.
|
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
|
void |
replicateLogEntries(HLog.Entry[] entries)
Replicates the given entries.
|
byte[][] |
rollHLogWriter()
Roll the log writer.
|
Result[] |
scan(byte[] regionName,
Scan scan,
int numberOfRows)
Perform scan operation.
|
void |
splitRegion(HRegionInfo regionInfo)
Splits the specified region.
|
void |
splitRegion(HRegionInfo regionInfo,
byte[] splitPoint)
Splits the specified region.
|
void |
stop(String why)
Stop this service.
|
void |
unlockRow(byte[] regionName,
long lockId)
Releases a remote row lock.
|
getProtocolSignature, getProtocolVersion
static final long VERSION
HRegionInfo getRegionInfo(byte[] regionName) throws NotServingRegionException, ConnectException, IOException
regionName
- name of the regionNotServingRegionException
ConnectException
IOException
- This can manifest as an Hadoop ipc RemoteException
void flushRegion(byte[] regionName) throws IllegalArgumentException, IOException
region
- nameIllegalArgumentException
IOException
void flushRegion(byte[] regionName, long ifOlderThanTS) throws IllegalArgumentException, IOException
region
- nametimestamp
- IllegalArgumentException
IOException
long getLastFlushTime(byte[] regionName)
List<String> getStoreFileList(byte[] regionName, byte[] columnFamily) throws IllegalArgumentException
region
- nameCF
- nameIllegalArgumentException
List<String> getStoreFileList(byte[] regionName, byte[][] columnFamilies) throws IllegalArgumentException
region
- nameCF
- namesIllegalArgumentException
List<String> getStoreFileList(byte[] regionName) throws IllegalArgumentException
region
- nameIllegalArgumentException
Result getClosestRowBefore(byte[] regionName, byte[] row, byte[] family) throws IOException
regionName
- region namerow
- row keyfamily
- Column family to look for row in.IOException
- eResult get(byte[] regionName, Get get) throws IOException
regionName
- name of region to get fromget
- Get operationIOException
- eboolean exists(byte[] regionName, Get get) throws IOException
regionName
- name of region to get fromget
- Get operation describing cell to testIOException
- evoid put(byte[] regionName, Put put) throws IOException
regionName
- region nameput
- the data to be putIOException
- eint put(byte[] regionName, List<Put> puts) throws IOException
regionName
- region nameputs
- List of puts to executeIOException
- evoid delete(byte[] regionName, Delete delete) throws IOException
regionName
- region namedelete
- delete objectIOException
- eint delete(byte[] regionName, List<Delete> deletes) throws IOException
regionName
- region namedeletes
- delete List to executeIOException
- eboolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) throws IOException
regionName
- region namerow
- row to checkfamily
- column familyqualifier
- column qualifiervalue
- the expected valueput
- data to put if check succeedsIOException
- eboolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete) throws IOException
regionName
- region namerow
- row to checkfamily
- column familyqualifier
- column qualifiervalue
- the expected valuedelete
- data to delete if check succeedsIOException
- elong incrementColumnValue(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException
regionName
- region namerow
- row to checkfamily
- column familyqualifier
- column qualifieramount
- long amount to incrementwriteToWAL
- whether to write the increment to the WALIOException
- evoid mutateRow(byte[] regionName, RowMutations rm) throws IOException
IOException
Result append(byte[] regionName, Append append) throws IOException
This operation does not appear atomic to readers. Appends are done under a row lock but readers do not take row locks.
regionName
- region nameappend
- Append operationIOException
Result increment(byte[] regionName, Increment increment) throws IOException
This operation does not appear atomic to readers. Increments are done under a row lock but readers do not take row locks.
regionName
- region nameincrement
- increment operationIOException
long openScanner(byte[] regionName, Scan scan) throws IOException
regionName
- name of region to scanscan
- configured scan objectIOException
- eResult next(long scannerId) throws IOException
scannerId
- clientId passed to openScannerIOException
- eResult[] next(long scannerId, int numberOfRows) throws IOException
scannerId
- clientId passed to openScannernumberOfRows
- the number of rows to fetchIOException
- evoid close(long scannerId) throws IOException
scannerId
- the scanner id returned by openScannerIOException
- elong lockRow(byte[] regionName, byte[] row) throws IOException
regionName
- name of regionrow
- row to lockIOException
- evoid unlockRow(byte[] regionName, long lockId) throws IOException
regionName
- region namelockId
- the lock id returned by lockRowIOException
- eList<HRegionInfo> getOnlineRegions() throws IOException
IOException
- eHServerInfo getHServerInfo() throws IOException
HServerInfo
; it has RegionServer POV on the
hostname which may not agree w/ how the Master sees this server.IOException
- e<R> MultiResponse multi(MultiAction<R> multi) throws IOException
multi
- IOException
boolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths, byte[] regionName) throws IOException
familyPaths
- List of (family, hfile path) pairsregionName
- name of region to load hfiles intoIOException
- if fails unrecoverablyboolean bulkLoadHFiles(List<Pair<byte[],String>> familyPaths, byte[] regionName, boolean assignSeqNum) throws IOException
familyPaths
- List of (family, hfile path) pairsregionName
- name of region to load hfiles intoassignSeqNum
- should we assign sequence numbersIOException
- if fails unrecoverablyRegionOpeningState openRegion(HRegionInfo region) throws IOException
region
- region to openIOException
RegionOpeningState openRegion(HRegionInfo region, int versionOfOfflineNode) throws IOException
region
- region to openversionOfOfflineNode
- the version of znode to compare when RS transitions the znode from
OFFLINE state.IOException
void openRegions(List<HRegionInfo> regions) throws IOException
regions
- regions to openIOException
boolean closeRegion(HRegionInfo region) throws IOException
region
- region to closeIOException
boolean closeRegion(HRegionInfo region, int versionOfClosingNode) throws IOException
region
- region to closeversionOfClosingNode
- the version of znode to compare when RS transitions the znode
from CLOSING state.IOException
boolean closeRegion(HRegionInfo region, boolean zk) throws IOException
region
- region to closezk
- true if transitions should be done in ZK, false if notIOException
boolean closeRegion(byte[] encodedRegionName, boolean zk) throws IOException
encodedRegionName
- in byteszk
- true if to use zookeeper, false if need not.IOException
void flushRegion(HRegionInfo regionInfo) throws NotServingRegionException, IOException
flushRegion(byte[])
insteadThis method is synchronous.
regionInfo
- region to flushNotServingRegionException
IOException
void splitRegion(HRegionInfo regionInfo) throws NotServingRegionException, IOException
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.
regionInfo
- region to splitNotServingRegionException
IOException
void splitRegion(HRegionInfo regionInfo, byte[] splitPoint) throws NotServingRegionException, IOException
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.
regionInfo
- region to splitsplitPoint
- the explicit row to split onNotServingRegionException
IOException
void compactRegion(HRegionInfo regionInfo, boolean major) throws NotServingRegionException, IOException
This method is asynchronous.
regionInfo
- region to compactmajor
- true to force major compactionNotServingRegionException
IOException
void compactRegion(HRegionInfo regionInfo, boolean major, byte[] columnFamily) throws NotServingRegionException, IOException
This method is asynchronous.
regionInfo
- region to compactmajor
- true to force major compactioncolumnFamily
- column family within a region to compactNotServingRegionException
IOException
void replicateLogEntries(HLog.Entry[] entries) throws IOException
entries
- entries to replicateIOException
ExecResult execCoprocessor(byte[] regionName, Exec call) throws IOException
CoprocessorProtocol
method using the registered protocol handlers.
CoprocessorProtocol
implementations must be registered via the
HRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)
method before they are available.regionName
- name of the region against which the invocation is executedcall
- an Exec
instance identifying the protocol, method name,
and parameters for the method invocationExecResult
instance containing the region name of the
invocation and the return valueIOException
- if no registered protocol handler is found or an error
occurs during the invocationHRegion.registerProtocol(Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)
boolean checkAndPut(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Put put) throws IOException
regionName
- row
- family
- qualifier
- compareOp
- comparator
- put
- IOException
boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family, byte[] qualifier, CompareFilter.CompareOp compareOp, WritableByteArrayComparable comparator, Delete delete) throws IOException
regionName
- row
- family
- qualifier
- compareOp
- comparator
- delete
- IOException
List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries() throws IOException
IOException
- exceptionbyte[][] rollHLogWriter() throws IOException, FailedLogCloseException
HRegionInfo.getEncodedName()
IOException
FailedLogCloseException
String getCompactionState(byte[] regionName) throws IOException
regionName
- the name of the region to check compaction statte.IOException
- exceptionResult[] scan(byte[] regionName, Scan scan, int numberOfRows) throws IOException
regionName
- name of region to get fromScan
- scan operationnumberOfRows
- the maximum number of rows to fetchIOException
- eCopyright © 2014 The Apache Software Foundation. All Rights Reserved.