Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhang10 committed Dec 2, 2024
1 parent dfdd9c6 commit ffb1faf
Showing 1 changed file with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,16 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
ReentrantLock tableLevelMutex = commitLockCache.get(fullName, t -> new ReentrantLock(true));
tableLevelMutex.lock();
try {
LOG.warn("In thread {}, starting to acquire a lock for table {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, starting to acquire a lock for table {}",
Thread.currentThread(),
fullName);
lockId = Optional.of(acquireLock());
LOG.warn("In thread {}, acquired lock id: {} for table {}", Thread.currentThread(), lockId.get(), fullName);
LOG.warn(
"In thread {}, acquired lock id: {} for table {}",
Thread.currentThread(),
lockId.get(),
fullName);
// TODO add lock heart beating for cases where default lock timeout is too low.
Table tbl;
// [LINKEDIN] Instead of checking if base != null to check for table existence, we query
Expand All @@ -207,9 +214,15 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
// definition and not create a new definition
LOG.warn("In thread {}, checking if table exists {}", Thread.currentThread(), fullName);
boolean tableExists = metaClients.run(client -> client.tableExists(database, tableName));
LOG.warn("In thread {}, checking table exists finishes with result: {}", Thread.currentThread(), tableExists);
LOG.warn(
"In thread {}, checking table exists finishes with result: {}",
Thread.currentThread(),
tableExists);
if (tableExists) {
LOG.warn("In thread {}, starting to call getTable: {} from HMS", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, starting to call getTable: {} from HMS",
Thread.currentThread(),
fullName);
tbl = metaClients.run(client -> client.getTable(database, tableName));
LOG.warn("In thread {}, getTable: {} from HMS finished", Thread.currentThread(), fullName);
fixMismatchedSchema(tbl);
Expand Down Expand Up @@ -288,9 +301,16 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
throw new RuntimeException("Interrupted during commit", e);

} finally {
LOG.warn("In thread {}, trying to cleanupMetadataAndUnlock of lock id: {} for table: {}", Thread.currentThread(), lockId, fullName);
LOG.warn(
"In thread {}, trying to cleanupMetadataAndUnlock of lock id: {} for table: {}",
Thread.currentThread(),
lockId,
fullName);
cleanupMetadataAndUnlock(commitStatus, newMetadataLocation, lockId, tableLevelMutex);
LOG.warn("In thread {}, cleanupMetadataAndUnlock finishes for table: {}", Thread.currentThread(), fullName);
LOG.warn(
"In thread {}, cleanupMetadataAndUnlock finishes for table: {}",
Thread.currentThread(),
fullName);
}
}

Expand Down

0 comments on commit ffb1faf

Please sign in to comment.