|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.HRegion
org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion
public class TransactionalRegion
Regionserver which provides transactional support for atomic transactions. This is achieved with optimistic concurrency control (see http://www.seas.upenn.edu/~zives/cis650/papers/opt-cc.pdf). We keep track read and write sets for each transaction, and hold off on processing the writes. To decide to commit a transaction we check its read sets with all transactions that have committed while it was running for overlaps.
Because transactions can span multiple regions, all regions must agree to commit a transactions. The client side of this commit protocol is encoded in org.apache.hadoop.hbase.client.transactional.TransactionManger
In the event of an failure of the client mid-commit, (after we voted yes), we will have to consult the transaction log to determine the final decision of the transaction. This is not yet implemented.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.HConstants |
---|
HConstants.Modify |
Field Summary | |
---|---|
protected Map<String,org.apache.hadoop.hbase.regionserver.transactional.TransactionState> |
transactionsById
|
Fields inherited from class org.apache.hadoop.hbase.regionserver.HRegion |
---|
DEEP_OVERHEAD, FIXED_OVERHEAD, REGIONINFO_FILE, REGIONINFO_FILE_BYTES, rwcc, stores |
Constructor Summary | |
---|---|
TransactionalRegion(org.apache.hadoop.fs.Path basedir,
HLog log,
org.apache.hadoop.fs.FileSystem fs,
HBaseConfiguration conf,
HRegionInfo regionInfo,
FlushRequester flushListener,
Leases transactionalLeases)
|
Method Summary | |
---|---|
void |
abort(long transactionId)
Commit the transaction. |
void |
beginTransaction(long transactionId)
|
List<StoreFile> |
close(boolean abort)
Close down this HRegion. |
void |
commit(long transactionId)
Commit the transaction. |
boolean |
commitIfPossible(long transactionId)
|
int |
commitRequest(long transactionId)
|
void |
delete(long transactionId,
Delete delete)
Add a delete to the transaction. |
protected void |
doReconstructionLog(org.apache.hadoop.fs.Path oldLogFile,
long minSeqId,
long maxSeqId,
org.apache.hadoop.util.Progressable reporter)
|
Result |
get(long transactionId,
Get get)
|
protected long |
getCompleteCacheFlushSequenceId(long currentSequenceId)
We need to make sure that we don't complete a cache flush between running transactions. |
InternalScanner |
getScanner(long transactionId,
Scan scan)
Get a transactional scanner. |
protected org.apache.hadoop.hbase.regionserver.transactional.TransactionState |
getTransactionState(long transactionId)
|
protected void |
prepareToSplit()
|
void |
put(long transactionId,
Put put)
Add a write to the transaction. |
void |
put(long transactionId,
Put[] puts)
Add multiple writes to the transaction. |
Methods inherited from class org.apache.hadoop.hbase.regionserver.HRegion |
---|
addRegionToMETA, checkAndPut, checkReadOnly, cleanRegionInMETA, close, compactStores, createHRegion, delete, delete, deleteRegion, equals, flushcache, get, getBaseDir, getClosestRowBefore, getConf, getEndKey, getFilesystem, getLargestHStoreSize, getLastFlushTime, getLog, getRegionDir, getRegionDir, getRegionDir, getRegionId, getRegionInfo, getRegionName, getRegionNameAsString, getScanner, getScanner, getStartKey, getStore, getTableDesc, hashCode, hasTooManyStoreFiles, heapSize, incrementColumnValue, initialize, instantiateHStore, instantiateInternalScanner, internalFlushcache, internalPreFlushcacheCommit, isClosed, isClosing, main, makeColumnFamilyDirs, merge, mergeAdjacent, newHRegion, obtainRowLock, offlineRegionInMETA, openHRegion, put, put, put, put, removeRegionFromMETA, rowIsInRange, shouldSplit, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Map<String,org.apache.hadoop.hbase.regionserver.transactional.TransactionState> transactionsById
Constructor Detail |
---|
public TransactionalRegion(org.apache.hadoop.fs.Path basedir, HLog log, org.apache.hadoop.fs.FileSystem fs, HBaseConfiguration conf, HRegionInfo regionInfo, FlushRequester flushListener, Leases transactionalLeases)
basedir
- log
- fs
- conf
- regionInfo
- flushListener
- Method Detail |
---|
protected void doReconstructionLog(org.apache.hadoop.fs.Path oldLogFile, long minSeqId, long maxSeqId, org.apache.hadoop.util.Progressable reporter) throws UnsupportedEncodingException, IOException
doReconstructionLog
in class HRegion
UnsupportedEncodingException
IOException
protected long getCompleteCacheFlushSequenceId(long currentSequenceId)
getCompleteCacheFlushSequenceId
in class HRegion
public void beginTransaction(long transactionId) throws IOException
transactionId
-
IOException
public Result get(long transactionId, Get get) throws IOException
IOException
public InternalScanner getScanner(long transactionId, Scan scan) throws IOException
IOException
public void put(long transactionId, Put put) throws IOException
transactionId
- put
-
IOException
public void put(long transactionId, Put[] puts) throws IOException
transactionId
- puts
-
IOException
public void delete(long transactionId, Delete delete) throws IOException
transactionId
- delete
-
IOException
public int commitRequest(long transactionId) throws IOException
transactionId
-
IOException
public boolean commitIfPossible(long transactionId) throws IOException
transactionId
-
IOException
public void commit(long transactionId) throws IOException
transactionId
-
IOException
public void abort(long transactionId) throws IOException
transactionId
-
IOException
public List<StoreFile> close(boolean abort) throws IOException
HRegion
close
in class HRegion
abort
- true if server is aborting (only during testing)
IOException
- eprotected void prepareToSplit()
prepareToSplit
in class HRegion
protected org.apache.hadoop.hbase.regionserver.transactional.TransactionState getTransactionState(long transactionId) throws UnknownTransactionException
UnknownTransactionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |