Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Feb 5, 2024
1 parent 63ea9d8 commit f2cda8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public abstract class ExternalCatalog
private String comment;
// A cached and being converted properties for external catalog.
// generated from catalog properties.
private final byte[] lock = new byte[0];
private byte[] propLock = new byte[0];
private Map<String, String> convertedProperties = null;

public ExternalCatalog() {
Expand Down Expand Up @@ -302,7 +302,7 @@ protected void init() {
public void onRefresh(boolean invalidCache) {
this.objectCreated = false;
this.initialized = false;
synchronized (this.lock) {
synchronized (this.propLock) {
this.convertedProperties = null;
}
this.invalidCacheInInit = invalidCache;
Expand Down Expand Up @@ -432,7 +432,7 @@ public Map<String, String> getProperties() {
if (convertedProperties != null) {
return convertedProperties;
}
synchronized (lock) {
synchronized (propLock) {
if (convertedProperties != null) {
return convertedProperties;
}
Expand Down Expand Up @@ -569,6 +569,7 @@ public void gsonPostProcess() throws IOException {
}
}
}
this.propLock = new byte[0];
}

public void addDatabaseForTest(ExternalDatabase<? extends ExternalTable> db) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void replayJdbcCatalogTest() throws DdlException {
Map<String, String> newProperties = Maps.newHashMap();
newProperties.put(JdbcResource.CONNECTION_POOL_MIN_SIZE, "2");
jdbcExternalCatalog.getCatalogProperty().modifyCatalogProps(newProperties);
jdbcExternalCatalog.notifyPropertiesUpdated(newProperties);
JdbcExternalCatalog replayJdbcCatalog2 = (JdbcExternalCatalog) CatalogFactory.createFromLog(
jdbcExternalCatalog.constructEditLog());
Map<String, String> properties2 = replayJdbcCatalog2.getProperties();
Expand Down

0 comments on commit f2cda8d

Please sign in to comment.