Search in sources :

Example 11 with HoodieLockException

use of org.apache.hudi.exception.HoodieLockException in project hudi by apache.

the class ZookeeperBasedLockProvider method unlock.

@Override
public void unlock() {
    try {
        LOG.info(generateLogStatement(LockState.RELEASING, generateLogSuffixString()));
        if (lock == null || !lock.isAcquiredInThisProcess()) {
            return;
        }
        lock.release();
        lock = null;
        LOG.info(generateLogStatement(LockState.RELEASED, generateLogSuffixString()));
    } catch (Exception e) {
        throw new HoodieLockException(generateLogStatement(LockState.FAILED_TO_RELEASE, generateLogSuffixString()), e);
    }
}
Also used : HoodieLockException(org.apache.hudi.exception.HoodieLockException) HoodieLockException(org.apache.hudi.exception.HoodieLockException)

Example 12 with HoodieLockException

use of org.apache.hudi.exception.HoodieLockException in project hudi by apache.

the class HiveMetastoreBasedLockProvider method unlock.

@Override
public void unlock() {
    try {
        LOG.info(generateLogStatement(RELEASING, generateLogSuffixString()));
        LockResponse lockResponseLocal = lock;
        if (lockResponseLocal == null) {
            return;
        }
        lock = null;
        hiveClient.unlock(lockResponseLocal.getLockid());
        LOG.info(generateLogStatement(RELEASED, generateLogSuffixString()));
    } catch (TException e) {
        throw new HoodieLockException(generateLogStatement(FAILED_TO_RELEASE, generateLogSuffixString()), e);
    }
}
Also used : TException(org.apache.thrift.TException) HoodieLockException(org.apache.hudi.exception.HoodieLockException) LockResponse(org.apache.hadoop.hive.metastore.api.LockResponse)

Aggregations

HoodieLockException (org.apache.hudi.exception.HoodieLockException)12 LockNotGrantedException (com.amazonaws.services.dynamodbv2.model.LockNotGrantedException)2 AttributeDefinition (com.amazonaws.services.dynamodbv2.model.AttributeDefinition)1 CreateTableRequest (com.amazonaws.services.dynamodbv2.model.CreateTableRequest)1 KeySchemaElement (com.amazonaws.services.dynamodbv2.model.KeySchemaElement)1 ProvisionedThroughput (com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput)1 TableUtils (com.amazonaws.services.dynamodbv2.util.TableUtils)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 InterProcessMutex (org.apache.curator.framework.recipes.locks.InterProcessMutex)1 LockResponse (org.apache.hadoop.hive.metastore.api.LockResponse)1 ZookeeperBasedLockProvider (org.apache.hudi.client.transaction.lock.ZookeeperBasedLockProvider)1 LockProvider (org.apache.hudi.common.lock.LockProvider)1 HoodieIOException (org.apache.hudi.exception.HoodieIOException)1 TException (org.apache.thrift.TException)1 Test (org.junit.jupiter.api.Test)1