Caideyipi commented on code in PR #15538:
URL: https://github.com/apache/iotdb/pull/15538#discussion_r3794257801
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java:
##########
@@ -261,6 +262,14 @@ public TSStatus alterDatabase(final DatabaseSchemaPlan
plan) {
currentSchema.getTTL());
}
+ if (alterSchema.isSetNeedLastCache()) {
+ currentSchema.setNeedLastCache(alterSchema.isNeedLastCache());
+ LOGGER.info(
+ "[SetNeedLastCache] The need last cache flag of Database: {} is
adjusted to: {}",
Review Comment:
Applied in 280eb89dec3. The new log template now uses a `ConfigNodeMessages`
constant with matching English and Chinese definitions. Both locale compiles
pass.
##########
integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java:
##########
@@ -775,10 +890,10 @@ public void testTreeViewTable() throws Exception {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
statement.execute("create database root.another");
- statement.execute("create database root.`重庆`.`1`.b");
- statement.execute("create timeSeries root.`重庆`.`1`.b.`2`.S1 int32");
- statement.execute("create timeSeries root.`重庆`.`1`.b.`2`.s2 string");
- statement.execute("create timeSeries root.`重庆`.`1`.b.S1 int32");
+ statement.execute("create database root.`閲嶅簡`.`1`.b");
+ statement.execute("create timeSeries root.`閲嶅簡`.`1`.b.`2`.S1 int32");
+ statement.execute("create timeSeries root.`閲嶅簡`.`1`.b.`2`.s2 string");
+ statement.execute("create timeSeries root.`閲嶅簡`.`1`.b.S1 int32");
Review Comment:
Applied in 280eb89dec3. This was mojibake from an incorrectly encoded `重庆`
test identifier. I restored the intended UTF-8 text in this statement and all
related tree-view paths/assertions in `IoTDBTableIT`.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java:
##########
@@ -558,12 +586,33 @@ public void checkAndAutoCreateDatabase(
/**
* update database cache
*
- * @param databaseNames the database names that need to update
+ * @param databases the database names
+ */
+ public void updateDatabaseCache(final Set<String> databases) {
+ databaseCacheLock.writeLock().lock();
+ try {
+ databases.forEach(database -> database2NeedLastCacheCache.put(database,
true));
+ } finally {
+ databaseCacheLock.writeLock().unlock();
+ }
+ }
Review Comment:
Clarified in 280eb89dec3. This `Set<String>` overload is only used for
databases just created by local `setDatabase` requests; those requests leave
`needLastCache` unset, whose backward-compatible default is enabled. The
Javadoc and inline comment now state that contract explicitly. The `Map<String,
TDatabaseSchema>` overload still preserves each fetched database's actual flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]