Skip to content

Commit 77a21a7

Browse files
authored
Fixed the bugs of the table cache
1 parent 8a6405c commit 77a21a7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ private void updateTable(
330330
try {
331331
final AtomicBoolean isUpdated = new AtomicBoolean(false);
332332
fetchedTables.forEach(
333-
(database, tableInfoMap) -> {
333+
(qualifiedDatabase, tableInfoMap) -> {
334+
final String database = PathUtils.unQualifyDatabaseName(qualifiedDatabase);
334335
if (preUpdateTableMap.containsKey(database)) {
335336
tableInfoMap.forEach(
336337
(tableName, tsTable) -> {

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTableInternalRPCUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public static byte[] serializeBatchTsTable(final Map<String, List<TsTable>> tabl
5555
return outputStream.toByteArray();
5656
}
5757

58-
public static Map<String, List<TsTable>> deserializeBatchTsTable(final byte[] bytes) {
59-
final InputStream inputStream = new ByteArrayInputStream(bytes);
58+
public static Map<String, List<TsTable>> deserializeBatchTsTable(final InputStream inputStream) {
6059
final Map<String, List<TsTable>> result = new HashMap<>();
6160
try {
6261
final int dbNum = ReadWriteIOUtils.readInt(inputStream);
@@ -133,7 +132,8 @@ public static byte[] serializeTableInitializationInfo(
133132

134133
public static Pair<Map<String, List<TsTable>>, Map<String, List<TsTable>>>
135134
deserializeTableInitializationInfo(final byte[] bytes) {
136-
return new Pair<>(deserializeBatchTsTable(bytes), deserializeBatchTsTable(bytes));
135+
final InputStream inputStream = new ByteArrayInputStream(bytes);
136+
return new Pair<>(deserializeBatchTsTable(inputStream), deserializeBatchTsTable(inputStream));
137137
}
138138

139139
public static byte[] serializeTableFetchResult(

0 commit comments

Comments
 (0)