Skip to content

Commit

Permalink
Remove dataSourceProperties from the result set of ShowStorageUnitExe…
Browse files Browse the repository at this point in the history
…cutor (#28764)

* Remove dataSourceProperties from the result set of ShowStorageUnitExecutor

* Update
  • Loading branch information
yx9o authored Oct 16, 2023
1 parent 559f121 commit 9bbcfba
Show file tree
Hide file tree
Showing 28 changed files with 242 additions and 241 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public Collection<LocalDataQueryResultRow> getRows(final ShardingSphereDatabase
Collection<LocalDataQueryResultRow> result = new LinkedList<>();
for (Entry<String, StorageUnit> entry : getToBeShownStorageUnits(database, sqlStatement).entrySet()) {
ConnectionProperties connectionProps = entry.getValue().getConnectionProperties();
DataSourcePoolProperties dataSourcePoolProperties = getDataSourcePoolProperties(entry.getValue());
Map<String, Object> poolProps = dataSourcePoolProperties.getPoolPropertySynonyms().getStandardProperties();
Map<String, Object> customProps = getCustomProperties(dataSourcePoolProperties.getCustomProperties().getProperties(), connectionProps.getQueryProperties());
DataSourcePoolProperties dataSourcePoolProps = getDataSourcePoolProperties(entry.getValue());
Map<String, Object> poolProps = dataSourcePoolProps.getPoolPropertySynonyms().getStandardProperties();
Map<String, Object> customProps = getCustomProperties(dataSourcePoolProps.getCustomProperties().getProperties(), connectionProps.getQueryProperties());
result.add(new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getStorageType().getType(),
connectionProps.getHostname(),
Expand Down Expand Up @@ -109,6 +109,7 @@ private DataSourcePoolProperties getDataSourcePoolProperties(final StorageUnit s

private Map<String, Object> getCustomProperties(final Map<String, Object> customProps, final Properties queryProps) {
Map<String, Object> result = new LinkedHashMap<>(customProps);
result.remove("dataSourceProperties");
if (!queryProps.isEmpty()) {
result.put("queryProperties", queryProps);
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<column name="read_only" />
<column name="other_attributes" />
</metadata>
<row values="ds_0| openGauss| opengauss.db.host| 5432| db_0| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_1| openGauss| opengauss.db.host| 5432| db_1| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_2| openGauss| opengauss.db.host| 5432| db_2| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_3| openGauss| opengauss.db.host| 5432| db_3| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_4| openGauss| opengauss.db.host| 5432| db_4| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_5| openGauss| opengauss.db.host| 5432| db_5| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_6| openGauss| opengauss.db.host| 5432| db_6| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_7| openGauss| opengauss.db.host| 5432| db_7| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_8| openGauss| opengauss.db.host| 5432| db_8| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_9| openGauss| opengauss.db.host| 5432| db_9| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;dataSourceProperties&quot;&#58;&#123;&#125;&#44;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_0| openGauss| opengauss.db.host| 5432| db_0| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_1| openGauss| opengauss.db.host| 5432| db_1| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_2| openGauss| opengauss.db.host| 5432| db_2| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_3| openGauss| opengauss.db.host| 5432| db_3| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_4| openGauss| opengauss.db.host| 5432| db_4| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_5| openGauss| opengauss.db.host| 5432| db_5| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_6| openGauss| opengauss.db.host| 5432| db_6| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_7| openGauss| opengauss.db.host| 5432| db_7| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_8| openGauss| opengauss.db.host| 5432| db_8| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
<row values="ds_9| openGauss| opengauss.db.host| 5432| db_9| 30000| 60000| 1800000| 50| 2| false| &#123;&quot;healthCheckProperties&quot;&#58;&#123;&#125;&#44;&quot;initializationFailTimeout&quot;&#58;1&#44;&quot;validationTimeout&quot;&#58;5000&#44;&quot;keepaliveTime&quot;&#58;0&#44;&quot;leakDetectionThreshold&quot;&#58;0&#44;&quot;registerMbeans&quot;&#58;false&#44;&quot;allowPoolSuspension&quot;&#58;false&#44;&quot;autoCommit&quot;&#58;true&#44;&quot;isolateInternalQueries&quot;&#58;false&#125;" />
</dataset>
Loading

0 comments on commit 9bbcfba

Please sign in to comment.