Skip to content

Commit

Permalink
Fixed the bugs of the table cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi authored Nov 27, 2024
1 parent 8a6405c commit 77a21a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ private void updateTable(
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) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public static byte[] serializeBatchTsTable(final Map<String, List<TsTable>> tabl
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);
Expand Down Expand Up @@ -133,7 +132,8 @@ public static byte[] serializeTableInitializationInfo(

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(
Expand Down

0 comments on commit 77a21a7

Please sign in to comment.