Skip to content

Commit

Permalink
Rename LLSM to TreeLine (#81)
Browse files Browse the repository at this point in the history
* Codemod: llsm -> tl

* Codemod: LLSM -> TL

* include/llsm/ -> include/tl/

* Leftover compilation changes

* Support legacy use of llsm/pg_llsm in the experiments

* TL -> TreeLine in comments when appropriate

* include/tl -> include/treeline

* Remove references to Learned LSM

* Use full name in CMake targets

* Use the full TreeLine where meaningful

* Bump manifest version, TL -> TreeLine in a few more places

* Newlines and other nits

* Shorten manifest signature to TL

* Update CI build options
  • Loading branch information
geoffxy authored Apr 20, 2022
1 parent 123fa2d commit bf899bd
Show file tree
Hide file tree
Showing 194 changed files with 1,105 additions and 1,082 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: sudo apt-get install libjemalloc-dev

- name: Configure Project using CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLSM_BUILD_TESTS=ON -DLLSM_BUILD_BENCHMARKS=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTL_BUILD_TESTS=ON -DTL_BUILD_BENCHMARKS=OFF

- name: Compile Project
working-directory: ${{github.workspace}}/build
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Learned LSM project uses code and concepts from LevelDB and RocksDB. We
# The TreeLine project uses code and concepts from LevelDB and RocksDB. We
# reproduce the LevelDB and RocksDB AUTHORS file below.

Facebook Inc.
Expand Down
67 changes: 33 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.17)
project(learnedlsm LANGUAGES CXX C)
project(treeline LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 17)

option(LLSM_BUILD_TESTS "Set to build the Learned LSM test suite." OFF)
option(LLSM_BUILD_BENCHMARKS "Set to build the Learned LSM benchmarks." OFF)
option(LLSM_BUILD_SHARED "Set to build the Learned LSM database as a shared library." OFF)
option(TL_BUILD_TESTS "Set to build the TreeLine test suite." OFF)
option(TL_BUILD_BENCHMARKS "Set to build the TreeLine benchmarks." OFF)
option(TL_BUILD_SHARED "Set to build TreeLine as a shared library." OFF)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") # Needed for ALEX

Expand All @@ -18,42 +18,42 @@ find_library(tbb tbb)
# Load any third party dependencies
add_subdirectory(third_party)

