-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Supported "need last cache" semantic for table/database schema #15538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 45 commits
9aa0e6d
69328e5
c2adf08
741589f
a25d674
b78baa4
6c8d342
fd526e3
abf7572
36cb154
832dc6a
0d49ba8
eedbd1c
51aa84d
4e98a2d
e6993aa
8669113
9f35a60
678c34d
d54543a
2b51fa2
b3c70ad
ce420f6
f5d3d75
31b094f
4e9582a
a46ea18
8715629
bb21903
3cc569d
7c23045
504c97c
c5ef08e
e191f35
8569987
040457a
01180dc
fb8aa46
cdf52b7
ccc2459
da3fbc6
def810d
3786e3e
dc42172
8a763b4
efefd90
42ec9de
2362349
56bdfc3
d6aa0b8
dd373ca
64a7832
e5be5f2
a8dc589
7050f1e
7e36f6c
cab78e9
85f038f
8cb8bab
6d3fb2f
30c78ec
9bd35fb
280eb89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,6 +152,7 @@ keyWords | |
| | MODELS | ||
| | MODIFY | ||
| | NAN | ||
| | NEED_LAST_CACHE | ||
| | NODEID | ||
| | NODES | ||
| | NONE | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,6 +136,7 @@ | |
| import static org.apache.iotdb.commons.schema.SchemaConstant.SYSTEM_DATABASE_PATTERN; | ||
| import static org.apache.iotdb.commons.schema.table.Audit.TABLE_MODEL_AUDIT_DATABASE; | ||
| import static org.apache.iotdb.commons.schema.table.Audit.TREE_MODEL_AUDIT_DATABASE; | ||
| import static org.apache.iotdb.commons.schema.table.TsTable.NEED_LAST_CACHE_PROPERTY; | ||
| import static org.apache.iotdb.commons.schema.table.TsTable.TTL_PROPERTY; | ||
|
|
||
| /** | ||
|
|
@@ -271,6 +272,21 @@ public TSStatus alterDatabase(final DatabaseSchemaPlan plan) { | |
| currentSchema.getTTL()); | ||
| } | ||
|
|
||
| if (alterSchema.isSetNeedLastCache() | ||
| && alterSchema.isNeedLastCache() | ||
| != (!currentSchema.isSetNeedLastCache() || currentSchema.isNeedLastCache())) { | ||
| if (!currentSchema.isIsTableModel()) { | ||
| result.setCode(TSStatusCode.SEMANTIC_ERROR.getStatusCode()); | ||
| result.setMessage("The tree model database does not support alter need last cache now."); | ||
| return result; | ||
| } | ||
| currentSchema.setNeedLastCache(alterSchema.isNeedLastCache()); | ||
| LOGGER.info( | ||
| "[SetNeedLastCache] The need last cache flag of Database: {} is adjusted to: {}", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i18n
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied in 280eb89. The new log template now uses a |
||
| currentSchema.getName(), | ||
| currentSchema.isNeedLastCache()); | ||
| } | ||
|
|
||
| mTree | ||
| .getDatabaseNodeByDatabasePath(partialPathName) | ||
| .getAsMNode() | ||
|
|
@@ -1285,6 +1301,11 @@ public ShowTableResp showTables(final ShowTablePlan plan) { | |
| TreeViewSchema.isTreeViewTable(pair.getLeft()) | ||
| ? TableType.VIEW_FROM_TREE.ordinal() | ||
| : TableType.BASE_TABLE.ordinal()); | ||
| info.setNeedLastCache( | ||
| pair.getLeft() | ||
| .getPropValue(NEED_LAST_CACHE_PROPERTY) | ||
| .map(Boolean::parseBoolean) | ||
| .orElse(true)); | ||
| return info; | ||
| }) | ||
| .collect(Collectors.toList()) | ||
|
|
@@ -1333,6 +1354,11 @@ public ShowTable4InformationSchemaResp showTables4InformationSchema() { | |
| TreeViewSchema.isTreeViewTable(pair.getLeft()) | ||
| ? TableType.VIEW_FROM_TREE.ordinal() | ||
| : TableType.BASE_TABLE.ordinal()); | ||
| info.setNeedLastCache( | ||
| pair.getLeft() | ||
| .getPropValue(NEED_LAST_CACHE_PROPERTY) | ||
| .map(Boolean::parseBoolean) | ||
| .orElse(true)); | ||
| return info; | ||
| }) | ||
| .collect(Collectors.toList())))); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.