1
0

[MINOR] Optimize variable names and logs (#4581)

This commit is contained in:
董可伦
2022-01-16 16:09:22 +08:00
committed by GitHub
parent 5e0171a5ee
commit 822230d9ea

View File

@@ -261,23 +261,23 @@ public class HoodieHiveClient extends AbstractSyncHoodieClient {
public Option<String> getLastCommitTimeSynced(String tableName) {
// Get the last commit time from the TBLproperties
try {
Table database = client.getTable(syncConfig.databaseName, tableName);
return Option.ofNullable(database.getParameters().getOrDefault(HOODIE_LAST_COMMIT_TIME_SYNC, null));
Table table = client.getTable(syncConfig.databaseName, tableName);
return Option.ofNullable(table.getParameters().getOrDefault(HOODIE_LAST_COMMIT_TIME_SYNC, null));
} catch (Exception e) {
throw new HoodieHiveSyncException("Failed to get the last commit time synced from the database", e);
throw new HoodieHiveSyncException("Failed to get the last commit time synced from the table " + tableName, e);
}
}
public Option<String> getLastReplicatedTime(String tableName) {
// Get the last replicated time from the TBLproperties
try {
Table database = client.getTable(syncConfig.databaseName, tableName);
return Option.ofNullable(database.getParameters().getOrDefault(GLOBALLY_CONSISTENT_READ_TIMESTAMP, null));
Table table = client.getTable(syncConfig.databaseName, tableName);
return Option.ofNullable(table.getParameters().getOrDefault(GLOBALLY_CONSISTENT_READ_TIMESTAMP, null));
} catch (NoSuchObjectException e) {
LOG.warn("the said table not found in hms " + syncConfig.databaseName + "." + tableName);
return Option.empty();
} catch (Exception e) {
throw new HoodieHiveSyncException("Failed to get the last replicated time from the database", e);
throw new HoodieHiveSyncException("Failed to get the last replicated time from the table " + tableName, e);
}
}