# The Learned LSM embedded database library targets
if (LLSM_BUILD_SHARED)
add_library(llsm SHARED)
add_library(pg_llsm SHARED)
# The TreeLine embedded database library targets
if (TL_BUILD_SHARED)
add_library(treeline SHARED)
add_library(pg_treeline SHARED)
else()
add_library(llsm STATIC)
add_library(pg_llsm STATIC)
add_library(treeline STATIC)
add_library(pg_treeline STATIC)
endif()
target_link_libraries(llsm PRIVATE crc32c tbb masstree)
target_link_libraries(pg_llsm PRIVATE crc32c tbb masstree)
target_include_directories(llsm
target_link_libraries(treeline PRIVATE crc32c tbb masstree)
target_link_libraries(pg_treeline PRIVATE crc32c tbb masstree)
target_include_directories(treeline
PUBLIC include
PRIVATE .)
target_include_directories(pg_llsm
target_include_directories(pg_treeline
PUBLIC include
PRIVATE .)

# Add API headers to the target for IDE support
set(llsm_inc include/llsm)
set(llsm_api
${llsm_inc}/db.h
${llsm_inc}/options.h
${llsm_inc}/record_batch.h
${llsm_inc}/slice.h
${llsm_inc}/statistics.h
${llsm_inc}/status.h
set(treeline_inc include/treeline)
set(treeline_api
${treeline_inc}/db.h
${treeline_inc}/options.h
${treeline_inc}/record_batch.h
${treeline_inc}/slice.h
${treeline_inc}/statistics.h
${treeline_inc}/status.h
)
target_sources(llsm PUBLIC ${llsm_api})
set(pg_llsm_api
${llsm_inc}/pg_db.h
${llsm_inc}/pg_options.h
${llsm_inc}/pg_stats.h
${llsm_inc}/slice.h
${llsm_inc}/status.h
target_sources(treeline PUBLIC ${treeline_api})
set(pg_treeline_api
${treeline_inc}/pg_db.h
${treeline_inc}/pg_options.h
${treeline_inc}/pg_stats.h
${treeline_inc}/slice.h
${treeline_inc}/status.h
)
target_sources(pg_llsm PUBLIC ${pg_llsm_api})
target_sources(pg_treeline PUBLIC ${pg_treeline_api})

# Add our sources by traversing the repository
add_subdirectory(alex)
Expand All @@ -63,20 +63,19 @@ add_subdirectory(db)
add_subdirectory(masstree)
add_subdirectory(masstree_wrapper)
add_subdirectory(model)
add_subdirectory(page_grouping)
add_subdirectory(record_cache)
add_subdirectory(tlx)
add_subdirectory(util)
add_subdirectory(wal)

add_subdirectory(page_grouping)

# Build the tests iff requested
if(LLSM_BUILD_TESTS)
if(TL_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()

# Build the benchmarks iff requested
if(LLSM_BUILD_BENCHMARKS)
if(TL_BUILD_BENCHMARKS)
add_subdirectory(bench)
endif()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![](https://github.com/mitdbg/learnedlsm/actions/workflows/ci.yml/badge.svg)

# Learned LSM
# TreeLine
An embedded key-value store for modern SSDs.

## Building from source
Expand Down
2 changes: 1 addition & 1 deletion alex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target_sources(llsm PRIVATE
target_sources(treeline PRIVATE
alex_base.h
alex_fanout_tree.h
alex_map.h
Expand Down
4 changes: 2 additions & 2 deletions art_olc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ set(art_sources
Tree.cpp
Tree.h)

target_sources(llsm PRIVATE ${art_sources})
target_sources(pg_llsm PRIVATE ${art_sources})
target_sources(treeline PRIVATE ${art_sources})
target_sources(pg_treeline PRIVATE ${art_sources})
2 changes: 1 addition & 1 deletion art_olc/Tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ bool Tree::lookupRange(const Key& start, const Key& end, Key& continueKey,

bool Tree::lookupRange(const Key& start, TID result[], std::size_t resultSize,
std::size_t& resultsFound, ThreadInfo& threadEpocheInfo,
std::vector<llsm::RecordCacheEntry>* cache_entries,
std::vector<tl::RecordCacheEntry>* cache_entries,
Key* continueKey,
std::optional<uint64_t> index_locked_already) const {
EpocheGuard epocheGuard(threadEpocheInfo);
Expand Down
2 changes: 1 addition & 1 deletion art_olc/Tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Tree {
bool lookupRange(
const Key& start, TID result[], std::size_t resultLen,
std::size_t& resultCount, ThreadInfo& threadEpocheInfo,
std::vector<llsm::RecordCacheEntry>* cache_entries = nullptr,
std::vector<tl::RecordCacheEntry>* cache_entries = nullptr,
Key* continueKey = nullptr,
std::optional<uint64_t> index_locked_already = std::nullopt) const;

Expand Down
4 changes: 2 additions & 2 deletions azure-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ jobs:
# takes a lot of resources to build.
cmakeArgs: >
-DCMAKE_BUILD_TYPE=${{ parameters.buildType }}
-DLLSM_BUILD_TESTS=ON
-DLLSM_BUILD_BENCHMARKS=OFF
-DTL_BUILD_TESTS=ON
-DTL_BUILD_BENCHMARKS=OFF
..
- bash: make -j
Expand Down
30 changes: 18 additions & 12 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Common utilities used in the LLSM benchmarks.
# Common utilities used in the TreeLine benchmarks.
add_library(bench_common
common/data.cc
common/data.h
Expand All @@ -7,13 +7,13 @@ add_library(bench_common
common/startup.cc
common/startup.h
common/timing.h)
# Any targets linking to `bench_common` will also link to `llsm` and will be
# able to include LLSM internal headers.
target_link_libraries(bench_common PUBLIC llsm)
# Any targets linking to `bench_common` will also link to `treeline` and will be
# able to include TreeLine internal headers.
target_link_libraries(bench_common PUBLIC treeline)
target_include_directories(bench_common PUBLIC ${PROJECT_SOURCE_DIR})

# All `bench_common` utilities plus configuration utilities used in benchmarks
# comparing LLSM against RocksDB.
# comparing TreeLine against RocksDB.
#
# We use this additional library target because not all benchmark executables
# need to link to RocksDB and gflags (e.g., `microbench`).
Expand All @@ -22,25 +22,31 @@ add_library(bench_common_config
common/config.h
common/kvell_interface.h
common/leanstore_interface.h
common/llsm_interface.h
common/pg_llsm_interface.h
common/treeline_interface.h
common/pg_treeline_interface.h
common/rocksdb_interface.h)
target_link_libraries(bench_common_config PUBLIC bench_common gflags rocksdb leanstore pg_llsm libcuckoo)
target_link_libraries(bench_common_config PUBLIC
bench_common
gflags
rocksdb
leanstore
pg_treeline
libcuckoo)

# Synthetic Write: Measure the write throughput when writing synthetic data.
# This benchmark compares the Learned LSM database against RocksDB.
# This benchmark compares TreeLine against RocksDB.
add_executable(synth_write synth_write.cc)
target_link_libraries(synth_write bench_common_config)

# YCSB: Run extracted YCSB workloads against LLSM and RocksDB.
# YCSB: Run extracted YCSB workloads against TreeLine and RocksDB.
add_executable(ycsb ycsb.cc)
target_link_libraries(ycsb bench_common_config ycsbr)

# Hash Table YCSB: Run extracted YCSB workloads against different hash table implementations.
add_executable(hashtable_ycsb hashtable_ycsb.cc)
target_link_libraries(hashtable_ycsb Threads::Threads gflags ycsbr)

# Microbench: An executable containing all of LLSM's microbenchmarks.
# Microbench: An executable containing all of TreeLine's microbenchmarks.
add_executable(microbench
memtable_benchmark.cc
packed_map_benchmark.cc
Expand Down Expand Up @@ -71,7 +77,7 @@ target_link_libraries(wal bench_common gflags benchmark::benchmark)
add_executable(bufmgr_benchmark buffer_manager_benchmark.cc)
target_link_libraries(bufmgr_benchmark bench_common_config gflags ycsbr benchmark::benchmark)

# Run Custom: An executable that runs YSCBR-generated workloads against LLSM
# Run Custom: An executable that runs YSCBR-generated workloads against TreeLine
# and RocksDB.
add_executable(run_custom run_custom.cc)
target_link_libraries(run_custom bench_common_config ycsbr-gen)
5 changes: 2 additions & 3 deletions bench/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Learned LSM Benchmarks
# TreeLine Benchmarks

This directory contains various benchmarks used to evaluate the Learned LSM
database.
This directory contains various benchmarks used to evaluate TreeLine.
18 changes: 9 additions & 9 deletions bench/buffer_manager_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "common/config.h"
#include "db/page.h"
#include "gflags/gflags.h"
#include "llsm/options.h"
#include "treeline/options.h"
#include "ycsbr/ycsbr.h"

namespace {
Expand Down Expand Up @@ -39,18 +39,18 @@ void SimulateBM(benchmark::State& state, bool large_buffer) {
ycsbr::BulkLoadTrace::LoadFromFile(FLAGS_load_path, loptions);

// Create key hints.
llsm::KeyDistHints key_hints;
tl::KeyDistHints key_hints;
key_hints.num_keys = load.size();
key_hints.page_fill_pct = FLAGS_llsm_page_fill_pct;
key_hints.page_fill_pct = FLAGS_tl_page_fill_pct;
key_hints.record_size = record_size;

// Initialize an alex instance.
alex::Alex<uint64_t, llsm::PhysicalPageId> model;
alex::Alex<uint64_t, tl::PhysicalPageId> model;
size_t records_per_page = key_hints.records_per_page();
size_t i = 0;
for (const auto& req : load) {
if (i % records_per_page == 0) {
llsm::PhysicalPageId page_id(0, i / records_per_page);
tl::PhysicalPageId page_id(0, i / records_per_page);
model.insert(__builtin_bswap64(req.key), page_id);
}
++i;
Expand All @@ -65,25 +65,25 @@ void SimulateBM(benchmark::State& state, bool large_buffer) {
ycsbr::Trace::LoadFromFile(FLAGS_workload_path, woptions);

// Pre-calculate page numbers appropriately
std::vector<llsm::PhysicalPageId> page_ids;
std::vector<tl::PhysicalPageId> page_ids;
for (const auto& req : workload) {
page_ids.push_back(
*model.get_payload_last_no_greater_than(__builtin_bswap64(req.key)));
}

// Create buffer manager options.
llsm::BufMgrOptions bm_options;
tl::BufMgrOptions bm_options;
bm_options.simulation_mode = true;
bm_options.buffer_pool_size = large_buffer
? model.size() * llsm::Page::kSize
? model.size() * tl::Page::kSize
: 64 * 1024 * 1024;

// Bookkeeping
std::string db_path = "test";
double numIOs = 0;

for (auto _ : state) {
llsm::BufferManager buf_mgr(bm_options, db_path);
tl::BufferManager buf_mgr(bm_options, db_path);
for (const auto& page_id : page_ids) {
auto& bf = buf_mgr.FixPage(page_id, /*exclusive = */ true);
if (bf.IsNewlyFixed()) ++numIOs;
Expand Down
Loading

0 comments on commit bf899bd

Please sign in to comment.