Commit aa576395 authored by zhangjinpeng1987's avatar zhangjinpeng1987 Committed by siddontang

add output level for compaction job (#182)

parent dab0fc9d
...@@ -1707,6 +1707,11 @@ uint64_t crocksdb_compactionjobinfo_num_corrupt_keys( ...@@ -1707,6 +1707,11 @@ uint64_t crocksdb_compactionjobinfo_num_corrupt_keys(
return info->rep.stats.num_corrupt_keys; return info->rep.stats.num_corrupt_keys;
} }
int crocksdb_compactionjobinfo_output_level(
const crocksdb_compactionjobinfo_t* info) {
return info->rep.output_level;
}
/* ExternalFileIngestionInfo */ /* ExternalFileIngestionInfo */
const char* crocksdb_externalfileingestioninfo_cf_name( const char* crocksdb_externalfileingestioninfo_cf_name(
......
...@@ -641,6 +641,9 @@ crocksdb_compactionjobinfo_elapsed_micros(const crocksdb_compactionjobinfo_t*); ...@@ -641,6 +641,9 @@ crocksdb_compactionjobinfo_elapsed_micros(const crocksdb_compactionjobinfo_t*);
extern C_ROCKSDB_LIBRARY_API uint64_t extern C_ROCKSDB_LIBRARY_API uint64_t
crocksdb_compactionjobinfo_num_corrupt_keys( crocksdb_compactionjobinfo_num_corrupt_keys(
const crocksdb_compactionjobinfo_t*); const crocksdb_compactionjobinfo_t*);
extern C_ROCKSDB_LIBRARY_API int
crocksdb_compactionjobinfo_output_level(
const crocksdb_compactionjobinfo_t*);
/* External file ingestion info */ /* External file ingestion info */
......
...@@ -1461,6 +1461,7 @@ extern "C" { ...@@ -1461,6 +1461,7 @@ extern "C" {
pub fn crocksdb_compactionjobinfo_num_corrupt_keys( pub fn crocksdb_compactionjobinfo_num_corrupt_keys(
info: *const DBCompactionJobInfo, info: *const DBCompactionJobInfo,
) -> uint64_t; ) -> uint64_t;
pub fn crocksdb_compactionjobinfo_output_level(info: *const DBCompactionJobInfo) -> c_int;
pub fn crocksdb_externalfileingestioninfo_cf_name( pub fn crocksdb_externalfileingestioninfo_cf_name(
info: *const DBIngestionInfo, info: *const DBIngestionInfo,
......
...@@ -88,6 +88,10 @@ impl CompactionJobInfo { ...@@ -88,6 +88,10 @@ impl CompactionJobInfo {
pub fn num_corrupt_keys(&self) -> u64 { pub fn num_corrupt_keys(&self) -> u64 {
unsafe { crocksdb_ffi::crocksdb_compactionjobinfo_num_corrupt_keys(&self.0) } unsafe { crocksdb_ffi::crocksdb_compactionjobinfo_num_corrupt_keys(&self.0) }
} }
pub fn output_level(&self) -> i32 {
unsafe { crocksdb_ffi::crocksdb_compactionjobinfo_output_level(&self.0) }
}
} }
pub struct IngestionInfo(DBIngestionInfo); pub struct IngestionInfo(DBIngestionInfo);
......
...@@ -62,6 +62,7 @@ impl EventListener for EventCounter { ...@@ -62,6 +62,7 @@ impl EventListener for EventCounter {
assert_ne!(info.elapsed_micros(), 0); assert_ne!(info.elapsed_micros(), 0);
assert_eq!(info.num_corrupt_keys(), 0); assert_eq!(info.num_corrupt_keys(), 0);
assert!(info.output_level() >= 0);
self.compaction.fetch_add(1, Ordering::SeqCst); self.compaction.fetch_add(1, Ordering::SeqCst);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment