Skip to content

Commit b965a29

Browse files
committed
Fix files that merged poorly
1 parent bb35ce0 commit b965a29

File tree

14 files changed

+27
-85
lines changed

14 files changed

+27
-85
lines changed

db/db_impl/db_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "db/log_writer.h"
3333
#include "db/logs_with_prep_tracker.h"
3434
#include "db/memtable_list.h"
35-
#include "db/pre_release_callback.h"
3635
#include "db/range_del_aggregator.h"
3736
#include "db/read_callback.h"
3837
#include "db/snapshot_checker.h"

db/db_impl/db_impl_compaction_flush.cc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -481,27 +481,6 @@ Status DBImpl::AtomicFlushMemTablesToOutputFiles(
481481
}
482482

483483
if (s.ok()) {
484-
autovector<ColumnFamilyData*> tmp_cfds;
485-
autovector<const autovector<MemTable*>*> mems_list;
486-
autovector<const MutableCFOptions*> mutable_cf_options_list;
487-
autovector<FileMetaData*> tmp_file_meta;
488-
for (int i = 0; i != num_cfs; ++i) {
489-
const auto& mems = jobs[i].GetMemTables();
490-
if (!cfds[i]->IsDropped() && !mems.empty()) {
491-
tmp_cfds.emplace_back(cfds[i]);
492-
mems_list.emplace_back(&mems);
493-
mutable_cf_options_list.emplace_back(&all_mutable_cf_options[i]);
494-
tmp_file_meta.emplace_back(&file_meta[i]);
495-
}
496-
}
497-
498-
s = InstallMemtableAtomicFlushResults(
499-
nullptr /* imm_lists */, tmp_cfds, mutable_cf_options_list, mems_list,
500-
versions_.get(), &mutex_, tmp_file_meta,
501-
&job_context->memtables_to_free, directories_.GetDbDir(), log_buffer);
502-
}
503-
504-
if (s.ok() || s.IsShutdownInProgress()) {
505484
assert(num_cfs ==
506485
static_cast<int>(job_context->superversion_contexts.size()));
507486
for (int i = 0; i != num_cfs; ++i) {

db/db_test_util.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ ROT13BlockCipher rot13Cipher_(16);
5454
DBTestBase::DBTestBase(const std::string path)
5555
: mem_env_(nullptr),
5656
encrypted_env_(nullptr),
57-
s3_env_(nullptr),
58-
option_config_(kDefault) {
57+
option_config_(kDefault),
58+
s3_env_(nullptr) {
5959
Env* base_env = Env::Default();
6060
#ifndef ROCKSDB_LITE
6161
const char* test_env_uri = getenv("TEST_ENV_URI");
@@ -196,6 +196,12 @@ bool DBTestBase::ChangeOptions(int skip_mask) {
196196
break;
197197
}
198198
if (option_config_ >= kEnd) {
199+
#ifndef USE_AWS
200+
// If not built for AWS, skip it
201+
if (option_env_ + 1 == kAwsEnv) {
202+
option_env_++;
203+
}
204+
#endif
199205
if (option_env_ + 1 >= kEndEnv) {
200206
Destroy(last_options_);
201207
return false;
@@ -639,7 +645,7 @@ Env* DBTestBase::CreateNewAwsEnv(const std::string& prefix) {
639645
((AwsEnv*)cenv)->TEST_SetFileDeletionDelay(std::chrono::seconds(0));
640646
ROCKS_LOG_INFO(info_log_, "Created new aws env with path %s", prefix.c_str());
641647
if (!st.ok()) {
642-
Log(InfoLogLevel::DEBUG_LEVEL, info_log_, st.ToString().c_str());
648+
Log(InfoLogLevel::DEBUG_LEVEL, info_log_, "%s", st.ToString().c_str());
643649
}
644650
assert(st.ok() && cenv);
645651
return cenv;

db/range_tombstone_fragmenter.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -436,27 +436,4 @@ FragmentedRangeTombstoneIterator::SplitBySnapshot(
436436
return splits;
437437
}
438438

439-
std::map<SequenceNumber, std::unique_ptr<FragmentedRangeTombstoneIterator>>
440-
FragmentedRangeTombstoneIterator::SplitBySnapshot(
441-
const std::vector<SequenceNumber>& snapshots) {
442-
std::map<SequenceNumber, std::unique_ptr<FragmentedRangeTombstoneIterator>>
443-
splits;
444-
SequenceNumber lower = 0;
445-
SequenceNumber upper;
446-
for (size_t i = 0; i <= snapshots.size(); i++) {
447-
if (i >= snapshots.size()) {
448-
upper = kMaxSequenceNumber;
449-
} else {
450-
upper = snapshots[i];
451-
}
452-
if (tombstones_->ContainsRange(lower, upper)) {
453-
splits.emplace(upper, std::unique_ptr<FragmentedRangeTombstoneIterator>(
454-
new FragmentedRangeTombstoneIterator(
455-
tombstones_, *icmp_, upper, lower)));
456-
}
457-
lower = upper + 1;
458-
}
459-
return splits;
460-
}
461-
462439
} // namespace rocksdb

db/snapshot_impl.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,6 @@ class SnapshotList {
132132
return;
133133
}
134134

135-
// Whether there is an active snapshot in range [lower_bound, upper_bound).
136-
bool HasSnapshotInRange(SequenceNumber lower_bound,
137-
SequenceNumber upper_bound) {
138-
if (empty()) {
139-
return false;
140-
}
141-
const SnapshotImpl* s = &list_;
142-
while (s->next_ != &list_) {
143-
if (s->next_->number_ >= lower_bound) {
144-
return s->next_->number_ < upper_bound;
145-
}
146-
s = s->next_;
147-
}
148-
return false;
149-
}
150-
151135
// get the sequence number of the most recent snapshot
152136
SequenceNumber GetNewest() {
153137
if (empty()) {

file/file_util.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,4 @@ extern Status DeleteDBFile(const ImmutableDBOptions* db_options,
2929

3030
extern bool IsWalDirSameAsDBPath(const ImmutableDBOptions* db_options);
3131

32-
extern Status DeleteDBFile(const ImmutableDBOptions* db_options,
33-
const std::string& fname,
34-
const std::string& path_to_sync,
35-
const bool force_bg);
36-
3732
} // namespace rocksdb

include/rocksdb/cloud/cloud_env_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class CloudEnv : public Env {
339339
// Reads a file from the cloud
340340
virtual Status NewSequentialFileCloud(const std::string& bucket_prefix,
341341
const std::string& fname,
342-
unique_ptr<SequentialFile>* result,
342+
std::unique_ptr<SequentialFile>* result,
343343
const EnvOptions& options) = 0;
344344

345345
// Saves and retrieves the dbid->dirname mapping in cloud storage

java/rocksjni/ingest_external_file_options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,4 @@ void Java_org_rocksdb_IngestExternalFileOptions_disposeInternal(
193193
auto* options =
194194
reinterpret_cast<rocksdb::IngestExternalFileOptions*>(jhandle);
195195
delete options;
196-
}
196+
}

table/format.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ struct BlockContents {
273273
// The additional memory space taken by the block data.
274274
size_t usable_size() const {
275275
if (allocation.get() != nullptr) {
276+
auto allocator = allocation.get_deleter().allocator;
277+
if (allocator) {
278+
return allocator->UsableSize(allocation.get(), data.size());
279+
}
276280
#ifdef ROCKSDB_MALLOC_USABLE_SIZE
277281
return malloc_usable_size(allocation.get());
278282
#else

tools/block_cache_analyzer/block_cache_trace_analyzer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ void BlockCacheTraceAnalyzer::WriteCorrelationFeaturesToFile(
650650
const std::map<std::string, Features>& label_features,
651651
const std::map<std::string, Predictions>& label_predictions,
652652
uint32_t max_number_of_values) const {
653-
std::default_random_engine rand_engine(env_->NowMicros());
653+
std::default_random_engine rand_engine(static_cast<std::default_random_engine::result_type>(env_->NowMicros()));
654654
for (auto const& label_feature_vectors : label_features) {
655655
const Features& past = label_feature_vectors.second;
656656
auto it = label_predictions.find(label_feature_vectors.first);

0 commit comments

Comments
 (0)