@InterfaceAudience.Private
@InterfaceStability.Evolving
public interface TxnStore
extends org.apache.hadoop.conf.Configurable
| Modifier and Type | Interface and Description |
|---|---|
static class |
TxnStore.MUTEX_KEY |
static interface |
TxnStore.MutexAPI
This is primarily designed to provide coarse grained mutex support to operations running
inside the Metastore (of which there could be several instances).
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTEMPTED_RESPONSE |
static String |
CLEANING_RESPONSE |
static String |
FAILED_RESPONSE |
static String |
INITIATED_RESPONSE |
static String |
SUCCEEDED_RESPONSE |
static int |
TIMED_OUT_TXN_ABORT_BATCH_SIZE |
static String |
WORKING_RESPONSE |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTxn(org.apache.hadoop.hive.metastore.api.AbortTxnRequest rqst)
Abort (rollback) a transaction.
|
void |
abortTxns(org.apache.hadoop.hive.metastore.api.AbortTxnsRequest rqst)
Abort (rollback) a list of transactions in one request.
|
void |
addDynamicPartitions(org.apache.hadoop.hive.metastore.api.AddDynamicPartitions rqst)
Add information on a set of dynamic partitions that participated in a transaction.
|
org.apache.hadoop.hive.metastore.api.AllocateTableWriteIdsResponse |
allocateTableWriteIds(org.apache.hadoop.hive.metastore.api.AllocateTableWriteIdsRequest rqst)
Allocate a write ID for the given table and associate it with a transaction
|
boolean |
checkFailedCompactions(CompactionInfo ci)
Determine if there are enough consecutive failures compacting a table or partition that no
new automatic compactions should be scheduled.
|
org.apache.hadoop.hive.metastore.api.LockResponse |
checkLock(org.apache.hadoop.hive.metastore.api.CheckLockRequest rqst)
Check whether a lock has been obtained.
|
void |
cleanEmptyAbortedTxns()
Clean up aborted transactions from txns that have no components in txn_components.
|
void |
cleanTxnToWriteIdTable()
Clean up entries from TXN_TO_WRITE_ID table less than min_uncommited_txnid as found by
min(NEXT_TXN_ID.ntxn_next, min(MIN_HISTORY_LEVEL.mhl_min_open_txnid), min(Aborted TXNS.txn_id)).
|
long |
cleanupMaterializationRebuildLocks(org.apache.hadoop.hive.common.ValidTxnList validTxnList,
long timeout) |
void |
cleanupRecords(org.apache.hadoop.hive.metastore.api.HiveObjectType type,
org.apache.hadoop.hive.metastore.api.Database db,
org.apache.hadoop.hive.metastore.api.Table table,
Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionIterator)
Clean up corresponding records in metastore tables.
|
void |
commitTxn(org.apache.hadoop.hive.metastore.api.CommitTxnRequest rqst)
Commit a transaction
|
org.apache.hadoop.hive.metastore.api.CompactionResponse |
compact(org.apache.hadoop.hive.metastore.api.CompactionRequest rqst)
Submit a compaction request into the queue.
|
void |
countOpenTxns()
Get the count for open transactions.
|
List<String> |
findColumnsWithStats(CompactionInfo ci)
Queries metastore DB directly to find columns in the table which have statistics information.
|
CompactionInfo |
findNextToCompact(String workerId)
This will grab the next compaction request off of
the queue, and assign it to the worker.
|
Set<CompactionInfo> |
findPotentialCompactions(int maxAborted)
This will look through the completed_txn_components table and look for partitions or tables
that may be ready for compaction.
|
List<CompactionInfo> |
findReadyToClean()
Find entries in the queue that are ready to
be cleaned.
|
org.apache.hadoop.hive.metastore.api.Materialization |
getMaterializationInvalidationInfo(org.apache.hadoop.hive.metastore.api.CreationMetadata cm,
String validTxnList)
Get invalidation info for the materialization.
|
TxnStore.MutexAPI |
getMutexAPI() |
org.apache.hadoop.hive.metastore.api.GetOpenTxnsResponse |
getOpenTxns()
Get list of valid transactions.
|
org.apache.hadoop.hive.metastore.api.GetOpenTxnsInfoResponse |
getOpenTxnsInfo()
Get information about open transactions.
|
org.apache.hadoop.hive.metastore.api.GetValidWriteIdsResponse |
getValidWriteIds(org.apache.hadoop.hive.metastore.api.GetValidWriteIdsRequest rqst)
Gets the list of valid write ids for the given table wrt to current txn
|
void |
heartbeat(org.apache.hadoop.hive.metastore.api.HeartbeatRequest ids)
Send a heartbeat for a lock or a transaction
|
boolean |
heartbeatLockMaterializationRebuild(String dbName,
String tableName,
long txnId) |
org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse |
heartbeatTxnRange(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest rqst)
Heartbeat a group of transactions together
|
org.apache.hadoop.hive.metastore.api.LockResponse |
lock(org.apache.hadoop.hive.metastore.api.LockRequest rqst)
Obtain a lock.
|
org.apache.hadoop.hive.metastore.api.LockResponse |
lockMaterializationRebuild(String dbName,
String tableName,
long txnId) |
void |
markCleaned(CompactionInfo info)
This will remove an entry from the queue after
it has been compacted.
|
void |
markCompacted(CompactionInfo info)
This will mark an entry in the queue as compacted
and put it in the ready to clean state.
|
void |
markFailed(CompactionInfo info)
Mark a compaction entry as failed.
|
int |
numLocksInLockTable() |
void |
onRename(String oldCatName,
String oldDbName,
String oldTabName,
String oldPartName,
String newCatName,
String newDbName,
String newTabName,
String newPartName) |
org.apache.hadoop.hive.metastore.api.OpenTxnsResponse |
openTxns(org.apache.hadoop.hive.metastore.api.OpenTxnRequest rqst)
Open a set of transactions
|
void |
performTimeOuts()
Timeout transactions and/or locks.
|
void |
performWriteSetGC()
WriteSet tracking is used to ensure proper transaction isolation.
|
void |
purgeCompactionHistory()
For any given compactable entity (partition, table if not partitioned) the history of compactions
may look like "sssfffaaasffss", for example.
|
void |
replTableWriteIdState(org.apache.hadoop.hive.metastore.api.ReplTblWriteIdStateRequest rqst)
Replicate Table Write Ids state to mark aborted write ids and writeid high water mark.
|
void |
revokeFromLocalWorkers(String hostname)
This will take all entries assigned to workers
on a host return them to INITIATED state.
|
void |
revokeTimedoutWorkers(long timeout)
This call will return all compaction queue
entries assigned to a worker but over the timeout back to the initiated state.
|
void |
seedWriteIdOnAcidConversion(InitializeTableWriteIdsRequest rqst)
Called on conversion of existing table to full acid.
|
void |
setCompactionHighestWriteId(CompactionInfo ci,
long highestWriteId)
Record the highest write id that the
ci compaction job will pay attention to. |
void |
setHadoopJobId(String hadoopJobId,
long id)
Once a
ThreadPoolExecutor Worker submits a job to the cluster,
it calls this to update the metadata. |
void |
setRunAs(long cq_id,
String user)
Sets the user to run as.
|
long |
setTimeout(long milliseconds) |
org.apache.hadoop.hive.metastore.api.ShowCompactResponse |
showCompact(org.apache.hadoop.hive.metastore.api.ShowCompactRequest rqst)
Show list of current compactions.
|
org.apache.hadoop.hive.metastore.api.ShowLocksResponse |
showLocks(org.apache.hadoop.hive.metastore.api.ShowLocksRequest rqst)
Get information on current locks.
|
void |
unlock(org.apache.hadoop.hive.metastore.api.UnlockRequest rqst)
Unlock a lock.
|
static final String INITIATED_RESPONSE
static final String WORKING_RESPONSE
static final String CLEANING_RESPONSE
static final String FAILED_RESPONSE
static final String SUCCEEDED_RESPONSE
static final String ATTEMPTED_RESPONSE
static final int TIMED_OUT_TXN_ABORT_BATCH_SIZE
org.apache.hadoop.hive.metastore.api.GetOpenTxnsInfoResponse getOpenTxnsInfo()
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.GetOpenTxnsResponse getOpenTxns()
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionvoid countOpenTxns()
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.OpenTxnsResponse openTxns(org.apache.hadoop.hive.metastore.api.OpenTxnRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - request to open transactionsorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid abortTxn(org.apache.hadoop.hive.metastore.api.AbortTxnRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.MetaException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException
rqst - info on transaction to abortorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionvoid abortTxns(org.apache.hadoop.hive.metastore.api.AbortTxnsRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on transactions to abortorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid commitTxn(org.apache.hadoop.hive.metastore.api.CommitTxnRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on transaction to commitorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid replTableWriteIdState(org.apache.hadoop.hive.metastore.api.ReplTblWriteIdStateRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on table/partitions and writeid snapshot to replicate.org.apache.hadoop.hive.metastore.api.MetaException - in case of failureorg.apache.hadoop.hive.metastore.api.Materialization getMaterializationInvalidationInfo(org.apache.hadoop.hive.metastore.api.CreationMetadata cm,
String validTxnList)
throws org.apache.hadoop.hive.metastore.api.MetaException
cm - creation metadata for the materializationvalidTxnList - valid transaction list for snapshot taken for current queryorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.LockResponse lockMaterializationRebuild(String dbName, String tableName, long txnId) throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionboolean heartbeatLockMaterializationRebuild(String dbName, String tableName, long txnId) throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionlong cleanupMaterializationRebuildLocks(org.apache.hadoop.hive.common.ValidTxnList validTxnList,
long timeout)
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.GetValidWriteIdsResponse getValidWriteIds(org.apache.hadoop.hive.metastore.api.GetValidWriteIdsRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on transaction and list of table names associated with given transactionorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.AllocateTableWriteIdsResponse allocateTableWriteIds(org.apache.hadoop.hive.metastore.api.AllocateTableWriteIdsRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on transaction and table to allocate write idorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid seedWriteIdOnAcidConversion(InitializeTableWriteIdsRequest rqst) throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.LockResponse lock(org.apache.hadoop.hive.metastore.api.LockRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - information on the lock to obtain. If the requester is part of a transaction
the txn information must be included in the lock request.org.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.LockResponse checkLock(org.apache.hadoop.hive.metastore.api.CheckLockRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.NoSuchLockException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
lock(org.apache.hadoop.hive.metastore.api.LockRequest) returned a wait
state.rqst - info on the lock to checkorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.NoSuchLockExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid unlock(org.apache.hadoop.hive.metastore.api.UnlockRequest rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchLockException,
org.apache.hadoop.hive.metastore.api.TxnOpenException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - lock to unlockorg.apache.hadoop.hive.metastore.api.NoSuchLockExceptionorg.apache.hadoop.hive.metastore.api.TxnOpenExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.ShowLocksResponse showLocks(org.apache.hadoop.hive.metastore.api.ShowLocksRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - lock information to retrieveorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid heartbeat(org.apache.hadoop.hive.metastore.api.HeartbeatRequest ids)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.NoSuchLockException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
ids - lock and/or txn id to heartbeatorg.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.NoSuchLockExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse heartbeatTxnRange(org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - set of transactions to heartbatorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.CompactionResponse compact(org.apache.hadoop.hive.metastore.api.CompactionRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - information on what to compactorg.apache.hadoop.hive.metastore.api.MetaExceptionorg.apache.hadoop.hive.metastore.api.ShowCompactResponse showCompact(org.apache.hadoop.hive.metastore.api.ShowCompactRequest rqst)
throws org.apache.hadoop.hive.metastore.api.MetaException
rqst - info on which compactions to showorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid addDynamicPartitions(org.apache.hadoop.hive.metastore.api.AddDynamicPartitions rqst)
throws org.apache.hadoop.hive.metastore.api.NoSuchTxnException,
org.apache.hadoop.hive.metastore.api.TxnAbortedException,
org.apache.hadoop.hive.metastore.api.MetaException
rqst - dynamic partition info.org.apache.hadoop.hive.metastore.api.NoSuchTxnExceptionorg.apache.hadoop.hive.metastore.api.TxnAbortedExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid cleanupRecords(org.apache.hadoop.hive.metastore.api.HiveObjectType type,
org.apache.hadoop.hive.metastore.api.Database db,
org.apache.hadoop.hive.metastore.api.Table table,
Iterator<org.apache.hadoop.hive.metastore.api.Partition> partitionIterator)
throws org.apache.hadoop.hive.metastore.api.MetaException
type - Hive object typedb - database objecttable - table objectpartitionIterator - partition iteratororg.apache.hadoop.hive.metastore.api.MetaExceptionvoid onRename(String oldCatName, String oldDbName, String oldTabName, String oldPartName, String newCatName, String newDbName, String newTabName, String newPartName) throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionvoid performTimeOuts()
Set<CompactionInfo> findPotentialCompactions(int maxAborted) throws org.apache.hadoop.hive.metastore.api.MetaException
maxAborted - Maximum number of aborted queries to allow before marking this as a
potential compaction.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid setRunAs(long cq_id,
String user)
throws org.apache.hadoop.hive.metastore.api.MetaException
cq_id - id of this entry in the queueuser - user to run the jobs asorg.apache.hadoop.hive.metastore.api.MetaExceptionCompactionInfo findNextToCompact(String workerId) throws org.apache.hadoop.hive.metastore.api.MetaException
workerId - id of the worker calling this, will be recorded in the dborg.apache.hadoop.hive.metastore.api.MetaExceptionvoid markCompacted(CompactionInfo info) throws org.apache.hadoop.hive.metastore.api.MetaException
info - info on the compaction entry to mark as compacted.org.apache.hadoop.hive.metastore.api.MetaExceptionList<CompactionInfo> findReadyToClean() throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionvoid markCleaned(CompactionInfo info) throws org.apache.hadoop.hive.metastore.api.MetaException
info - info on the compaction entry to removeorg.apache.hadoop.hive.metastore.api.MetaExceptionvoid markFailed(CompactionInfo info) throws org.apache.hadoop.hive.metastore.api.MetaException
info - information on the compaction that failed.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid cleanTxnToWriteIdTable()
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionvoid cleanEmptyAbortedTxns()
throws org.apache.hadoop.hive.metastore.api.MetaException
markCleaned(CompactionInfo) being called.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid revokeFromLocalWorkers(String hostname) throws org.apache.hadoop.hive.metastore.api.MetaException
hostname - Name of this host. It is assumed this prefixes the thread's worker id,
so that like hostname% will match the worker id.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid revokeTimedoutWorkers(long timeout)
throws org.apache.hadoop.hive.metastore.api.MetaException
revokeFromLocalWorkers(String) should be called
first.timeout - number of milliseconds since start time that should elapse before a worker is
declared dead.org.apache.hadoop.hive.metastore.api.MetaExceptionList<String> findColumnsWithStats(CompactionInfo ci) throws org.apache.hadoop.hive.metastore.api.MetaException
ci includes partition info then per partition stats info is examined, otherwise
table level stats are examined.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid setCompactionHighestWriteId(CompactionInfo ci, long highestWriteId) throws org.apache.hadoop.hive.metastore.api.MetaException
ci compaction job will pay attention to.org.apache.hadoop.hive.metastore.api.MetaExceptionvoid purgeCompactionHistory()
throws org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.MetaExceptionvoid performWriteSetGC()
boolean checkFailedCompactions(CompactionInfo ci) throws org.apache.hadoop.hive.metastore.api.MetaException
ci - Table or partition to check.org.apache.hadoop.hive.metastore.api.MetaExceptionint numLocksInLockTable()
throws SQLException,
org.apache.hadoop.hive.metastore.api.MetaException
SQLExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionlong setTimeout(long milliseconds)
TxnStore.MutexAPI getMutexAPI()
void setHadoopJobId(String hadoopJobId, long id)
ThreadPoolExecutor Worker submits a job to the cluster,
it calls this to update the metadata.id - CompactionInfo.idCopyright © 2019 The Apache Software Foundation. All Rights Reserved.