event_logger_, cfd->ioptions()->listeners, dbname_, cfd->GetName(), fname,
job_id_, meta->fd, tp, TableFileCreationReason::kCompaction, s);
+#ifndef ROCKSDB_LITE
// Report new file to SstFileManagerImpl
auto sfm =
static_cast<SstFileManagerImpl*>(db_options_.sst_file_manager.get());
}
}
}
+#endif
sub_compact->builder.reset();
sub_compact->current_output_file_size = 0;
// may temporarily unlock and lock the mutex.
NotifyOnFlushCompleted(cfd, &file_meta, mutable_cf_options,
job_context->job_id, flush_job.GetTableProperties());
-#endif // ROCKSDB_LITE
auto sfm = static_cast<SstFileManagerImpl*>(
immutable_db_options_.sst_file_manager.get());
if (sfm) {
"DBImpl::FlushMemTableToOutputFile:MaxAllowedSpaceReached");
}
}
+#endif // ROCKSDB_LITE
}
return s;
}
}
impl->mutex_.Unlock();
+#ifndef ROCKSDB_LITE
auto sfm = static_cast<SstFileManagerImpl*>(
impl->immutable_db_options_.sst_file_manager.get());
if (s.ok() && sfm) {
}
}
}
+#endif // !ROCKSDB_LITE
if (s.ok()) {
Log(InfoLogLevel::INFO_LEVEL, impl->immutable_db_options_.info_log,
listener->VerifyMatchedCount(1);
}
-#endif // ROCKSDB_LITE
-
TEST_F(DBSSTTest, DBWithSstFileManager) {
std::shared_ptr<SstFileManager> sst_file_manager(NewSstFileManager(env_));
auto sfm = static_cast<SstFileManagerImpl*>(sst_file_manager.get());
rocksdb::SyncPoint::GetInstance()->DisableProcessing();
}
-#ifndef ROCKSDB_LITE
TEST_F(DBSSTTest, RateLimitedDelete) {
Destroy(last_options_);
rocksdb::SyncPoint::GetInstance()->LoadDependency({
// We have deleted the 4 sst files in the delete_scheduler
ASSERT_EQ(bg_delete_file, 4);
}
-#endif // ROCKSDB_LITE
TEST_F(DBSSTTest, DBWithMaxSpaceAllowed) {
std::shared_ptr<SstFileManager> sst_file_manager(NewSstFileManager(env_));
ASSERT_GT(reached_max_space_on_compaction, 0);
}
-#ifndef ROCKSDB_LITE
TEST_F(DBSSTTest, OpenDBWithInfiniteMaxOpenFiles) {
// Open DB with infinite max open files
// - First iteration use 1 thread to open files
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
+#ifndef ROCKSDB_LITE
+
#include "util/delete_scheduler.h"
#include <thread>
}
} // namespace rocksdb
+
+#endif // ROCKSDB_LITE
#pragma once
+#ifndef ROCKSDB_LITE
+
#include <map>
#include <queue>
#include <string>
};
} // namespace rocksdb
+
+#endif // ROCKSDB_LITE
#include "util/testharness.h"
#include "util/testutil.h"
+#ifndef ROCKSDB_LITE
+
namespace rocksdb {
class DeleteSchedulerTest : public testing::Test {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
+
+#else
+int main(int argc, char** argv) {
+ printf("DeleteScheduler is not supported in ROCKSDB_LITE\n");
+ return 0;
+}
+#endif // ROCKSDB_LITE
Status DeleteSSTFile(const ImmutableDBOptions* db_options,
const std::string& fname, uint32_t path_id) {
// TODO(tec): support sst_file_manager for multiple path_ids
+#ifndef ROCKSDB_LITE
auto sfm =
static_cast<SstFileManagerImpl*>(db_options->sst_file_manager.get());
if (sfm && path_id == 0) {
} else {
return db_options->env->DeleteFile(fname);
}
+#else
+ // SstFileManager is not supported in ROCKSDB_LITE
+ return db_options->env->DeleteFile(fname);
+#endif
}
} // namespace rocksdb
#include "port/port.h"
#include "rocksdb/env.h"
+#include "rocksdb/sst_file_manager.h"
#include "util/mutexlock.h"
#include "util/sync_point.h"
namespace rocksdb {
+#ifndef ROCKSDB_LITE
SstFileManagerImpl::SstFileManagerImpl(Env* env, std::shared_ptr<Logger> logger,
const std::string& trash_dir,
int64_t rate_bytes_per_sec)
return res;
}
+#else
+
+SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log,
+ std::string trash_dir,
+ int64_t rate_bytes_per_sec,
+ bool delete_exisitng_trash, Status* status) {
+ if (status) {
+ *status =
+ Status::NotSupported("SstFileManager is not supported in ROCKSDB_LITE");
+ }
+ return nullptr;
+}
+
+#endif // ROCKSDB_LITE
+
} // namespace rocksdb
+
#pragma once
+#ifndef ROCKSDB_LITE
+
#include <string>
#include "port/port.h"
};
} // namespace rocksdb
+
+#endif // ROCKSDB_LITE