Skip to content

Commit

Permalink
Spotless apply
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhang10 committed Dec 2, 2024
1 parent 50f6745 commit dfdd9c6
Showing 1 changed file with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
import jline.internal.Log;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.common.StatsSetupConst;
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
Expand Down Expand Up @@ -569,12 +568,20 @@ protected long acquireLock() throws UnknownHostException, TException, Interrupte
Lists.newArrayList(lockComponent),
System.getProperty("user.name"),
InetAddress.getLocalHost().getHostName());
LOG.warn("In thread {}, trying to call hmsclient.lock() on table {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, trying to call hmsclient.lock() on table {}",
Thread.currentThread(),
fullName);
LockResponse lockResponse = metaClients.run(client -> client.lock(lockRequest));
LOG.warn("In thread {}, hmsclient.lock() finished on table {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, hmsclient.lock() finished on table {}", Thread.currentThread(), fullName);
AtomicReference<LockState> state = new AtomicReference<>(lockResponse.getState());
long lockId = lockResponse.getLockid();
LOG.warn("In thread {}, lockId returned from hmsclient.lock() on table {} is {}", Thread.currentThread(), fullName, lockId);
LOG.warn(
"In thread {}, lockId returned from hmsclient.lock() on table {} is {}",
Thread.currentThread(),
fullName,
lockId);

final long start = System.currentTimeMillis();
long duration = 0;
Expand All @@ -600,9 +607,15 @@ protected long acquireLock() throws UnknownHostException, TException, Interrupte
.run(
id -> {
try {
LOG.warn("In thread {}, trying to call hmsclient.checkLock() on table {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, trying to call hmsclient.checkLock() on table {}",
Thread.currentThread(),
fullName);
LockResponse response = metaClients.run(client -> client.checkLock(id));
LOG.warn("In thread {}, hmsclient.checkLock() finished on table {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, hmsclient.checkLock() finished on table {}",
Thread.currentThread(),
fullName);
LockState newState = response.getState();
state.set(newState);
if (newState.equals(LockState.WAITING)) {
Expand Down Expand Up @@ -668,8 +681,7 @@ private void unlock(Optional<Long> lockId) {
} catch (Exception e) {
LOG.warn("Failed to unlock {}.{}", database, tableName, e);
}
}
else {
} else {
LOG.warn("No lockId to unlock for {}.{}", database, tableName);
}
}
Expand Down

0 comments on commit dfdd9c6

Please sign in to comment.