jt2594838 commented on code in PR #15538:
URL: https://github.com/apache/iotdb/pull/15538#discussion_r2541161288
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java:
##########
@@ -253,19 +253,38 @@ private void fetchDatabaseAndUpdateCache(
}
}
+ public boolean isNeedLastCache(final String database) {
+ Boolean needLastCache = database2NeedLastCacheCache.get(database);
+ if (Objects.nonNull(needLastCache)) {
+ return needLastCache;
+ }
+ try {
+ fetchDatabaseAndUpdateCache(false);
+ } catch (final TException | ClientManagerException e) {
+ logger.warn(
+ "Failed to get need_last_cache info for database {}, will put cache
anyway, exception: {}",
+ database,
+ e.getMessage());
+ return true;
+ }
+ needLastCache = database2NeedLastCacheCache.get(database);
+ return Objects.isNull(needLastCache) || needLastCache;
+ }
Review Comment:
It weird to pass a `false` to `fetchDatabaseAndUpdateCache`, because there
is no sign that indicates the method is only used by the tree model.
May add an annotation @TreeModel for this method.
The same for `checkAndAutoCreateDatabase(final String database, final
boolean isAutoCreate, final String userName)`.
##########
integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java:
##########
@@ -617,39 +621,39 @@ public void testInformationSchema() throws SQLException {
statement.execute(
"create table test.test (a tag, b attribute, c int32 comment
'turbine') comment 'test'");
statement.execute(
- "CREATE VIEW test.view_table (tag1 STRING TAG,tag2 STRING TAG,s11
INT32 FIELD,s3 INT32 FIELD FROM s2) RESTRICT WITH (ttl=100) AS root.\"a\".**");
+ "CREATE VIEW test.view_table (tag1 STRING TAG,tag2 STRING TAG,s11
INT32 FIELD,s3 INT32 FIELD FROM s2) RESTRICT WITH (ttl=100,
need_last_cache=true) AS root.\"a\".**");
Review Comment:
How does this apply to a tree view.
--
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]