public class MaterializationsRebuildLockHandler extends Object
Modifier and Type | Method and Description |
---|---|
long |
cleanupResourceLocks(long timeout)
Method that removes from the handler those locks that have expired.
|
static MaterializationsRebuildLockHandler |
get()
Get instance of MaterializationsRebuildLockHandler.
|
LockResponse |
lockResource(String dbName,
String tableName,
long txnId)
Lock materialized view (first step for rebuild).
|
boolean |
readyToCommitResource(String dbName,
String tableName,
long txnId)
Moves from ACQUIRED state to COMMIT_READY.
|
boolean |
refreshLockResource(String dbName,
String tableName,
long txnId)
Heartbeats a certain lock and refreshes its timer.
|
boolean |
unlockResource(String dbName,
String tableName,
long txnId)
Releases a certain lock.
|
public static MaterializationsRebuildLockHandler get()
public LockResponse lockResource(String dbName, String tableName, long txnId)
dbName
- the db name of the materializationtableName
- the table name of the materializationtxnId
- the transaction id for the rebuildpublic boolean readyToCommitResource(String dbName, String tableName, long txnId)
dbName
- the db name of the materializationtableName
- the table name of the materializationtxnId
- the transaction id for the rebuildpublic boolean refreshLockResource(String dbName, String tableName, long txnId)
dbName
- the db name of the materializationtableName
- the table name of the materializationtxnId
- the transaction id for the rebuildpublic boolean unlockResource(String dbName, String tableName, long txnId)
dbName
- the db name of the materializationtableName
- the table name of the materializationtxnId
- the transaction id for the rebuildpublic long cleanupResourceLocks(long timeout)
timeout
- time after which we consider the locks to have expiredCopyright © 2022 The Apache Software Foundation. All rights reserved.