rocksdb/java/rocksjni/statisticsjni.cc
DorianZheng 2670fe8c73 Get CompactionJobInfo from CompactFiles
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4716

Differential Revision: D13207677

Pulled By: ajkr

fbshipit-source-id: d0ccf5a66df6cbb07288b0c5ebad81fd9df3926b
2018-12-13 14:21:24 -08:00

32 lines
1001 B
C++

// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// This file implements the callback "bridge" between Java and C++ for
// rocksdb::Statistics
#include "rocksjni/statisticsjni.h"
namespace rocksdb {
StatisticsJni::StatisticsJni(std::shared_ptr<Statistics> stats)
: StatisticsImpl(stats), m_ignore_histograms() {}
StatisticsJni::StatisticsJni(std::shared_ptr<Statistics> stats,
const std::set<uint32_t> ignore_histograms)
: StatisticsImpl(stats), m_ignore_histograms(ignore_histograms) {}
bool StatisticsJni::HistEnabledForType(uint32_t type) const {
if (type >= HISTOGRAM_ENUM_MAX) {
return false;
}
if (m_ignore_histograms.count(type) > 0) {
return false;
}
return true;
}
// @lint-ignore TXT4 T25377293 Grandfathered in
};