This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 77a21a71e7f Fixed the bugs of the table cache
77a21a71e7f is described below
commit 77a21a71e7f06a9ae82f1ad39ce715a3bec35d9d
Author: Caideyipi <[email protected]>
AuthorDate: Wed Nov 27 09:51:04 2024 +0800
Fixed the bugs of the table cache
---
.../org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java | 3 ++-
.../apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
index be7c3a413a7..525470f6f9c 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
@@ -330,7 +330,8 @@ public class DataNodeTableCache implements ITableCache {
try {
final AtomicBoolean isUpdated = new AtomicBoolean(false);
fetchedTables.forEach(
- (database, tableInfoMap) -> {
+ (qualifiedDatabase, tableInfoMap) -> {
+ final String database =
PathUtils.unQualifyDatabaseName(qualifiedDatabase);
if (preUpdateTableMap.containsKey(database)) {
tableInfoMap.forEach(
(tableName, tsTable) -> {
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java
index 97c108065e5..db5e9c034f7 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java
@@ -55,8 +55,7 @@ public class TsTableInternalRPCUtil {
return outputStream.toByteArray();
}
- public static Map<String, List<TsTable>> deserializeBatchTsTable(final
byte[] bytes) {
- final InputStream inputStream = new ByteArrayInputStream(bytes);
+ public static Map<String, List<TsTable>> deserializeBatchTsTable(final
InputStream inputStream) {
final Map<String, List<TsTable>> result = new HashMap<>();
try {
final int dbNum = ReadWriteIOUtils.readInt(inputStream);
@@ -133,7 +132,8 @@ public class TsTableInternalRPCUtil {
public static Pair<Map<String, List<TsTable>>, Map<String, List<TsTable>>>
deserializeTableInitializationInfo(final byte[] bytes) {
- return new Pair<>(deserializeBatchTsTable(bytes),
deserializeBatchTsTable(bytes));
+ final InputStream inputStream = new ByteArrayInputStream(bytes);
+ return new Pair<>(deserializeBatchTsTable(inputStream),
deserializeBatchTsTable(inputStream));
}
public static byte[] serializeTableFetchResult(