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);
}
}
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);
}
}
Aggregations