@InterfaceAudience.Private public class HRegion extends Object implements HeapSize, PropagatingConfigurationObserver, Region
An Region is defined by its table and its key extent.
Locking at the Region level serves only one purpose: preventing the region from being closed (and consequently split) while other operations are ongoing. Each row level operation obtains both a row lock and a region read lock for the duration of the operation. While a scanner is being constructed, getScanner holds a read lock. If the scanner is successfully constructed, it holds a read lock until it is closed. A close takes out a write lock and consequently will block for ongoing operations and will block new operations from starting while the close is in progress.
| Modifier and Type | Class and Description |
|---|---|
static interface |
HRegion.BulkLoadListener
Listener class to enable callers of
bulkLoadHFile() to perform any necessary
pre/post processing of a given bulkload call
|
static interface |
HRegion.FlushResult |
static class |
HRegion.FlushResultImpl
Objects from this class are created when flushing to describe all the different states that
that method ends up in.
|
static class |
HRegion.RowLockImpl
Class used to represent a lock on a row.
|
Region.Operation, Region.RowLock| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
static long |
DEEP_OVERHEAD |
static int |
DEFAULT_CACHE_FLUSH_INTERVAL
Default interval for the memstore flush
|
static long |
DEFAULT_FLUSH_PER_CHANGES |
static int |
DEFAULT_HBASE_REGIONSERVER_MINIBATCH_SIZE |
static int |
DEFAULT_MAX_CELL_SIZE |
static boolean |
DEFAULT_WAL_HSYNC |
static long |
FIXED_OVERHEAD |
static String |
HBASE_MAX_CELL_SIZE_KEY |
static String |
HBASE_REGIONSERVER_MINIBATCH_SIZE |
protected long |
lastReplayedCompactionSeqId |
protected long |
lastReplayedOpenRegionSeqId
The sequence id of the last replayed open region event from the primary region.
|
static String |
LOAD_CFS_ON_DEMAND_CONFIG_KEY |
static long |
MAX_FLUSH_PER_CHANGES
The following MAX_FLUSH_PER_CHANGES is large enough because each KeyValue has 20+ bytes
overhead.
|
static String |
MEMSTORE_FLUSH_PER_CHANGES
Conf key to force a flush if there are already enough changes for one region in memstore
|
static String |
MEMSTORE_PERIODIC_FLUSH_INTERVAL
Conf key for the periodic flush interval
|
protected Map<byte[],HStore> |
stores |
static int |
SYSTEM_CACHE_FLUSH_INTERVAL
Default interval for System tables memstore flush
|
static String |
WAL_HSYNC_CONF_KEY |
| Constructor and Description |
|---|
HRegion(HRegionFileSystem fs,
WAL wal,
org.apache.hadoop.conf.Configuration confParam,
TableDescriptor htd,
RegionServerServices rsServices)
HRegion constructor.
|
HRegion(org.apache.hadoop.fs.Path tableDir,
WAL wal,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration confParam,
RegionInfo regionInfo,
TableDescriptor htd,
RegionServerServices rsServices)
Deprecated.
Use other constructors.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRegionToSnapshot(SnapshotProtos.SnapshotDescription desc,
ForeignExceptionSnare exnSnare)
Complete taking the snapshot on the region.
|
Result |
append(Append append)
Perform one or more append operations on a row.
|
Result |
append(Append mutation,
long nonceGroup,
long nonce) |
boolean |
areWritesEnabled() |
OperationStatus[] |
batchMutate(Mutation[] mutations)
Perform a batch of mutations.
|
OperationStatus[] |
batchMutate(Mutation[] mutations,
boolean atomic,
long nonceGroup,
long nonce) |
OperationStatus[] |
batchMutate(Mutation[] mutations,
long nonceGroup,
long nonce) |
OperationStatus[] |
batchReplay(WALSplitter.MutationReplay[] mutations,
long replaySeqId) |
void |
blockUpdates() |
Map<byte[],List<org.apache.hadoop.fs.Path>> |
bulkLoadHFiles(Collection<Pair<byte[],String>> familyPaths,
boolean assignSeqId,
HRegion.BulkLoadListener bulkLoadListener)
Attempts to atomically load a group of hfiles.
|
Map<byte[],List<org.apache.hadoop.fs.Path>> |
bulkLoadHFiles(Collection<Pair<byte[],String>> familyPaths,
boolean assignSeqId,
HRegion.BulkLoadListener bulkLoadListener,
boolean copyFile)
Attempts to atomically load a group of hfiles.
|
boolean |
checkAndMutate(byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
TimeRange timeRange,
Mutation mutation)
Atomically checks if a row/family/qualifier value matches the expected value and if it does,
it performs the mutation.
|
boolean |
checkAndRowMutate(byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
TimeRange timeRange,
RowMutations rm)
Atomically checks if a row/family/qualifier value matches the expected values and if it does,
it performs the row mutations.
|
void |
checkFamilies(Collection<byte[]> families)
Check the collection of families for validity.
|
protected void |
checkReadOnly() |
protected void |
checkReadsEnabled() |
byte[] |
checkSplit()
Return the splitpoint.
|
void |
checkTimestamps(Map<byte[],List<Cell>> familyMap,
long now)
Check the collection of families for valid timestamps
|
Map<byte[],List<HStoreFile>> |
close()
Close down this HRegion.
|
Map<byte[],List<HStoreFile>> |
close(boolean abort)
Close down this HRegion.
|
void |
closeRegionOperation()
Closes the region operation lock.
|
void |
closeRegionOperation(Region.Operation operation)
Closes the region operation lock.
|
void |
compact(boolean majorCompaction)
Synchronously compact all stores in the region.
|
boolean |
compact(CompactionContext compaction,
HStore store,
ThroughputController throughputController)
Called by compaction thread and after region is opened to compact the
HStores if necessary.
|
boolean |
compact(CompactionContext compaction,
HStore store,
ThroughputController throughputController,
User user) |
void |
compactStores()
This is a helper function that compact all the stores synchronously.
|
static HDFSBlocksDistribution |
computeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf,
TableDescriptor tableDescriptor,
RegionInfo regionInfo)
This is a helper function to compute HDFS block distribution on demand
|
static HDFSBlocksDistribution |
computeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf,
TableDescriptor tableDescriptor,
RegionInfo regionInfo,
org.apache.hadoop.fs.Path tablePath)
This is a helper function to compute HDFS block distribution on demand
|
static HRegion |
createHRegion(RegionInfo info,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.conf.Configuration conf,
TableDescriptor hTableDescriptor,
WAL wal) |
static HRegion |
createHRegion(RegionInfo info,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.conf.Configuration conf,
TableDescriptor hTableDescriptor,
WAL wal,
boolean initialize)
Convenience method creating new HRegions.
|
void |
decrementCompactionsQueuedCount() |
void |
delete(Delete delete)
Deletes the specified cells/row.
|
void |
deregisterChildren(ConfigurationManager manager)
Needs to be called to deregister the children from the manager.
|
protected void |
doRegionCompactionPrep()
Do preparation for pending compaction.
|
MemStoreSize |
dropMemStoreContents()
Be careful, this method will drop all data in the memstore of this region.
|
boolean |
equals(Object o) |
com.google.protobuf.Message |
execService(com.google.protobuf.RpcController controller,
ClientProtos.CoprocessorServiceCall call)
Executes a single protocol buffer coprocessor endpoint
Service method using
the registered protocol handlers. |
HRegion.FlushResult |
flush(boolean force)
Flush the cache.
|
HRegion.FlushResultImpl |
flushcache(boolean forceFlushAllStores,
boolean writeFlushRequestWalMarker,
FlushLifeCycleTracker tracker)
Flush the cache.
|
Result |
get(Get get)
Do a get based on the get parameter.
|
List<Cell> |
get(Get get,
boolean withCoprocessor)
Do a get based on the get parameter.
|
List<Cell> |
get(Get get,
boolean withCoprocessor,
long nonceGroup,
long nonce) |
long |
getBlockedRequestsCount() |
CellComparator |
getCellComparator()
The comparator to be used with the region
|
long |
getCheckAndMutateChecksFailed() |
long |
getCheckAndMutateChecksPassed() |
CompactionState |
getCompactionState() |
int |
getCompactPriority() |
RegionCoprocessorHost |
getCoprocessorHost() |
long |
getDataInMemoryWithoutWAL() |
long |
getEarliestFlushTimeForAllStores() |
protected Durability |
getEffectiveDurability(Durability d)
Returns effective durability from the passed durability and
the table descriptor.
|
org.apache.hadoop.fs.FileSystem |
getFilesystem() |
long |
getFilteredReadRequestsCount() |
HDFSBlocksDistribution |
getHDFSBlocksDistribution() |
ClientProtos.RegionLoadStats |
getLoadStatistics() |
ConcurrentHashMap<HashedBytes,org.apache.hadoop.hbase.regionserver.HRegion.RowLockContext> |
getLockedRows() |
long |
getMaxFlushedSeqId() |
Map<byte[],Long> |
getMaxStoreSeqId() |
long |
getMemStoreDataSize() |
long |
getMemStoreFlushSize() |
long |
getMemStoreHeapSize() |
long |
getMemStoreOffHeapSize() |
MetricsRegion |
getMetrics() |
MultiVersionConcurrencyControl |
getMVCC() |
protected long |
getNextSequenceId(WAL wal)
Method to safely get the next sequence number.
|
long |
getNumMutationsWithoutWAL() |
long |
getOldestHfileTs(boolean majorCompactionOnly)
This can be used to determine the last time all files of this region were major compacted.
|
long |
getOldestSeqIdOfStore(byte[] familyName) |
long |
getOpenSeqNum() |
int |
getReadLockCount() |
long |
getReadPoint() |
long |
getReadPoint(IsolationLevel isolationLevel) |
long |
getReadRequestsCount() |
static org.apache.hadoop.fs.Path |
getRegionDir(org.apache.hadoop.fs.Path rootdir,
RegionInfo info)
Deprecated.
For tests only; to be removed.
|
static org.apache.hadoop.fs.Path |
getRegionDir(org.apache.hadoop.fs.Path tabledir,
String name)
Deprecated.
For tests only; to be removed.
|
HRegionFileSystem |
getRegionFileSystem() |
RegionInfo |
getRegionInfo() |
RegionServicesForStores |
getRegionServicesForStores() |
NavigableMap<byte[],Integer> |
getReplicationScope() |
Region.RowLock |
getRowLock(byte[] row)
Get an exclusive ( write lock ) lock on a given row.
|
Region.RowLock |
getRowLock(byte[] row,
boolean readLock)
Get a row lock for the specified row.
|
protected Region.RowLock |
getRowLockInternal(byte[] row,
boolean readLock,
Region.RowLock prevRowLock) |
org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl |
getScanner(Scan scan)
Return an iterator that scans over the HRegion, returning the indicated
columns and rows specified by the
Scan. |
org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl |
getScanner(Scan scan,
List<KeyValueScanner> additionalScanners)
Return an iterator that scans over the HRegion, returning the indicated columns and rows
specified by the
Scan. |
long |
getSmallestReadPoint() |
RegionSplitPolicy |
getSplitPolicy() |
HStore |
getStore(byte[] column)
Return the Store for the given family
|
List<String> |
getStoreFileList(byte[][] columns) |
protected ThreadPoolExecutor |
getStoreFileOpenAndCloseThreadPool(String threadNamePrefix) |
protected ThreadPoolExecutor |
getStoreOpenAndCloseThreadPool(String threadNamePrefix) |
List<HStore> |
getStores()
Return the list of Stores managed by this region
|
TableDescriptor |
getTableDescriptor() |
WAL |
getWAL() |
org.apache.hadoop.fs.Path |
getWALRegionDir() |
long |
getWriteRequestsCount() |
int |
hashCode() |
boolean |
hasReferences() |
long |
heapSize() |
Result |
increment(Increment increment)
Perform one or more increment operations on a row.
|
Result |
increment(Increment mutation,
long nonceGroup,
long nonce) |
void |
incrementCompactionsQueuedCount() |
void |
incrementFlushesQueuedCount() |
long |
initialize()
Deprecated.
use HRegion.createHRegion() or HRegion.openHRegion()
|
protected HStore |
instantiateHStore(ColumnFamilyDescriptor family) |
protected RegionScanner |
instantiateRegionScanner(Scan scan,
List<KeyValueScanner> additionalScanners) |
protected org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl |
instantiateRegionScanner(Scan scan,
List<KeyValueScanner> additionalScanners,
long nonceGroup,
long nonce) |
protected HRegion.FlushResultImpl |
internalFlushcache(WAL wal,
long myseqid,
Collection<HStore> storesToFlush,
MonitoredTask status,
boolean writeFlushWalMarker,
FlushLifeCycleTracker tracker)
Flush the memstore.
|
protected HRegion.FlushResultImpl |
internalFlushCacheAndCommit(WAL wal,
MonitoredTask status,
org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult prepareResult,
Collection<HStore> storesToFlush) |
protected org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult |
internalPrepareFlushCache(WAL wal,
long myseqid,
Collection<HStore> storesToFlush,
MonitoredTask status,
boolean writeFlushWalMarker,
FlushLifeCycleTracker tracker) |
boolean |
isAvailable() |
boolean |
isClosed() |
boolean |
isClosing() |
boolean |
isLoadingCfsOnDemandDefault() |
boolean |
isMergeable() |
boolean |
isReadOnly() |
boolean |
isSplittable() |
void |
mutateRow(RowMutations rm)
Performs multiple mutations atomically on a single row.
|
void |
mutateRowsWithLocks(Collection<Mutation> mutations,
Collection<byte[]> rowsToLock,
long nonceGroup,
long nonce)
Perform atomic (all or none) mutations within the region.
|
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
This method would be called by the
ConfigurationManager
object when the Configuration object is reloaded from disk. |
protected HRegion |
openHRegion(CancelableProgressable reporter)
Open HRegion.
|
static HRegion |
openHRegion(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.Path tableDir,
RegionInfo info,
TableDescriptor htd,
WAL wal,
RegionServerServices rsServices,
CancelableProgressable reporter)
Open a Region.
|
static HRegion |
openHRegion(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
RegionInfo info,
TableDescriptor htd,
WAL wal)
Open a Region.
|
static HRegion |
openHRegion(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
RegionInfo info,
TableDescriptor htd,
WAL wal,
RegionServerServices rsServices,
CancelableProgressable reporter)
Open a Region.
|
static HRegion |
openHRegion(HRegion other,
CancelableProgressable reporter)
Useful when reopening a closed region (normally for unit tests)
|
static HRegion |
openHRegion(org.apache.hadoop.fs.Path rootDir,
RegionInfo info,
TableDescriptor htd,
WAL wal,
org.apache.hadoop.conf.Configuration conf)
Open a Region.
|
static HRegion |
openHRegion(org.apache.hadoop.fs.Path rootDir,
RegionInfo info,
TableDescriptor htd,
WAL wal,
org.apache.hadoop.conf.Configuration conf,
RegionServerServices rsServices,
CancelableProgressable reporter)
Open a Region.
|
static Region |
openHRegion(Region other,
CancelableProgressable reporter) |
static HRegion |
openHRegion(RegionInfo info,
TableDescriptor htd,
WAL wal,
org.apache.hadoop.conf.Configuration conf)
Open a Region.
|
static HRegion |
openHRegion(RegionInfo info,
TableDescriptor htd,
WAL wal,
org.apache.hadoop.conf.Configuration conf,
RegionServerServices rsServices,
CancelableProgressable reporter)
Open a Region.
|
static HRegion |
openReadOnlyFileSystemHRegion(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path tableDir,
RegionInfo info,
TableDescriptor htd)
Open a Region on a read-only file-system (like hdfs snapshots)
|
void |
prepareDelete(Delete delete)
Prepare a delete for a row mutation processor
|
void |
prepareDeleteTimestamps(Mutation mutation,
Map<byte[],List<Cell>> familyMap,
byte[] byteNow)
Set up correct timestamps in the KVs in Delete object.
|
void |
processRowsWithLocks(RowProcessor<?,?> processor)
Performs atomic multiple reads and writes on a given row.
|
void |
processRowsWithLocks(RowProcessor<?,?> processor,
long nonceGroup,
long nonce)
Performs atomic multiple reads and writes on a given row.
|
void |
processRowsWithLocks(RowProcessor<?,?> processor,
long timeout,
long nonceGroup,
long nonce)
Performs atomic multiple reads and writes on a given row.
|
void |
put(Put put)
Puts some data in the table.
|
boolean |
refreshStoreFiles()
Check the region's underlying store files, open the files that have not
been opened yet, and remove the store file readers for store files no
longer available.
|
protected boolean |
refreshStoreFiles(boolean force) |
void |
registerChildren(ConfigurationManager manager)
Needs to be called to register the children to the manager.
|
boolean |
registerService(com.google.protobuf.Service instance)
Registers a new protocol buffer
Service subclass as a coprocessor endpoint to
be available for handling Region#execService(com.google.protobuf.RpcController,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall) calls. |
protected long |
replayRecoveredEditsIfAny(Map<byte[],Long> maxSeqIdInStores,
CancelableProgressable reporter,
MonitoredTask status)
Read the edits put under this region by wal splitting process.
|
void |
reportCompactionRequestEnd(boolean isMajor,
int numFiles,
long filesSizeCompacted) |
void |
reportCompactionRequestFailure() |
void |
reportCompactionRequestStart(boolean isMajor) |
void |
requestCompaction(byte[] family,
String why,
int priority,
boolean major,
CompactionLifeCycleTracker tracker)
Request compaction for the given family
|
void |
requestCompaction(String why,
int priority,
boolean major,
CompactionLifeCycleTracker tracker)
Request compaction on this region.
|
void |
requestFlush(FlushLifeCycleTracker tracker)
Request flush on this region.
|
protected void |
restoreEdit(HStore s,
Cell cell,
MemStoreSizing memstoreAccounting)
Used by tests
|
static boolean |
rowIsInRange(RegionInfo info,
byte[] row)
Determines if the specified row is within the row range specified by the
specified RegionInfo
|
static boolean |
rowIsInRange(RegionInfo info,
byte[] row,
int offset,
short length) |
void |
setClosing(boolean closing)
Exposed for some very specific unit tests.
|
void |
setCoprocessorHost(RegionCoprocessorHost coprocessorHost) |
void |
setReadsEnabled(boolean readsEnabled) |
void |
setTimeoutForWriteLock(long timeoutForWriteLock)
The
doClose(boolean, org.apache.hadoop.hbase.monitoring.MonitoredTask) will block forever if someone tries proving the dead lock via the unit test. |
void |
startRegionOperation()
This method needs to be called before any public call that reads or
modifies data.
|
void |
startRegionOperation(Region.Operation op)
This method needs to be called before any public call that reads or
modifies data.
|
String |
toString() |
void |
unblockUpdates() |
void |
waitForFlushes()
Wait for all current flushes of the region to complete
|
boolean |
waitForFlushes(long timeout)
Wait for all current flushes of the region to complete
|
void |
waitForFlushesAndCompactions()
Wait for all current flushes and compactions of the region to complete
|
static void |
warmupHRegion(RegionInfo info,
TableDescriptor htd,
WAL wal,
org.apache.hadoop.conf.Configuration conf,
RegionServerServices rsServices,
CancelableProgressable reporter) |
protected void |
writeRegionOpenMarker(WAL wal,
long openSeqId) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcheckAndMutate, checkAndRowMutatepublic static final String LOAD_CFS_ON_DEMAND_CONFIG_KEY
public static final String HBASE_MAX_CELL_SIZE_KEY
public static final int DEFAULT_MAX_CELL_SIZE
public static final String HBASE_REGIONSERVER_MINIBATCH_SIZE
public static final int DEFAULT_HBASE_REGIONSERVER_MINIBATCH_SIZE
public static final String WAL_HSYNC_CONF_KEY
public static final boolean DEFAULT_WAL_HSYNC
protected volatile long lastReplayedOpenRegionSeqId
protected volatile long lastReplayedCompactionSeqId
protected final org.apache.hadoop.conf.Configuration conf
public static final String MEMSTORE_PERIODIC_FLUSH_INTERVAL
public static final int DEFAULT_CACHE_FLUSH_INTERVAL
public static final int SYSTEM_CACHE_FLUSH_INTERVAL
public static final String MEMSTORE_FLUSH_PER_CHANGES
public static final long DEFAULT_FLUSH_PER_CHANGES
public static final long MAX_FLUSH_PER_CHANGES
public static final long FIXED_OVERHEAD
public static final long DEEP_OVERHEAD
@Deprecated public HRegion(org.apache.hadoop.fs.Path tableDir, WAL wal, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration confParam, RegionInfo regionInfo, TableDescriptor htd, RegionServerServices rsServices)
createHRegion(org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.fs.Path, org.apache.hadoop.conf.Configuration, org.apache.hadoop.hbase.client.TableDescriptor, org.apache.hadoop.hbase.wal.WAL, boolean) or openHRegion(org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.hbase.client.TableDescriptor, org.apache.hadoop.hbase.wal.WAL, org.apache.hadoop.conf.Configuration) method.tableDir - qualified path of directory where region should be located,
usually the table directory.wal - The WAL is the outbound log for any updates to the HRegion
The wal file is a logfile from the previous execution that's
custom-computed for this HRegion. The HRegionServer computes and sorts the
appropriate wal info for this HRegion. If there is a previous wal file
(implying that the HRegion has been written-to before), then read it from
the supplied path.fs - is the filesystem.confParam - is global configuration settings.regionInfo - - RegionInfo that describes the region
is new), then read them from the supplied path.htd - the table descriptorrsServices - reference to RegionServerServices or nullpublic HRegion(HRegionFileSystem fs, WAL wal, org.apache.hadoop.conf.Configuration confParam, TableDescriptor htd, RegionServerServices rsServices)
createHRegion(org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.fs.Path, org.apache.hadoop.conf.Configuration, org.apache.hadoop.hbase.client.TableDescriptor, org.apache.hadoop.hbase.wal.WAL, boolean) or openHRegion(org.apache.hadoop.hbase.client.RegionInfo, org.apache.hadoop.hbase.client.TableDescriptor, org.apache.hadoop.hbase.wal.WAL, org.apache.hadoop.conf.Configuration) method.fs - is the filesystem.wal - The WAL is the outbound log for any updates to the HRegion
The wal file is a logfile from the previous execution that's
custom-computed for this HRegion. The HRegionServer computes and sorts the
appropriate wal info for this HRegion. If there is a previous wal file
(implying that the HRegion has been written-to before), then read it from
the supplied path.confParam - is global configuration settings.htd - the table descriptorrsServices - reference to RegionServerServices or nullpublic long getSmallestReadPoint()
@Deprecated public long initialize() throws IOException
IOException - eprotected void writeRegionOpenMarker(WAL wal, long openSeqId) throws IOException
IOExceptionpublic boolean hasReferences()
public void blockUpdates()
public void unblockUpdates()
public HDFSBlocksDistribution getHDFSBlocksDistribution()
public static HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf, TableDescriptor tableDescriptor, RegionInfo regionInfo) throws IOException
conf - configurationtableDescriptor - TableDescriptor of the tableregionInfo - encoded name of the regionIOExceptionpublic static HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.conf.Configuration conf, TableDescriptor tableDescriptor, RegionInfo regionInfo, org.apache.hadoop.fs.Path tablePath) throws IOException
conf - configurationtableDescriptor - TableDescriptor of the tableregionInfo - encoded name of the regiontablePath - the table directoryIOExceptionpublic RegionInfo getRegionInfo()
getRegionInfo in interface Regionpublic long getReadRequestsCount()
getReadRequestsCount in interface Regionpublic long getFilteredReadRequestsCount()
getFilteredReadRequestsCount in interface Regionpublic long getWriteRequestsCount()
getWriteRequestsCount in interface Regionpublic long getMemStoreDataSize()
getMemStoreDataSize in interface Regionpublic long getMemStoreHeapSize()
getMemStoreHeapSize in interface Regionpublic long getMemStoreOffHeapSize()
getMemStoreOffHeapSize in interface Regionpublic RegionServicesForStores getRegionServicesForStores()
public long getNumMutationsWithoutWAL()
getNumMutationsWithoutWAL in interface Regionpublic long getDataInMemoryWithoutWAL()
getDataInMemoryWithoutWAL in interface Regionpublic long getBlockedRequestsCount()
getBlockedRequestsCount in interface Regionpublic long getCheckAndMutateChecksPassed()
getCheckAndMutateChecksPassed in interface Regionpublic long getCheckAndMutateChecksFailed()
getCheckAndMutateChecksFailed in interface Regionpublic MetricsRegion getMetrics()
public boolean isClosed()
public boolean isClosing()
public boolean isReadOnly()
isReadOnly in interface Regionpublic boolean isAvailable()
isAvailable in interface Regionpublic boolean isSplittable()
isSplittable in interface Regionpublic boolean isMergeable()
isMergeable in interface Regionpublic boolean areWritesEnabled()
public MultiVersionConcurrencyControl getMVCC()
public long getMaxFlushedSeqId()
getMaxFlushedSeqId in interface Regionpublic long getReadPoint(IsolationLevel isolationLevel)
null for defaultpublic boolean isLoadingCfsOnDemandDefault()
public Map<byte[],List<HStoreFile>> close() throws IOException
This method could take some time to execute, so don't call it from a time-sensitive thread.
IOException - eDroppedSnapshotException - Thrown when replay of wal is required
because a Snapshot was not properly persisted. The region is put in closing mode, and the
caller MUST abort after this.public Map<byte[],List<HStoreFile>> close(boolean abort) throws IOException
abort - true if server is aborting (only during testing)IOException - eDroppedSnapshotException - Thrown when replay of wal is required
because a Snapshot was not properly persisted. The region is put in closing mode, and the
caller MUST abort after this.public void setClosing(boolean closing)
public void setTimeoutForWriteLock(long timeoutForWriteLock)
doClose(boolean, org.apache.hadoop.hbase.monitoring.MonitoredTask) will block forever if someone tries proving the dead lock via the unit test.
Instead of blocking, the doClose(boolean, org.apache.hadoop.hbase.monitoring.MonitoredTask) will throw exception if you set the timeout.timeoutForWriteLock - the second time to wait for the write lock in doClose(boolean, org.apache.hadoop.hbase.monitoring.MonitoredTask)public void waitForFlushesAndCompactions()
public void waitForFlushes()
public boolean waitForFlushes(long timeout)
RegionwaitForFlushes in interface Regiontimeout - The maximum time to wait in milliseconds.protected ThreadPoolExecutor getStoreOpenAndCloseThreadPool(String threadNamePrefix)
protected ThreadPoolExecutor getStoreFileOpenAndCloseThreadPool(String threadNamePrefix)
public TableDescriptor getTableDescriptor()
getTableDescriptor in interface Regionpublic WAL getWAL()
public RegionSplitPolicy getSplitPolicy()
public org.apache.hadoop.fs.FileSystem getFilesystem()
FileSystem being used by this regionpublic HRegionFileSystem getRegionFileSystem()
HRegionFileSystem used by this regionpublic org.apache.hadoop.fs.Path getWALRegionDir()
throws IOException
IOException - if there is an error getting WALRootDirpublic long getEarliestFlushTimeForAllStores()
getEarliestFlushTimeForAllStores in interface Regionpublic long getOldestHfileTs(boolean majorCompactionOnly)
throws IOException
RegiongetOldestHfileTs in interface RegionmajorCompactionOnly - Only consider HFile that are the result of major compactionIOExceptionprotected void doRegionCompactionPrep()
throws IOException
IOExceptionpublic void compact(boolean majorCompaction)
throws IOException
This operation could block for a long time, so don't call it from a time-sensitive thread.
Note that no locks are taken to prevent possible conflicts between compaction and splitting activities. The regionserver does not normally compact and split in parallel. However by calling this method you may introduce unexpected and unhandled concurrency. Don't do this unless you know what you are doing.
majorCompaction - True to force a major compaction regardless of thresholdsIOExceptionpublic void compactStores()
throws IOException
It is used by utilities and testing
IOExceptionpublic boolean compact(CompactionContext compaction, HStore store, ThroughputController throughputController) throws IOException
This operation could block for a long time, so don't call it from a time-sensitive thread. Note that no locking is necessary at this level because compaction only conflicts with a region split, and that cannot happen because the region server does them sequentially and not in parallel.
compaction - Compaction details, obtained by requestCompaction()throughputController - IOExceptionpublic boolean compact(CompactionContext compaction, HStore store, ThroughputController throughputController, User user) throws IOException
IOExceptionpublic HRegion.FlushResult flush(boolean force) throws IOException
When this method is called the cache will be flushed unless:
This method may block for some time, so it should not be called from a time-sensitive thread.
force - whether we want to force a flush of all storesIOException - general io exceptions
because a snapshot was not properly persisted.public HRegion.FlushResultImpl flushcache(boolean forceFlushAllStores, boolean writeFlushRequestWalMarker, FlushLifeCycleTracker tracker) throws IOException
This method may block for some time, so it should not be called from a time-sensitive thread.
forceFlushAllStores - whether we want to flush all storeswriteFlushRequestWalMarker - whether to write the flush request marker to WALtracker - used to track the life cycle of this flushIOException - general io exceptionsDroppedSnapshotException - Thrown when replay of wal is required
because a Snapshot was not properly persisted. The region is put in closing mode, and the
caller MUST abort after this.protected HRegion.FlushResultImpl internalFlushcache(WAL wal, long myseqid, Collection<HStore> storesToFlush, MonitoredTask status, boolean writeFlushWalMarker, FlushLifeCycleTracker tracker) throws IOException
This method may block for some time. Every time you call it, we up the regions sequence id even if we don't flush; i.e. the returned region id will be at least one larger than the last edit applied to this region. The returned id does not refer to an actual edit. The returned id can be used for say installing a bulk loaded file just ahead of the last hfile that was the result of this flush, etc.
wal - Null if we're NOT to go via wal.myseqid - The seqid to use if wal is null writing out flush file.storesToFlush - The list of stores to flush.IOException - general io exceptionsDroppedSnapshotException - Thrown when replay of WAL is required.protected org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult internalPrepareFlushCache(WAL wal, long myseqid, Collection<HStore> storesToFlush, MonitoredTask status, boolean writeFlushWalMarker, FlushLifeCycleTracker tracker) throws IOException
IOExceptionprotected HRegion.FlushResultImpl internalFlushCacheAndCommit(WAL wal, MonitoredTask status, org.apache.hadoop.hbase.regionserver.HRegion.PrepareFlushResult prepareResult, Collection<HStore> storesToFlush) throws IOException
IOExceptionprotected long getNextSequenceId(WAL wal) throws IOException
IOExceptionpublic org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl getScanner(Scan scan) throws IOException
RegionScan.
This Iterator must be closed by the caller.
getScanner in interface Regionscan - configured ScanIOException - read exceptionspublic org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl getScanner(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException
RegionScan. The scanner will also include the additional scanners passed
along with the scanners for the specified Scan instance. Should be careful with the usage to
pass additional scanners only within this Region
This Iterator must be closed by the caller.
getScanner in interface Regionscan - configured ScanadditionalScanners - Any additional scanners to be usedIOException - read exceptionsprotected RegionScanner instantiateRegionScanner(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException
IOExceptionprotected org.apache.hadoop.hbase.regionserver.HRegion.RegionScannerImpl instantiateRegionScanner(Scan scan, List<KeyValueScanner> additionalScanners, long nonceGroup, long nonce) throws IOException
IOExceptionpublic void prepareDelete(Delete delete) throws IOException
delete - The passed delete is modified by this method. WARNING!IOExceptionpublic void delete(Delete delete) throws IOException
Regiondelete in interface RegionIOExceptionpublic void prepareDeleteTimestamps(Mutation mutation, Map<byte[],List<Cell>> familyMap, byte[] byteNow) throws IOException
Caller should have the row and region locks.
mutation - familyMap - byteNow - IOExceptionpublic void put(Put put) throws IOException
Regionput in interface RegionIOExceptionpublic OperationStatus[] batchMutate(Mutation[] mutations, long nonceGroup, long nonce) throws IOException
IOExceptionpublic OperationStatus[] batchMutate(Mutation[] mutations, boolean atomic, long nonceGroup, long nonce) throws IOException
IOExceptionpublic OperationStatus[] batchMutate(Mutation[] mutations) throws IOException
RegionNote this supports only Put and Delete mutations and will ignore other types passed.
batchMutate in interface Regionmutations - the list of mutationsIOExceptionpublic OperationStatus[] batchReplay(WALSplitter.MutationReplay[] mutations, long replaySeqId) throws IOException
IOExceptionprotected Durability getEffectiveDurability(Durability d)
public boolean checkAndMutate(byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
TimeRange timeRange,
Mutation mutation)
throws IOException
RegioncheckAndMutate in interface Regionrow - to checkfamily - column family to checkqualifier - column qualifier to checkop - the comparison operatorcomparator - the expected valuetimeRange - time range to checkmutation - data to put if check succeedsIOExceptionpublic boolean checkAndRowMutate(byte[] row,
byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator,
TimeRange timeRange,
RowMutations rm)
throws IOException
RegioncheckAndRowMutate in interface Regionrow - to checkfamily - column family to checkqualifier - column qualifier to checkop - the comparison operatorcomparator - the expected valuetimeRange - time range to checkrm - data to put if check succeedsIOExceptionpublic void addRegionToSnapshot(SnapshotProtos.SnapshotDescription desc, ForeignExceptionSnare exnSnare) throws IOException
ForeignExceptionSnare
arg. (In the future other cancellable HRegion methods could eventually add a
ForeignExceptionSnare, or we could do something fancier).desc - snapshot description objectexnSnare - ForeignExceptionSnare that captures external exceptions in case we need to
bail out. This is allowed to be null and will just be ignored in that case.IOException - if there is an external or internal error causing the snapshot to failprotected void checkReadOnly()
throws IOException
IOException - Throws exception if region is in read-only mode.protected void checkReadsEnabled()
throws IOException
IOExceptionpublic void setReadsEnabled(boolean readsEnabled)
public void checkFamilies(Collection<byte[]> families) throws NoSuchColumnFamilyException
families - NoSuchColumnFamilyExceptionpublic void checkTimestamps(Map<byte[],List<Cell>> familyMap, long now) throws FailedSanityCheckException
familyMap - now - current timestampFailedSanityCheckExceptionprotected long replayRecoveredEditsIfAny(Map<byte[],Long> maxSeqIdInStores, CancelableProgressable reporter, MonitoredTask status) throws IOException
We can ignore any wal message that has a sequence ID that's equal to or lower than minSeqId. (Because we know such messages are already reflected in the HFiles.)
While this is running we are putting pressure on memory yet we are outside of our usual accounting because we are not yet an onlined region (this stuff is being run as part of Region initialization). This means that if we're up against global memory limits, we'll not be flagged to flush because we are not online. We can't be flushed by usual mechanisms anyways; we're not yet online so our relative sequenceids are not yet aligned with WAL sequenceids -- not till we come up online, post processing of split edits.
But to help relieve memory pressure, at least manage our own heap size flushing if are in excess of per-region limits. Flushing, though, we have to be careful and avoid using the regionserver/wal sequenceid. Its running on a different line to whats going on in here in this region context so if we crashed replaying these edits, but in the midst had a flush that used the regionserver wal with a sequenceid in excess of whats going on in here in this region and with its split editlogs, then we could miss edits the next time we go to recover. So, we have to flush inline, using seqids that make sense in a this single region context only -- until we online.
maxSeqIdInStores - Any edit found in split editlogs needs to be in excess of
the maxSeqId for the store to be applied, else its skipped.minSeqId if nothing added from editlogs.IOExceptionpublic MemStoreSize dropMemStoreContents() throws IOException
IOExceptionpublic boolean refreshStoreFiles()
throws IOException
RegionrefreshStoreFiles in interface RegionIOExceptionprotected boolean refreshStoreFiles(boolean force)
throws IOException
IOExceptionprotected void restoreEdit(HStore s, Cell cell, MemStoreSizing memstoreAccounting)
s - Store to add edit too.cell - Cell to add.protected HStore instantiateHStore(ColumnFamilyDescriptor family) throws IOException
IOExceptionpublic HStore getStore(byte[] column)
RegionUse with caution. Exposed for use of fixup utilities.
public List<HStore> getStores()
RegionUse with caution. Exposed for use of fixup utilities.
public List<String> getStoreFileList(byte[][] columns) throws IllegalArgumentException
getStoreFileList in interface RegionIllegalArgumentExceptionpublic Region.RowLock getRowLock(byte[] row) throws IOException
row - Which row to lock.IOExceptionpublic Region.RowLock getRowLock(byte[] row, boolean readLock) throws IOException
Region
The obtained locks should be released after use by Region.RowLock.release()
NOTE: the boolean passed here has changed. It used to be a boolean that stated whether or not to wait on the lock. Now it is whether it an exclusive lock is requested.
getRowLock in interface Regionrow - The row actions will be performed againstreadLock - is the lock reader or writer. True indicates that a non-exclusive
lock is requestedIOExceptionRegion.startRegionOperation(),
Region.startRegionOperation(Operation)protected Region.RowLock getRowLockInternal(byte[] row, boolean readLock, Region.RowLock prevRowLock) throws IOException
IOExceptionpublic int getReadLockCount()
public ConcurrentHashMap<HashedBytes,org.apache.hadoop.hbase.regionserver.HRegion.RowLockContext> getLockedRows()
public Map<byte[],List<org.apache.hadoop.fs.Path>> bulkLoadHFiles(Collection<Pair<byte[],String>> familyPaths, boolean assignSeqId, HRegion.BulkLoadListener bulkLoadListener) throws IOException
familyPaths - List of Pair<byte[] column family, String hfilePath>bulkLoadListener - Internal hooks enabling massaging/preparation of a
file about to be bulk loadedassignSeqId - IOException - if failed unrecoverably.public Map<byte[],List<org.apache.hadoop.fs.Path>> bulkLoadHFiles(Collection<Pair<byte[],String>> familyPaths, boolean assignSeqId, HRegion.BulkLoadListener bulkLoadListener, boolean copyFile) throws IOException
familyPaths - List of Pair<byte[] column family, String hfilePath>assignSeqId - bulkLoadListener - Internal hooks enabling massaging/preparation of a
file about to be bulk loadedcopyFile - always copy hfiles if trueIOException - if failed unrecoverably.public static HRegion createHRegion(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor hTableDescriptor, WAL wal, boolean initialize) throws IOException
info - Info for region to create.rootDir - Root directory for HBase instancewal - shared WALinitialize - - true to initialize the regionIOExceptionpublic static HRegion createHRegion(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor hTableDescriptor, WAL wal) throws IOException
IOExceptionpublic static HRegion openHRegion(RegionInfo info, TableDescriptor htd, WAL wal, org.apache.hadoop.conf.Configuration conf) throws IOException
info - Info for region to be opened.wal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.IOExceptionpublic static HRegion openHRegion(RegionInfo info, TableDescriptor htd, WAL wal, org.apache.hadoop.conf.Configuration conf, RegionServerServices rsServices, CancelableProgressable reporter) throws IOException
info - Info for region to be openedhtd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.conf - The Configuration object to use.rsServices - An interface we can request flushes against.reporter - An interface we can report progress against.IOExceptionpublic static HRegion openHRegion(org.apache.hadoop.fs.Path rootDir, RegionInfo info, TableDescriptor htd, WAL wal, org.apache.hadoop.conf.Configuration conf) throws IOException
rootDir - Root directory for HBase instanceinfo - Info for region to be opened.htd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.conf - The Configuration object to use.IOExceptionpublic static HRegion openHRegion(org.apache.hadoop.fs.Path rootDir, RegionInfo info, TableDescriptor htd, WAL wal, org.apache.hadoop.conf.Configuration conf, RegionServerServices rsServices, CancelableProgressable reporter) throws IOException
rootDir - Root directory for HBase instanceinfo - Info for region to be opened.htd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.conf - The Configuration object to use.rsServices - An interface we can request flushes against.reporter - An interface we can report progress against.IOExceptionpublic static HRegion openHRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, RegionInfo info, TableDescriptor htd, WAL wal) throws IOException
conf - The Configuration object to use.fs - Filesystem to userootDir - Root directory for HBase instanceinfo - Info for region to be opened.htd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.IOExceptionpublic static HRegion openHRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, RegionInfo info, TableDescriptor htd, WAL wal, RegionServerServices rsServices, CancelableProgressable reporter) throws IOException
conf - The Configuration object to use.fs - Filesystem to userootDir - Root directory for HBase instanceinfo - Info for region to be opened.htd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.rsServices - An interface we can request flushes against.reporter - An interface we can report progress against.IOExceptionpublic static HRegion openHRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path tableDir, RegionInfo info, TableDescriptor htd, WAL wal, RegionServerServices rsServices, CancelableProgressable reporter) throws IOException
conf - The Configuration object to use.fs - Filesystem to userootDir - Root directory for HBase instanceinfo - Info for region to be opened.htd - the table descriptorwal - WAL for region to use. This method will call
WAL#setSequenceNumber(long) passing the result of the call to
HRegion#getMinSequenceId() to ensure the wal id is properly kept
up. HRegionStore does this every time it opens a new region.rsServices - An interface we can request flushes against.reporter - An interface we can report progress against.IOExceptionpublic NavigableMap<byte[],Integer> getReplicationScope()
public static HRegion openHRegion(HRegion other, CancelableProgressable reporter) throws IOException
other - original objectreporter - An interface we can report progress against.IOExceptionpublic static Region openHRegion(Region other, CancelableProgressable reporter) throws IOException
IOExceptionprotected HRegion openHRegion(CancelableProgressable reporter) throws IOException
thisIOExceptionpublic static HRegion openReadOnlyFileSystemHRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, RegionInfo info, TableDescriptor htd) throws IOException
conf - The Configuration object to use.fs - Filesystem to useinfo - Info for region to be opened.htd - the table descriptorIOExceptionpublic static void warmupHRegion(RegionInfo info, TableDescriptor htd, WAL wal, org.apache.hadoop.conf.Configuration conf, RegionServerServices rsServices, CancelableProgressable reporter) throws IOException
IOException@Deprecated public static org.apache.hadoop.fs.Path getRegionDir(org.apache.hadoop.fs.Path tabledir, String name)
tabledir - qualified path for tablename - ENCODED region name@Deprecated public static org.apache.hadoop.fs.Path getRegionDir(org.apache.hadoop.fs.Path rootdir, RegionInfo info)
rootdir - qualified path of HBase root directoryinfo - RegionInfo for the regionpublic static boolean rowIsInRange(RegionInfo info, byte[] row)
info - RegionInfo that specifies the row rangerow - row to be checkedpublic static boolean rowIsInRange(RegionInfo info, byte[] row, int offset, short length)
public Result get(Get get) throws IOException
Regionget in interface Regionget - query parametersIOExceptionpublic List<Cell> get(Get get, boolean withCoprocessor) throws IOException
Regionget in interface Regionget - query parameterswithCoprocessor - invoke coprocessor or not. We don't want to
always invoke cp.IOExceptionpublic List<Cell> get(Get get, boolean withCoprocessor, long nonceGroup, long nonce) throws IOException
IOExceptionpublic void mutateRow(RowMutations rm) throws IOException
RegionmutateRow in interface Regionrm - object that specifies the set of mutations to perform atomicallyIOExceptionpublic void mutateRowsWithLocks(Collection<Mutation> mutations, Collection<byte[]> rowsToLock, long nonceGroup, long nonce) throws IOException
mutateRowsWithLocks in interface Regionmutations - The list of mutations to perform.
mutations can contain operations for multiple rows.
Caller has to ensure that all rows are contained in this region.rowsToLock - Rows to locknonceGroup - Optional nonce group of the operation (client Id)nonce - Optional nonce of the operation (unique random id to ensure "more idempotence")
If multiple rows are locked care should be taken that
rowsToLock is sorted in order to avoid deadlocks.IOExceptionpublic ClientProtos.RegionLoadStats getLoadStatistics()
public void processRowsWithLocks(RowProcessor<?,?> processor) throws IOException
RegionprocessRowsWithLocks in interface Regionprocessor - The object defines the reads and writes to a row.IOExceptionpublic void processRowsWithLocks(RowProcessor<?,?> processor, long nonceGroup, long nonce) throws IOException
RegionprocessRowsWithLocks in interface Regionprocessor - The object defines the reads and writes to a row.nonceGroup - Optional nonce group of the operation (client Id)nonce - Optional nonce of the operation (unique random id to ensure "more idempotence")IOExceptionpublic void processRowsWithLocks(RowProcessor<?,?> processor, long timeout, long nonceGroup, long nonce) throws IOException
RegionprocessRowsWithLocks in interface Regionprocessor - The object defines the reads and writes to a row.timeout - The timeout of the processor.process() execution
Use a negative number to switch off the time boundnonceGroup - Optional nonce group of the operation (client Id)nonce - Optional nonce of the operation (unique random id to ensure "more idempotence")IOExceptionpublic Result append(Append append) throws IOException
Regionappend in interface RegionIOExceptionpublic Result append(Append mutation, long nonceGroup, long nonce) throws IOException
IOExceptionpublic Result increment(Increment increment) throws IOException
Regionincrement in interface RegionIOExceptionpublic Result increment(Increment mutation, long nonceGroup, long nonce) throws IOException
IOExceptionpublic long heapSize()
public boolean registerService(com.google.protobuf.Service instance)
Service subclass as a coprocessor endpoint to
be available for handling Region#execService(com.google.protobuf.RpcController,
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall) calls.
Only a single instance may be registered per region for a given Service subclass (the
instances are keyed on Descriptors.ServiceDescriptor.getFullName().
After the first registration, subsequent calls with the same service name will fail with
a return value of false.
instance - the Service subclass instance to expose as a coprocessor endpointtrue if the registration was successful, false
otherwisepublic com.google.protobuf.Message execService(com.google.protobuf.RpcController controller,
ClientProtos.CoprocessorServiceCall call)
throws IOException
Service method using
the registered protocol handlers. Service implementations must be registered via the
registerService(com.google.protobuf.Service)
method before they are available.controller - an RpcContoller implementation to pass to the invoked servicecall - a CoprocessorServiceCall instance identifying the service, method,
and parameters for the method invocationMessage instance containing the method's resultIOException - if no registered service handler is found or an error
occurs during the invocationregisterService(com.google.protobuf.Service)public byte[] checkSplit()
public int getCompactPriority()
public RegionCoprocessorHost getCoprocessorHost()
public void setCoprocessorHost(RegionCoprocessorHost coprocessorHost)
coprocessorHost - the new coprocessor hostpublic void startRegionOperation()
throws IOException
RegionRegion.closeRegionOperation() MUST then always be called after
the operation has completed, whether it succeeded or failed.
startRegionOperation in interface RegionIOExceptionpublic void startRegionOperation(Region.Operation op) throws IOException
RegionRegion.closeRegionOperation() MUST then always be called after
the operation has completed, whether it succeeded or failed.
startRegionOperation in interface Regionop - The operation is about to be taken on the regionIOExceptionpublic void closeRegionOperation()
throws IOException
RegioncloseRegionOperation in interface RegionIOExceptionpublic void closeRegionOperation(Region.Operation operation) throws IOException
RegionRegion.startRegionOperation(Operation)closeRegionOperation in interface RegionIOExceptionpublic long getOpenSeqNum()
public Map<byte[],Long> getMaxStoreSeqId()
getMaxStoreSeqId in interface Regionpublic long getOldestSeqIdOfStore(byte[] familyName)
public CompactionState getCompactionState()
getCompactionState in interface Regionpublic void reportCompactionRequestStart(boolean isMajor)
public void reportCompactionRequestEnd(boolean isMajor,
int numFiles,
long filesSizeCompacted)
public void reportCompactionRequestFailure()
public void incrementCompactionsQueuedCount()
public void decrementCompactionsQueuedCount()
public void incrementFlushesQueuedCount()
public long getReadPoint()
public void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
ConfigurationManager
object when the Configuration object is reloaded from disk.onConfigurationChange in interface ConfigurationObserverpublic void registerChildren(ConfigurationManager manager)
registerChildren in interface PropagatingConfigurationObservermanager - : to register topublic void deregisterChildren(ConfigurationManager manager)
deregisterChildren in interface PropagatingConfigurationObservermanager - : to deregister frompublic CellComparator getCellComparator()
RegiongetCellComparator in interface Regionpublic long getMemStoreFlushSize()
public void requestCompaction(String why, int priority, boolean major, CompactionLifeCycleTracker tracker) throws IOException
RegionrequestCompaction in interface RegionIOExceptionpublic void requestCompaction(byte[] family,
String why,
int priority,
boolean major,
CompactionLifeCycleTracker tracker)
throws IOException
RegionrequestCompaction in interface RegionIOExceptionpublic void requestFlush(FlushLifeCycleTracker tracker) throws IOException
RegionrequestFlush in interface RegionIOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.