@@ -114,11 +114,7 @@ Status NewCatalog::InitCatalog(KVInstance *kv_instance, TxnTimeStamp checkpoint_
114
114
}
115
115
116
116
auto InitBlockColumn = [&](ColumnMeta &column_meta) {
117
- Status status = column_meta.LoadSet ();
118
- if (!status.ok ()) {
119
- return status;
120
- }
121
- return Status::OK ();
117
+ return column_meta.LoadSet ();
122
118
};
123
119
auto InitBlock = [&](BlockMeta &block_meta) {
124
120
SharedPtr<Vector<SharedPtr<ColumnDef>>> column_defs_ptr;
@@ -133,12 +129,7 @@ Status NewCatalog::InitCatalog(KVInstance *kv_instance, TxnTimeStamp checkpoint_
133
129
return status;
134
130
}
135
131
}
136
- Status status = block_meta.LoadSet (checkpoint_ts);
137
- if (!status.ok ()) {
138
- return status;
139
- }
140
-
141
- return Status::OK ();
132
+ return block_meta.LoadSet (checkpoint_ts);
142
133
};
143
134
auto InitSegment = [&](SegmentMeta &segment_meta) {
144
135
auto [block_ids, status] = segment_meta.GetBlockIDs1 ();
@@ -376,9 +367,9 @@ Status NewCatalog::GetAllMemIndexes(KVInstance *kv_instance,
376
367
SegmentIndexMeta segment_index_meta (segment_id, table_index_meta);
377
368
378
369
SharedPtr<MemIndex> mem_index;
379
- Status status = segment_index_meta.GetMemIndex (mem_index);
380
- if (!status .ok ()) {
381
- return status ;
370
+ Status status_mem_index = segment_index_meta.GetMemIndex (mem_index);
371
+ if (!status_mem_index .ok ()) {
372
+ return status_mem_index ;
382
373
}
383
374
384
375
mem_indexes.push_back (mem_index);
@@ -433,7 +424,7 @@ Status NewCatalog::GetAllMemIndexes(KVInstance *kv_instance,
433
424
const String &db_id_str = (*db_id_strs_ptr)[i];
434
425
const String &db_name = (*db_names_ptr)[i];
435
426
DBMeeta db_meta (db_id_str, *kv_instance);
436
- Status status = TraverseDB (db_meta, db_name);
427
+ status = TraverseDB (db_meta, db_name);
437
428
if (!status.ok ()) {
438
429
return status;
439
430
}
@@ -509,7 +500,7 @@ Status NewCatalog::AddNewTable(DBMeeta &db_meta,
509
500
TxnTimeStamp commit_ts,
510
501
const SharedPtr<TableDef> &table_def,
511
502
Optional<TableMeeta> &table_meta) {
512
- // Create table key value pair
503
+ // Create table a key value pair
513
504
KVInstance &kv_instance = db_meta.kv_instance ();
514
505
String table_key = KeyEncode::CatalogTableKey (db_meta.db_id_str (), *table_def->table_name (), commit_ts);
515
506
Status status = kv_instance.Put (table_key, table_id_str);
@@ -584,7 +575,7 @@ Status NewCatalog::AddNewTableIndex(TableMeeta &table_meta,
584
575
TxnTimeStamp commit_ts,
585
576
const SharedPtr<IndexBase> &index_base,
586
577
Optional<TableIndexMeeta> &table_index_meta) {
587
- // Create index key value pair
578
+ // Create index a key value pair
588
579
KVInstance &kv_instance = table_meta.kv_instance ();
589
580
const String &index_name = *index_base->index_name_ ;
590
581
String index_key = KeyEncode::CatalogIndexKey (table_meta.db_id_str (), table_meta.table_id_str (), index_name, commit_ts);
@@ -664,12 +655,7 @@ Status NewCatalog::CleanTableIndex(TableIndexMeeta &table_index_meta,
664
655
}
665
656
}
666
657
667
- Status status = table_index_meta.UninitSet1 (usage_flag);
668
- if (!status.ok ()) {
669
- return status;
670
- }
671
-
672
- return Status::OK ();
658
+ return table_index_meta.UninitSet1 (usage_flag);
673
659
}
674
660
675
661
// Status NewCatalog::AddNewSegment(TableMeeta &table_meta, SegmentID segment_id, Optional<SegmentMeta> &segment_meta) {
@@ -697,11 +683,7 @@ Status NewCatalog::AddNewSegment1(TableMeeta &table_meta, TxnTimeStamp commit_ts
697
683
return status;
698
684
}
699
685
segment_meta.emplace (segment_id, table_meta);
700
- status = segment_meta->InitSet ();
701
- if (!status.ok ()) {
702
- return status;
703
- }
704
- return Status::OK ();
686
+ return segment_meta->InitSet ();
705
687
}
706
688
707
689
Status NewCatalog::AddNewSegmentWithID (TableMeeta &table_meta, TxnTimeStamp commit_ts, Optional<SegmentMeta> &segment_meta, SegmentID segment_id) {
@@ -710,11 +692,7 @@ Status NewCatalog::AddNewSegmentWithID(TableMeeta &table_meta, TxnTimeStamp comm
710
692
return status;
711
693
}
712
694
segment_meta.emplace (segment_id, table_meta);
713
- status = segment_meta->InitSet ();
714
- if (!status.ok ()) {
715
- return status;
716
- }
717
- return Status::OK ();
695
+ return segment_meta->InitSet ();
718
696
}
719
697
720
698
Status NewCatalog::LoadFlushedSegment1 (TableMeeta &table_meta, const WalSegmentInfo &segment_info, TxnTimeStamp checkpoint_ts) {
@@ -859,7 +837,7 @@ Status NewCatalog::AddNewBlockForTransform(SegmentMeta &segment_meta, TxnTimeSta
859
837
return Status::OK ();
860
838
}
861
839
//
862
- // Status NewCatalog::AddNewTableIndexForTransform(TableMeeta &table_meta,TxnTimeStamp commit_ts,Optional<TableIndexMeta> &table_index_meta) {
840
+ // Status NewCatalog::AddNewTableIndexForTransform(TableMeeta &table_meta, TxnTimeStamp commit_ts, Optional<TableIndexMeta> &table_index_meta) {
863
841
// Status status;
864
842
// BlockID block_id;
865
843
// std::tie(block_id, status) = table_meta.AddBlockID1(commit_ts);
@@ -1246,7 +1224,7 @@ Status NewCatalog::GetBlockVisibleRange(BlockMeta &block_meta, TxnTimeStamp begi
1246
1224
BufferHandle buffer_handle = version_buffer->Load ();
1247
1225
SharedPtr<BlockLock> block_lock;
1248
1226
{
1249
- Status status = block_meta.GetBlockLock (block_lock);
1227
+ status = block_meta.GetBlockLock (block_lock);
1250
1228
if (!status.ok ()) {
1251
1229
return status;
1252
1230
}
@@ -1371,9 +1349,9 @@ Status NewCatalog::GetBlockFilePaths(BlockMeta &block_meta, Vector<String> &file
1371
1349
if (!status.ok ()) {
1372
1350
return status;
1373
1351
}
1374
- if (! column_def) {
1375
- for (const auto &column_def : *column_defs_ptr) {
1376
- ColumnMeta column_meta (column_def ->id (), block_meta);
1352
+ if (column_def == nullptr ) {
1353
+ for (const auto &column_def_ptr : *column_defs_ptr) {
1354
+ ColumnMeta column_meta (column_def_ptr ->id (), block_meta);
1377
1355
status = GetBlockColumnFilePaths (column_meta, file_paths);
1378
1356
if (!status.ok ()) {
1379
1357
return status;
@@ -1539,7 +1517,7 @@ Status NewCatalog::CheckSegmentRowsVisible(SegmentMeta &segment_meta, TxnTimeSta
1539
1517
}
1540
1518
for (BlockID block_id : *block_ids_ptr) {
1541
1519
BlockMeta block_meta (block_id, segment_meta);
1542
- Status status = NewCatalog::SetBlockDeleteBitmask (block_meta, begin_ts, bitmask);
1520
+ status = NewCatalog::SetBlockDeleteBitmask (block_meta, begin_ts, bitmask);
1543
1521
if (!status.ok ()) {
1544
1522
return status;
1545
1523
}
0 commit comments