Skip to content

Commit 253ede9

Browse files
author
litongxin
committed
update test
1 parent b0181ee commit 253ede9

File tree

3 files changed

+16
-742
lines changed

3 files changed

+16
-742
lines changed

src/storage/disk_table.cc

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ void DiskTable::GcTTL() {
533533
PDLOG(WARNING, "Manual Compaction failed");
534534
}
535535
}
536-
PDLOG(ERROR, "Manual Compaction Finished");
537536
}
538537

539538
void DiskTable::GcTTLOrHead() {}
@@ -1196,28 +1195,11 @@ bool DiskTable::DeleteIndex(const std::string& idx_name) {
11961195

11971196
uint64_t DiskTable::GetRecordIdxCnt() {
11981197
auto inner_indexs = table_index_.GetAllInnerIndex();
1199-
rocksdb::ReadOptions ro = rocksdb::ReadOptions();
1200-
const rocksdb::Snapshot* snapshot = db_->GetSnapshot();
1201-
1202-
// for (size_t i = 0; i < inner_indexs->size(); i++) {
1203-
// bool is_valid = false;
1204-
// for (const auto& index_def : inner_indexs->at(i)->GetIndex()) {
1205-
// if (index_def && index_def->IsReady()) {
1206-
// rocksdb::Iterator* it = db_->NewIterator(ro, cf_hs_[i + 1]);
1207-
1208-
// for (; it->Valid(); it->Next()) {
1209-
// uint32_t cur_ts_idx = UINT32_MAX;
1210-
// std::string cur_pk;
1211-
// uint64_t cur_ts;
1212-
1213-
// ParseKeyAndTs(has_ts_idx, it->key(), cur_pk, cur_ts, cur_ts_idx);
1214-
// }
1215-
// }
1216-
// }
1217-
1218-
// }
1219-
// TODO(litongxin)
1220-
return 0;
1198+
uint64_t count = 0;
1199+
for (const auto& inner_index : *inner_indexs) {
1200+
count += idx_cnt_vec_[inner_index->GetIndex().front()->GetId()]->load(std::memory_order_relaxed);
1201+
}
1202+
return count;
12211203
}
12221204

12231205
bool DiskTable::GetRecordIdxCnt(uint32_t idx, uint64_t** stat, uint32_t* size) {

src/storage/disk_table.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <memory>
2222
#include <string>
2323
#include <vector>
24-
#include <bitset>
2524
#include "base/endianconv.h"
2625
#include "base/slice.h"
2726
#include "boost/lexical_cast.hpp"
@@ -42,7 +41,6 @@
4241
#include "storage/table.h"
4342
#include "base/glog_wapper.h" // NOLINT
4443

45-
4644
namespace openmldb {
4745
namespace storage {
4846

@@ -180,7 +178,6 @@ class AbsoluteTTLCompactionFilter : public rocksdb::CompactionFilter {
180178

181179
bool Filter(int /*level*/, const rocksdb::Slice& key, const rocksdb::Slice& /*existing_value*/,
182180
std::string* /*new_value*/, bool* /*value_changed*/) const override {
183-
PDLOG(ERROR, "using compaction filter");
184181
if (key.size() < TS_LEN) {
185182
return false;
186183
}
@@ -555,7 +552,6 @@ class DiskTable : public Table {
555552
KeyTSComparator cmp_;
556553
std::atomic<uint64_t> offset_;
557554
std::string table_path_;
558-
std::atomic<uint64_t> pk_cnt_;
559555
std::vector<std::shared_ptr<std::atomic<uint64_t>>> idx_cnt_vec_;
560556
std::vector<std::shared_ptr<std::atomic<uint64_t>>> pk_cnt_vec_;
561557
std::vector<BloomFilter> bloom_filter_vec_;

0 commit comments

Comments
 (0)