Commit Graph

17 Commits

Author SHA1 Message Date
Chad Austin
49385c8a07 store: namespace facebook::eden
Summary: C++17

Reviewed By: fanzeyi

Differential Revision: D28966939

fbshipit-source-id: c8c9d49bc02557263a6acf9357c90b50e04fbdb9
2021-06-08 19:29:37 -07:00
Zeyi (Rice) Fan
6162023789 sqlite: split Sqlite.h
Summary: This diff splits Sqlite.h into smaller files so it's easier to change.

Reviewed By: xavierd

Differential Revision: D26656315

fbshipit-source-id: 8156b1d8feef47e5bad4ab66ad5f5f96cf32547e
2021-03-15 12:01:47 -07:00
Chad Austin
432e051423 include more error message context when a LocalStore lookup misses
Summary:
"value not present in store" is an unhelpful error message once
serialized through Thrift etc. Provide more useful context when a key
is missing.

Reviewed By: fanzeyi

Differential Revision: D26678102

fbshipit-source-id: 514ac2fe580d1dd7c67fc20c89b75e5d8121c329
2021-02-26 00:28:46 -08:00
Chad Austin
e5e9d8cf69 clear the deprecated blobsize keyspace at startup
Summary:
EdenFS no longer uses the blobsize keyspace. To avoid wasting space,
clear and campact it on startup, along with any keyspaces we
deprecated in the future.

Reviewed By: fanzeyi

Differential Revision: D19354881

fbshipit-source-id: 5285757a0e44ab1080c5f940283e06b17bec811d
2020-01-21 10:33:11 -08:00
Chad Austin
d23773e9b0 restructure KeySpace and move it into KeySpace.h
Summary: Simplify the definition and use of KeySpace and move it into its own header.

Reviewed By: simpkins

Differential Revision: D19353441

fbshipit-source-id: ef07677d927a48839b709711388abeb3c1ed9679
2020-01-21 10:33:10 -08:00
Chad Austin
8cac2bfe6a Remove dead includes in eden
Reviewed By: wez

Differential Revision: D17877514

fbshipit-source-id: e7f8ed8364bdb7a77f293cbdf4b48e8f15e64c30
2019-10-11 16:45:01 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -07:00
Adam Simpkins
59ff8f90b5 remove the config parameter from LocalStore
Summary:
The `LocalStore` constructor was updated to accept a `ReloadableConfig`
argument in D12949577, but this was never used anywhere.  Remove it for now to
help simplify the code.  If we do want to add it back in the future I think we
should make it required, rather than allowing a null config to be specified.

Reviewed By: wez

Differential Revision: D15350217

fbshipit-source-id: 8571b48dff8c8d079ba6b25821dd0b1d77ffe791
2019-05-15 12:19:20 -07:00
Adam Simpkins
ec2fbbf595 add a name field to LocalStore::KeySpaceRecord
Summary:
Add a `name` field to KeySpaceRecord.  This allows the `RocksDbLocalStore` and
`SqliteLocalStore` code to use the name from the `kKeySpaceRecords` data
structure rather than keeping their own array of names that must be maintained
in sync with the `LocalStore` code.

Reviewed By: wez

Differential Revision: D15307390

fbshipit-source-id: b53bca7d53d630f9527a810f145380288c54198e
2019-05-15 12:19:20 -07:00
Adam Simpkins
b13f498ab2 re-number the KeySpace IDs to be 0-indexed
Summary:
Update the KeySpace enum values to start at 0 instead of 1.  This simplifies
the code to avoid having to skip over 0 in a few places.

This also makes the `kKeySpaceRecords` array slightly less confusing.  Unlike
the `columns` array used by `RocksDbLocalStore` and the `tableNames` array
used by `SqliteLocalStore`, the `kKeySpaceRecords` array was not previously
indexed by the `KeySpace` enum values.

Reviewed By: wez, strager

Differential Revision: D15307393

fbshipit-source-id: ae8392d02396b4dc3c18e9ee94b198fcbb9b1a34
2019-05-15 12:19:19 -07:00
Wez Furlong
0d3f197803 pass ReloadableConfig through to LocalStore
Summary:
This makes it possible to change configuration options
for the LocalStore while the server is running.

As you'll see in the next diff, our current layering makes using
the config a bit more awkward, but at least this diff doesn't
look gross :-p

This diff doesn't introduce any new functionality or configuration.

Reviewed By: strager

Differential Revision: D12949577

fbshipit-source-id: cf897ba676b9359f92865170faa42ff17329b85f
2018-11-09 11:22:03 -08:00
Chad Austin
fae4229ff2 add eden gc command
Summary:
Add the beginnings of an eden gc command. Today it's equivalent to
`eden debug clear_local_caches` followed by `eden
debug_compact_local_storage`, except that it compacts each column as
they're cleared to minimize peak disk consumption.

Eventually, it will also unload in-memory inodes, flush data from the
overlay, and clear the kernel's VFS cache too.

Reviewed By: wez

Differential Revision: D9138305

fbshipit-source-id: b303a63f601014cf38ca94c9e6f7c04394159ea8
2018-08-10 11:38:20 -07:00
Chad Austin
0e9cc052c8 add compact_local_storage debug command to cli
Summary: Add a debug command to compact the LocalStore's RocksDB.

Reviewed By: bolinfest

Differential Revision: D8108686

fbshipit-source-id: 116a74d4bd70442a4c60e45d551afa60674f121d
2018-05-31 11:23:21 -07:00
Chad Austin
a4959ad72e add clearKeySpace method to LocalStore
Summary:
Add a clearCaches function to LocalStore that deletes all data from
LocalStore that could be retrieved from Mercurial.

Reviewed By: wez

Differential Revision: D8101365

fbshipit-source-id: d46d0db94e6f85aaf542d9f6b9b96fbdcc548b57
2018-05-31 11:23:21 -07:00
Adam Simpkins
8e3c09a99a move folly/experimental/logging to folly/logging/
Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
2018-04-30 21:29:29 -07:00
Wez Furlong
eaeaf8f23c add SqliteLocalStore
Summary:
Adds a SQLite storage implementation and makes it the
default engine for integration tests; this requires fewer resources
to run and the integration tests thus run faster and more reliably.

In the future we may add a configuration option to remember the
storage engine that was used as it is currently not "safe" to switch
from one to the other because the hgproxyhash data cannot be
recreated without re-importing a revision.

Reviewed By: simpkins

Differential Revision: D6919456

fbshipit-source-id: 3afbfafb190cca0e3c797cd9b7cd051768575a8c
2018-02-08 20:06:55 -08:00