@@ -176,13 +176,13 @@ public MerkleDbDataSource(
176
176
final int tableId ,
177
177
final MerkleDbTableConfig tableConfig ,
178
178
final boolean compactionEnabled ,
179
- final boolean preferDiskBasedIndices )
179
+ final boolean offlineUse )
180
180
throws IOException {
181
181
this .database = database ;
182
182
this .tableName = tableName ;
183
183
this .tableId = tableId ;
184
184
this .tableConfig = tableConfig ;
185
- this .preferDiskBasedIndices = preferDiskBasedIndices ;
185
+ this .preferDiskBasedIndices = offlineUse ;
186
186
187
187
final MerkleDbConfig merkleDbConfig = config .getConfigData (MerkleDbConfig .class );
188
188
@@ -348,11 +348,14 @@ public MerkleDbDataSource(
348
348
tableName + ":objectKeyToPath" ,
349
349
preferDiskBasedIndices );
350
350
keyToPath .printStats ();
351
- final String tablesToRepairHdhmConfig = merkleDbConfig .tablesToRepairHdhm ();
352
- if (tablesToRepairHdhmConfig != null ) {
353
- final String [] tableNames = tablesToRepairHdhmConfig .split ("," );
354
- if (Arrays .stream (tableNames ).filter (s -> !s .isBlank ()).anyMatch (tableName ::equals )) {
355
- keyToPath .repair (getFirstLeafPath (), getLastLeafPath (), pathToKeyValue );
351
+ // Repair keyToPath based on pathToKeyValue data, if requested and not offlineUse
352
+ if (!offlineUse ) {
353
+ final String tablesToRepairHdhmConfig = merkleDbConfig .tablesToRepairHdhm ();
354
+ if (tablesToRepairHdhmConfig != null ) {
355
+ final String [] tableNames = tablesToRepairHdhmConfig .split ("," );
356
+ if (Arrays .stream (tableNames ).filter (s -> !s .isBlank ()).anyMatch (tableName ::equals )) {
357
+ keyToPath .repair (getFirstLeafPath (), getLastLeafPath (), pathToKeyValue );
358
+ }
356
359
}
357
360
}
358
361
0 commit comments