Skip to content

Meta rebase #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2,159 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2159 commits
Select commit Hold shift + click to select a range
2d00d87
Updating submodules
Jul 22, 2022
f6fa617
Updating submodules
Jul 22, 2022
9754496
Updating submodules
Jul 23, 2022
b057124
Updating submodules
Jul 23, 2022
eddbde1
Updating submodules
Jul 23, 2022
112a059
Updating submodules
Jul 24, 2022
c533664
Updating submodules
Jul 24, 2022
6fde167
Deprecate ItemHandle
jiayuebao Jul 25, 2022
b55cb24
Updating submodules
Jul 26, 2022
ad8e718
Updating submodules
Jul 26, 2022
8fe6332
Updating submodules
Jul 26, 2022
b5d7c4e
Updating submodules
Jul 26, 2022
f018c86
Updating submodules
Jul 26, 2022
371611a
Updating submodules
Jul 26, 2022
84d9cbb
Updating submodules
Jul 26, 2022
3826474
Updating submodules
Jul 26, 2022
7dc5db7
Updating submodules
Jul 26, 2022
1b1efaf
Updating submodules
Jul 26, 2022
5fd702d
Updating submodules
Jul 26, 2022
9a2291e
Updating submodules
Jul 26, 2022
0ea6364
Updating submodules
Jul 26, 2022
eb09228
Updating submodules
Jul 26, 2022
e5ce298
Updating submodules
Jul 26, 2022
daf2f98
Updating submodules
Jul 26, 2022
02bcd69
Updating submodules
Jul 26, 2022
af66133
Updating submodules
Jul 27, 2022
1653d55
Updating submodules
Jul 27, 2022
ee6a029
Updating submodules
Jul 27, 2022
45410de
Updating submodules
Jul 27, 2022
b9ad44c
Updating submodules
Jul 27, 2022
bb8d44f
Updating submodules
Jul 27, 2022
2bd8bc0
Updating submodules
Jul 27, 2022
5ecba5a
update staticdocs
antonk52 Jul 27, 2022
a6aab6f
Remove ::{self}
stepancheg Jul 27, 2022
5769aa4
Updating submodules
Jul 27, 2022
36b966f
Updating submodules
Jul 27, 2022
a9da2b6
Updating submodules
Jul 27, 2022
4ad4ac2
Updating submodules
Jul 27, 2022
2c8c289
Updating submodules
Jul 27, 2022
9ee18a6
Updating submodules
Jul 27, 2022
783f604
Updating submodules
Jul 27, 2022
d919f60
Updating submodules
Jul 27, 2022
c8aeb12
Updating submodules
Jul 28, 2022
028799e
Updating submodules
Jul 28, 2022
4712e53
Updating submodules
Jul 28, 2022
709ae25
Updating submodules
Jul 28, 2022
19b2de9
Updating submodules
Jul 28, 2022
12bc833
Updating submodules
Jul 28, 2022
fa8e0d1
reduce logging frequency
moakbari Jul 28, 2022
27382b3
Updating submodules
Jul 28, 2022
7c6b43d
Updating submodules
Jul 28, 2022
d4e1553
Updating submodules
Jul 28, 2022
12aef9a
Updating submodules
Jul 28, 2022
d102b74
Updating submodules
Jul 28, 2022
97147a2
Updating submodules
Jul 28, 2022
09b87a1
Updating submodules
Jul 28, 2022
a3edf90
Throw if there is a type mismatch in creating JSON config
Jul 28, 2022
8c0d697
Updating submodules
Jul 28, 2022
bf7d5e8
Updating submodules
Jul 29, 2022
fc14ca6
Updating submodules
Jul 29, 2022
6fb2cea
Updating submodules
Jul 29, 2022
a3b0c02
Updating submodules
Jul 29, 2022
93859c3
Updating submodules
Jul 29, 2022
bf88a78
Updating submodules
Jul 29, 2022
a71ffd0
Updating submodules
Jul 29, 2022
d499b1d
Updating submodules
Jul 29, 2022
1fe4c14
Updating submodules
Jul 29, 2022
99f6b27
Updating submodules
Jul 29, 2022
3663c22
Updating submodules
Jul 29, 2022
6f5872d
Updating submodules
Jul 29, 2022
04879bc
Updating submodules
Jul 29, 2022
7f3bfbb
Updating submodules
Jul 29, 2022
f97b421
Updating submodules
Jul 29, 2022
4a2a5a1
Updating submodules
Jul 29, 2022
449b7c2
Updating submodules
Jul 29, 2022
dcc1f39
Updating submodules
Jul 29, 2022
f53f152
Updating submodules
Jul 29, 2022
921aff2
Updating submodules
Jul 30, 2022
9375012
Updating submodules
Jul 30, 2022
8688402
Updating submodules
Jul 30, 2022
48b8b29
Updating submodules
Jul 30, 2022
fd1945f
Updating submodules
Jul 30, 2022
7b7aa0a
Updating submodules
Jul 31, 2022
bf48dad
Updating submodules
Jul 31, 2022
54f098f
Updating submodules
Aug 1, 2022
c580fdd
Updating submodules
Aug 1, 2022
a8ef988
Updating submodules
Aug 1, 2022
2e0e5fe
Updating submodules
Aug 1, 2022
f9489bd
Report the timestamp when the cache is warmed up.
tang-jianfeng Aug 1, 2022
c0f9467
Updating submodules
Aug 1, 2022
d54908b
Updating submodules
Aug 1, 2022
5902f80
Updating submodules
Aug 1, 2022
68e747b
Updating submodules
Aug 1, 2022
025ec39
Updating submodules
Aug 1, 2022
8dd9bbb
Updating submodules
Aug 1, 2022
f452a6a
Updating submodules
Aug 2, 2022
061650e
Updating submodules
Aug 2, 2022
aeb3a1e
Updating submodules
Aug 2, 2022
e0ad84a
Updating submodules
Aug 2, 2022
9f8ca7f
Updating submodules
Aug 2, 2022
1e40e7e
Updating submodules
Aug 2, 2022
c4b44a9
Updating submodules
Aug 2, 2022
ceb36b5
Updating submodules
Aug 2, 2022
a182d07
Updating submodules
Aug 2, 2022
b7653e8
Updating submodules
Aug 2, 2022
07f0838
Updating submodules
Aug 2, 2022
195bcc4
Updating submodules
Aug 2, 2022
0d70ec4
Updating submodules
Aug 2, 2022
ebe94c0
Updating submodules
Aug 2, 2022
94d718f
Updating submodules
Aug 2, 2022
b184a01
Updating submodules
Aug 2, 2022
9f9872c
Updating submodules
Aug 3, 2022
4f8f7ed
Updating submodules
Aug 3, 2022
3dd4851
Updating submodules
Aug 3, 2022
526f9be
Updating submodules
Aug 3, 2022
119f779
Updating submodules
Aug 3, 2022
cae5b8d
Updating submodules
Aug 3, 2022
2859760
Updating submodules
Aug 3, 2022
2e51068
Updating submodules
Aug 3, 2022
51c6553
Updating submodules
Aug 3, 2022
b6650d9
Check remove status in navy/driver/Driver.cpp
Aug 3, 2022
0b76247
Updating submodules
Aug 3, 2022
7c6f792
Updating submodules
Aug 3, 2022
1bf9d17
Updating submodules
Aug 3, 2022
4649d0b
Edit Read_data_from_cache.md using inpage editor
therealgymmy Aug 4, 2022
1cbd9ac
Make MemRss test more robust
therealgymmy Aug 4, 2022
78faa0b
Updating submodules
Aug 4, 2022
5fda1b9
Updating submodules
Aug 4, 2022
a879b88
Updating submodules
Aug 4, 2022
902fdd9
Updating submodules
Aug 4, 2022
26b4bf1
Updating submodules
Aug 4, 2022
d933ecf
Updating submodules
Aug 4, 2022
f484460
Updating submodules
Aug 4, 2022
7627f45
Updating submodules
Aug 4, 2022
fc197ba
Updating submodules
Aug 4, 2022
42374c7
Updating submodules
Aug 4, 2022
23d08fb
Updating submodules
Aug 4, 2022
68913d6
Updating submodules
Aug 4, 2022
0c82dfc
Updating submodules
Aug 4, 2022
7b4be2b
Updating submodules
Aug 4, 2022
20cc0e2
Add cache hit info in piecewise replay trace
tang-jianfeng Aug 4, 2022
d937cab
Updating submodules
Aug 4, 2022
edaf498
Updating submodules
Aug 5, 2022
36cf71a
Updating submodules
Aug 5, 2022
b966940
Updating submodules
Aug 5, 2022
adda5b6
Updating submodules
Aug 5, 2022
e7c3b78
Updating submodules
Aug 5, 2022
bd6a465
Updating submodules
Aug 5, 2022
1922a4b
Updating submodules
Aug 5, 2022
a7cd456
Updating submodules
Aug 5, 2022
b460c88
Updating submodules
Aug 5, 2022
e443ab7
Updating submodules
Aug 5, 2022
16a401e
Updating submodules
Aug 5, 2022
541fba2
Updating submodules
Aug 5, 2022
cd8a3f7
Updating submodules
Aug 5, 2022
98404c1
Updating submodules
Aug 5, 2022
9154a94
Updating submodules
Aug 5, 2022
c359b01
Updating submodules
Aug 5, 2022
bc0beb1
Updating submodules
Aug 5, 2022
43bef81
Updating submodules
Aug 6, 2022
ddb975b
Updating submodules
Aug 6, 2022
6ad8c87
Updating submodules
Aug 6, 2022
02e0bf8
Updating submodules
Aug 6, 2022
bc04390
Updating submodules
Aug 6, 2022
f764580
Updating submodules
Aug 6, 2022
eba5270
Add support for non x86_64 platforms
dmm-fb Aug 6, 2022
b353430
Updating submodules
Aug 6, 2022
b6bbd1d
Apply rustfmt
stepancheg Aug 6, 2022
00bd1ac
Updating submodules
Aug 6, 2022
b62b2d5
Updating submodules
Aug 6, 2022
1eb9929
Updating submodules
Aug 7, 2022
f69474c
Updating submodules
Aug 8, 2022
3fdaf8b
Updating submodules
Aug 8, 2022
5fe8b8d
Updating submodules
Aug 8, 2022
e622ec8
Updating submodules
Aug 8, 2022
c9de927
Updating submodules
Aug 8, 2022
530e13e
Updating submodules
Aug 8, 2022
d4b6cf3
Updating submodules
Aug 8, 2022
98977cd
Updating submodules
Aug 8, 2022
dd47d1a
Updating submodules
Aug 8, 2022
e80d7cf
Updating submodules
Aug 8, 2022
83160e3
Updating submodules
Aug 8, 2022
7a02169
Updating submodules
Aug 9, 2022
18725fb
Updating submodules
Aug 9, 2022
120a1fb
Updating submodules
Aug 9, 2022
593b1a0
Updating submodules
Aug 9, 2022
6eaa568
Updating submodules
Aug 9, 2022
3e62f4b
Updating submodules
Aug 9, 2022
e2df8d6
Updating submodules
Aug 9, 2022
6c12e29
Updating submodules
Aug 9, 2022
cc4450f
Updating submodules
Aug 9, 2022
3aa987a
Updating submodules
Aug 9, 2022
454cf90
Updating submodules
Aug 9, 2022
53560c3
Updating submodules
Aug 9, 2022
d97b863
Updating submodules
Aug 9, 2022
428d07b
Updating submodules
Aug 9, 2022
638001a
Updating submodules
Aug 9, 2022
6c479a3
Updating submodules
Aug 9, 2022
2db208b
Updating submodules
Aug 9, 2022
46a92b1
Run centos and debian workflows on push and PR
igchor Nov 2, 2021
3038c87
Introduce FileShmSegment for file-backed shared memory
igchor Oct 20, 2021
2d0f684
Adjust and enable tests for ShmFileSegment
igchor Oct 16, 2021
1b909e6
Add support for shm opts serialization
guptask Oct 27, 2021
42fad78
Initial version of config API extension to support multiple memory tiers
victoria-mcgrath Oct 28, 2021
7f4e9fb
Integrate Memory Tier config API with CacheAllocator.
igchor Oct 30, 2021
31590b3
Add MemoryTierCacheConfig::fromShm()
igchor Nov 6, 2021
b90dca7
Fix test_shm_manager.cpp test
igchor Nov 9, 2021
8a094e5
Run tests on CI
igchor Nov 5, 2021
e4a217c
Run long tests (navy/bench) every day on CI
igchor Nov 16, 2021
15d2d14
Moved common segment code for posix and file shm segments into ShmCommon
guptask Nov 7, 2021
efd80d1
Enabled memory tier config API for cachebench.
victoria-mcgrath Nov 18, 2021
57cc508
Enabled shared memory tier in cachebench.
victoria-mcgrath Nov 23, 2021
97a488c
Converted nvmCacheState_ to std::optional to simplify NVM cache state…
victoria-mcgrath Nov 29, 2021
fd475f0
Run CI on prebuild docker image
igchor Dec 15, 2021
0a624b0
Run only centos build on CI
igchor Dec 15, 2021
edd482d
Initial multi-tier support implementation
igchor Sep 28, 2021
0c1e91d
Extend CompressedPtr to work with multiple tiers
igchor Dec 11, 2021
0bc1b0d
Implemented async Item movement between tiers
vinser52 Dec 18, 2021
7149b0e
Adding example for multitiered cache
vinser52 Dec 9, 2021
795cb96
Enable workarounds in tests
igchor Dec 24, 2021
2682386
Add basic multi-tier test
igchor Dec 30, 2021
84680f4
Set correct size for each memory tier
igchor Dec 30, 2021
43acca6
Extend cachbench with value validation
igchor Jan 19, 2022
dbd9d99
Aadding new configs to hit_ratio/graph_cache_leader_fobj
vinser52 Jan 27, 2022
651bc62
Move validateValue call to make sure it is measured by latency tracker
igchor Jan 28, 2022
f26b698
Fix eviction flow and removeCb calls
vinser52 Feb 3, 2022
377c297
Remove failing build-cachelib workflow (#42)
igchor Feb 7, 2022
f4dab50
Disabled test suite allocator-test-AllocatorTypeTest (#41)
victoria-mcgrath Feb 7, 2022
334ecc9
Do not compensate for rounding error when calculating tier sizes (#43)
igchor Feb 8, 2022
45404ea
Fixed total cache size in CacheMemoryStats (#38)
victoria-mcgrath Feb 8, 2022
2bc7d71
Fix tests and benchmarks compilation
igchor Feb 9, 2022
c080de9
Update docker file used in CI
igchor Feb 14, 2022
69af5da
Disable failing clang-format-check
igchor Feb 14, 2022
07620ee
Add one more navy test to BLACKLIST
igchor Feb 15, 2022
6ba58bb
Fix issue with "Destorying an unresolved handle"
vinser52 Feb 17, 2022
2a88bf2
Add extra param to build-package.sh
igchor Apr 8, 2022
ae22ab9
Add scripts for rebuilding/pushing docker images
igchor Apr 8, 2022
a817276
Extend CI to rebuild docker automatically
igchor Apr 8, 2022
0e6512a
Update build-cachelib-docker.yml
igchor Apr 27, 2022
f2ff924
Added required packages to install Intel ittapi
mcengija Apr 26, 2022
ab25b3c
Fix slab release code
igchor Jun 10, 2022
d98757a
Shorten critical section in findEviction
igchor Apr 12, 2022
fc768e8
critical section inside combined_lock
igchor Jun 13, 2022
63a432f
Extend cachbench with touch value
igchor May 4, 2022
f1a2071
Enable touchValue by default
igchor Jun 15, 2022
ef4799b
Issue75 rebased (#88)
igchor Jul 5, 2022
a5fbe7a
Add memory usage statistics for slabs and allocation classes
igchor Jul 6, 2022
c6bcd9b
Add option to print memory stats in bytes only
igchor Jul 12, 2022
c9c417c
added per tier pool class rolling average latency
guptask Jul 21, 2022
5972494
MM2Q promotion iterators (#1)
byrnedj Aug 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: build-cachelib-centos-latest
on:
schedule:
- cron: '30 5 * * 1,4'
- cron: '0 7 * * *'

jobs:
build-cachelib-centos8-latest:
name: "CentOS/latest - Build CacheLib with all dependencies"
Expand Down Expand Up @@ -33,3 +34,6 @@ jobs:
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh long
6 changes: 5 additions & 1 deletion .github/workflows/build-cachelib-debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: build-cachelib-debian-10
on:
schedule:
- cron: '30 5 * * 2,6'
- cron: '30 5 * * 0,3'

jobs:
build-cachelib-debian-10:
name: "Debian/Buster - Build CacheLib with all dependencies"
Expand Down Expand Up @@ -37,3 +38,6 @@ jobs:
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh
49 changes: 49 additions & 0 deletions .github/workflows/build-cachelib-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build-cachelib-docker
on:
push:
pull_request:

jobs:
build-cachelib-docker:
name: "CentOS/latest - Build CacheLib with all dependencies"
runs-on: ubuntu-latest
env:
REPO: cachelib
GITHUB_REPO: pmem/CacheLib
CONTAINER_REG: ghcr.io/pmem/cachelib
CONTAINER_REG_USER: ${{ secrets.GH_CR_USER }}
CONTAINER_REG_PASS: ${{ secrets.GH_CR_PAT }}
FORCE_IMAGE_ACTION: ${{ secrets.FORCE_IMAGE_ACTION }}
HOST_WORKDIR: ${{ github.workspace }}
WORKDIR: docker
IMG_VER: devel
strategy:
matrix:
CONFIG: ["OS=centos OS_VER=8streams PUSH_IMAGE=1"]
steps:
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === df -hl ===
df -hl
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1
echo === env ===
env
echo === gcc -v ===
gcc -v
- name: "checkout sources"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Pull the image or rebuild and push it
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh $FORCE_IMAGE_ACTION

- name: Run the build
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
147 changes: 0 additions & 147 deletions .github/workflows/build-cachelib.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From: https://github.com/marketplace/actions/clang-format-check#multiple-paths
name: clang-format Check
on: [pull_request]
on: []
jobs:
formatting-check:
name: Formatting Check
Expand All @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v3.4.0
uses: jidicula/clang-format-action@v4.6.2
with:
clang-format-version: '11'
clang-format-version: '13'
check-path: ${{ matrix.path }}
25 changes: 25 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration

specfile_path: cachelib.spec

upstream_package_name: CacheLib
downstream_package_name: cachelib

actions:
fix-spec-file:
- bash -c "sed -i cachelib.spec -e \"s/%global commit.*/%global commit $(git rev-parse HEAD)/\""
- bash -c "sed -i cachelib.spec -e \"s/%global date.*/%global date $(git show -s --date=format:'%Y%m%d' --format=%cd)/\""
create-archive:
- bash -c "COMMIT=$(git rev-parse HEAD); curl -ORL https://github.com/facebook/CacheLib/archive/${COMMIT}/cachelib-${COMMIT}.tar.gz; echo cachelib-${COMMIT}.tar.gz"
post-upstream-clone: "bash -c \"rm -rf cachelib-dist-git; git clone -b packit https://pagure.io/meta/cachelib.git cachelib-dist-git && mv cachelib-dist-git/cachelib*.{spec,patch} .\""

jobs:
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-rawhide-aarch64
- fedora-rawhide-x86_64
- fedora-35-aarch64
- fedora-35-x86_64
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## V17
In this version, `CacheAllocator::ItemHandle` is removed. Updating to this version will cause compilation error if `ItemHandle` is still used.

## V16

This version is incompatible with versions below 15. Downgrading from this version directly to a version below 15 will require the cache to be dropped. If you need to downgrade from this version, please make sure you downgrade to version 15 first to avoid dropping the cache.
Expand All @@ -8,7 +11,7 @@ This version is incompatible with versions below 15. Downgrading from this versi

This version is incompatible with any previous versions.

Updating to this version may cause compliation error because:
Updating to this version may cause compilation error because:
- The following APIs are removed:
1. CacheAllocator::allocatePermanent_deprecated.

Expand Down
2 changes: 1 addition & 1 deletion cachelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.

cmake_minimum_required (VERSION 3.19)
cmake_minimum_required (VERSION 3.12)

## TODO: get version from variable
project (CacheLib VERSION 0.1)
Expand Down
8 changes: 4 additions & 4 deletions cachelib/allocator/CCacheAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ CCacheAllocator::CCacheAllocator(MemoryAllocator& allocator, PoolId poolId)
CCacheAllocator::CCacheAllocator(MemoryAllocator& allocator,
PoolId poolId,
const SerializationType& object)
: CCacheAllocatorBase(*object.ccMetadata_ref()),
: CCacheAllocatorBase(*object.ccMetadata()),
allocator_(allocator),
poolId_(poolId),
currentChunksIndex_(0) {
auto& currentChunks = chunks_[currentChunksIndex_];
for (auto chunk : *object.chunks_ref()) {
for (auto chunk : *object.chunks()) {
currentChunks.push_back(allocator_.unCompress(CompressedPtr(chunk)));
}
}
Expand Down Expand Up @@ -93,11 +93,11 @@ size_t CCacheAllocator::resize() {

CCacheAllocator::SerializationType CCacheAllocator::saveState() {
CCacheAllocator::SerializationType object;
*object.ccMetadata_ref() = ccType_.saveState();
*object.ccMetadata() = ccType_.saveState();

std::lock_guard<std::mutex> guard(resizeLock_);
for (auto chunk : getCurrentChunks()) {
object.chunks_ref()->push_back(allocator_.compress(chunk).saveState());
object.chunks()->push_back(allocator_.compress(chunk).saveState());
}
return object;
}
Expand Down
5 changes: 2 additions & 3 deletions cachelib/allocator/CCacheManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CCacheManager::CCacheManager(const SerializationType& object,
: memoryAllocator_(memoryAllocator) {
std::lock_guard<std::mutex> guard(lock_);

for (const auto& allocator : *object.allocators_ref()) {
for (const auto& allocator : *object.allocators()) {
auto id = memoryAllocator_.getPoolId(allocator.first);
allocators_.emplace(
std::piecewise_construct,
Expand Down Expand Up @@ -81,8 +81,7 @@ CCacheManager::SerializationType CCacheManager::saveState() {

SerializationType object;
for (auto& allocator : allocators_) {
object.allocators_ref()->emplace(allocator.first,
allocator.second.saveState());
object.allocators()->emplace(allocator.first, allocator.second.saveState());
}
return object;
}
Expand Down
7 changes: 6 additions & 1 deletion cachelib/allocator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ install(TARGETS cachelib_allocator
DESTINATION ${LIB_INSTALL_DIR} )

if (BUILD_TESTS)
add_library (allocator_test_support
add_library (allocator_test_support OBJECT
${DATASTRUCT_TESTS_THRIFT_FILES}
./nvmcache/tests/NvmTestBase.cpp
./memory/tests/TestBase.cpp
../common/TestUtils.cpp
)
add_dependencies(allocator_test_support thrift_generated_files)
target_link_libraries (allocator_test_support PUBLIC
cachelib_allocator
common_test_utils
glog::glog
gflags
GTest::gtest
Expand Down Expand Up @@ -116,8 +118,11 @@ if (BUILD_TESTS)
add_test (tests/ChainedHashTest.cpp)
add_test (tests/AllocatorResizeTypeTest.cpp)
add_test (tests/AllocatorHitStatsTypeTest.cpp)
add_test (tests/AllocatorMemoryTiersTest.cpp)
add_test (tests/MemoryTiersTest.cpp)
add_test (tests/MultiAllocatorTest.cpp)
add_test (tests/NvmAdmissionPolicyTest.cpp)
add_test (tests/CacheAllocatorConfigTest.cpp)
add_test (nvmcache/tests/NvmItemTests.cpp)
add_test (nvmcache/tests/InFlightPutsTest.cpp)
add_test (nvmcache/tests/TombStoneTests.cpp)
Expand Down
6 changes: 6 additions & 0 deletions cachelib/allocator/Cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
namespace facebook {
namespace cachelib {

CacheBase::CacheBase(unsigned numTiers): numTiers_(numTiers) {}

unsigned CacheBase::getNumTiers() const {
return numTiers_;
}

void CacheBase::setRebalanceStrategy(
PoolId pid, std::shared_ptr<RebalanceStrategy> strategy) {
std::unique_lock<std::mutex> l(lock_);
Expand Down
Loading