Summary: Used when the IdMap is lazy to fetch missing locations.
Reviewed By: quark-zju
Differential Revision: D26131617
fbshipit-source-id: cde0232b16afb961d9c9a18899ca78bd644f1b6b
Summary:
I think that it makes sense to standardize on importing:
`dag_types::Id` rather than `dag::Id` now that this is a crate of its own.
I am not sure about re-exporting `minibytes::Bytes` but it makes sense to me.
Reviewed By: quark-zju
Differential Revision: D26131616
fbshipit-source-id: fefd0334cf188f247b1541be16421967e8340546
Summary:
Wire types has it's own meaning in Edenapi. I don't see it necessary to
add the wire qualifier to this crate and overload the term.
Reviewed By: quark-zju
Differential Revision: D26129827
fbshipit-source-id: eea66eef2db609611d8ffa215ba63ae4f0b669c8
Summary:
Introduce `FallbackStore`, a newstore combinator which implements the `ReadStore` trait and first checks a "preferred" store for the provided keys, before falling back to a "fallback" store. The combinator requires that both stores share the same `Key` type, but allows a user provided "value adapter function" to convert from the fallback store's value type to the preferred store's value type.
Currently `FallbackStore` does not support writing missing values to the preferred store - this functionality will be introduced in a future change.
Reviewed By: DurhamG
Differential Revision: D26203146
fbshipit-source-id: 0e99110f93130ff30c95cce15e3dc7873616519c
Summary: Introduce a new stream combinator, `select_drop`, based on `futures::stream::select`, which performs the same function except dropping the contained streams when they terminate, rather than when the combined stream is exhausted. This prevents a deadlock in cases where one stream will not terminate until the other terminates.
Reviewed By: DurhamG
Differential Revision: D26139816
fbshipit-source-id: d28da32244a215741476e1c3882154ea9e3116a5
Summary: Introduce a minimal version of an async, typed `ReadStore` trait and corresponding `EdenApi` implementation, along with a debug command, `debugnewstore` to exercise it.
Reviewed By: DurhamG
Differential Revision: D26050641
fbshipit-source-id: 2c14c3715e7067f9ecd1e649e6ca146a1ce249bf
Summary:
Make it possible to convert Bytes to `Vec<u8>` in a zero-copy way if possible.
This will make it possible to convert `minibytes::Bytes` to `bytes::Bytes` in a
zero-copy way if possible. Practically, it might be useful for some
revisionstore -> edenapi/types usecases.
Reviewed By: kulshrax
Differential Revision: D26237922
fbshipit-source-id: 28d620f303511099df77f79256d98abb1010f665
Summary: This API will be used in the next diff.
Reviewed By: DurhamG
Differential Revision: D26237923
fbshipit-source-id: 69438072c2edef1ce28ceef3b8b723f015f54ff5
Summary: Provide a way to slice a set.
Reviewed By: sfilipco
Differential Revision: D26203562
fbshipit-source-id: 97a4349833a7a1c9664189d4737e2ad418369f22
Summary:
The SliceSet provides slicing support (skip n items, and then take m items)
for a general NameSet. The complexities come from caching and fast paths.
Basically, we cache the skipped items as a way to answer "contains" quickly.
We also cache the "taken" items if it's bounded to answer "iter_rev",
"contains".
Reviewed By: sfilipco
Differential Revision: D26203559
fbshipit-source-id: 6078b6178aff878e2169e87d446f0b254432aa80
Summary:
In the future we'd like to test "contains" but only use the "contains"
code path if it's better than O(N). Currently there is no way to know
whether "contains" is O(N) or not. Add an explicit API for that.
Reviewed By: sfilipco
Differential Revision: D26203554
fbshipit-source-id: 5d4c6014694c45b666a0ecd83fce33157cc15779
Summary: Enhance the test so it checks hints set by the `filter` function.
Reviewed By: sfilipco
Differential Revision: D26203553
fbshipit-source-id: b9bf5baa3bf51434835341e95e72073bd8c4256a
Summary:
It is incorrect with >= 2 hints.
For example,
iter: [hints1, hints2, hints1]
fold acc: hints1, None, hints1
The `None` should be permanent if there are two versions that do not have an
order.
Reviewed By: sfilipco
Differential Revision: D26203555
fbshipit-source-id: 96ff30ba45d439220519cd1505e3264118ffd9b2
Summary:
Previously, `LazySet` was constructed with default `Hints`. That disables fast
paths. Revise the API so LazySet requires an explicit `Hints` to address the
issue.
Reviewed By: sfilipco
Differential Revision: D26203561
fbshipit-source-id: c92cd1f7eb7b40ffaaf53abcf05e64f3d41b906d
Summary:
Previously, `MetaSet` was constructed with default `Hints`. That disables fast
paths. Revise the API so MetaSet requires an explicit `Hints` to address the
issue.
Reviewed By: sfilipco
Differential Revision: D26203557
fbshipit-source-id: 9e7658af8723b06d0efdcad1ab4671c79e907326
Summary: Those methods will be used for fast paths slicing a NameSet.
Reviewed By: sfilipco
Differential Revision: D26203556
fbshipit-source-id: aef18f60633653e19571e3fdeeb6b258e4dd32c7
Summary:
This just renames types so `IdSet` is the recommended name and `SpanSet`
remains an implementation detail.
Reviewed By: sfilipco
Differential Revision: D26203560
fbshipit-source-id: 7ca0262f3ad6d874363c73445f40f8c5bf3dc40e
Summary: This exposes the segments version of the algorithm.
Reviewed By: sfilipco
Differential Revision: D26182244
fbshipit-source-id: 716e6d5254c9962618040e7549c2804184230a97
Summary: This will be used by NameDag.
Reviewed By: sfilipco
Differential Revision: D26182243
fbshipit-source-id: 9db2ecde98281dc45fcfd0d7cf30d6c7bf2be81d
Summary:
This will be useful to optimize `_firstancestors` revset, which is useful to
calculate a linear branch to draw growth graphs. Without a fast path, the pure
Python `_firstancestors` implementation would have id <-> name translation
overhead that makes Rust changelog O(20) slower than the Python revlog.
Reviewed By: sfilipco
Differential Revision: D26182240
fbshipit-source-id: d44f5ca5dc8c38df74281832931d87868791209e
Summary:
Optimize the `x~n` revset function using Rust.
Note: This changes the behavior a bit, `x~n` no longer returns `null`.
Reviewed By: sfilipco
Differential Revision: D26142683
fbshipit-source-id: d6a45b7e67352d74986274e52002a769bbae772e
Summary:
When `n` is too large, return None. This matches the "parents()" behavior -
not error out but returns empty set.
Reviewed By: sfilipco
Differential Revision: D26142684
fbshipit-source-id: e45fca69e39c2968dc7abc5a4a155e6b7c280836
Summary:
The "merges" algorithm on the IdDag. Basically scan through flat segments
and conditionally pick up their "low"s.
Reviewed By: sfilipco
Differential Revision: D26142172
fbshipit-source-id: 305fe619a65ed4034423f303bee8d57be0424963
Summary:
The newly added API returns parent count wihtout actual parents.
Useful for the "merges" algorithm.
Reviewed By: sfilipco
Differential Revision: D26142176
fbshipit-source-id: 4f301b8de88f2af637f52bf62b24ddb12e65b6a7
Summary:
The function calculates all merges within a graph. It is useful to calculate
the "universally known" set, or to answer the "merge()" revset function.
This diff only adds a default impl. Upcoming diffs will add more efficient
versions on the segments graph.
Reviewed By: sfilipco
Differential Revision: D26142173
fbshipit-source-id: 02de180f6e444bcac63a1cc46dd23faeb8e08e14
Summary: The `filter` API filters a set by a function.
Reviewed By: sfilipco
Differential Revision: D26142177
fbshipit-source-id: f24cbeeaf1c85264706c933c98e364d7937790fe
Summary:
The `bytes` crate still does not support zero-copy on mmaped buffer.
Switch to `minibytes::Bytes` so bytes returned from our main storage
backend indexedlog is a zero-copy slice backed by a mmap buffer.
Migrate vfs, revisionstore, pyworker to minibytes so they can preserve
zero-copy mmap buffers from indexedlog.
The edenapi/types is unchanged, since it's also used in Mononoke which uses
`bytes::Bytes` all the places. The conversion to `minibytes::Bytes` is cheap
so it's probably not a performance issue.
Reviewed By: kulshrax
Differential Revision: D26218289
fbshipit-source-id: e4f1c631143b7676c6b48d3b4f97055299bfd334
Summary:
Make it possible to construct minibytes::Bytes via bytes::Bytes.
This will be used later.
Reviewed By: kulshrax
Differential Revision: D26232990
fbshipit-source-id: 36af6f28fd08eb457de8b9223235ec038ac3ef14
Summary:
Previously they were `Bytes`, which relies on `Bytes::from_static` being
a const_fn. Going to migrate from bytes to minibytes, which has a type
parameter on `Bytes` that makes it harder to have const_fn from_static.
Switch the constants to plain `&[u8]` to avoid the const_fn issue.
Reviewed By: kulshrax
Differential Revision: D26218290
fbshipit-source-id: 728c9b3831e551f41fb42ec257ca5fe75b7e93a3
Summary: Going to migrate from bytes to minibytes. Avoid using bytes' specific API.
Reviewed By: kulshrax
Differential Revision: D26218826
fbshipit-source-id: ba41697eab8fc5fb7bf73bc565c05a7c1b29464c
Summary: Going to migrate from bytes to minibytes. Avoid using bytes' specific API.
Reviewed By: kulshrax
Differential Revision: D26218292
fbshipit-source-id: c69c2a1e0d1bde37f49e7ad542bf5e952deebb7a
Summary:
The original migration strategy with dynamicconfig was to fix configs
one by one until the dynamicconfig values matched the chef/static ones, then we
can turn off chef/static configs. This looks to be too much work, so we're going
to try a different strategy of just turning off all chef/static configs on a
small number of hosts and seeing what breaks.
The legacylist and disallowlist configs were part of the old strategy, and they
make it more complicated to fix dynamicconfig mismatches, so let's get rid of
them.
Reviewed By: quark-zju
Differential Revision: D26208548
fbshipit-source-id: 63171f1f16aa0498c0eefa994dffaeb8e0cc0d72
Summary: set_executable is a pub function of VFS that set exec permissions on simple file
Reviewed By: quark-zju
Differential Revision: D26212713
fbshipit-source-id: 4c3ef477fc8d61362285654dda0b006342e046ee
Summary:
Basic implementation only process file updates for now.
See todos on CheckoutPlan::apply for more detail
Reviewed By: quark-zju
Differential Revision: D26209984
fbshipit-source-id: fcfbf568359d553a51ea02ea194634048d093d0e
Summary: This is needed becase later during checkout list of updates that needs fetch will go into storage stream
Reviewed By: quark-zju
Differential Revision: D26209983
fbshipit-source-id: 9fb54d48c6f0afc4fb67320aafc2e981c96ab5a9
Summary:
Expose the async LazySet API via NameSet constructor so users won't need to
care about the LazySet type.
Reviewed By: sfilipco
Differential Revision: D26142170
fbshipit-source-id: 178383684981e81e43f2a5610c45a7ebbd354ab4
Summary:
Add a way to capture tracing output in tests to verify certain logs are
emitted.
Reviewed By: sfilipco
Differential Revision: D26142174
fbshipit-source-id: 9267ffbe413973b8c54c54db75fe037c05614b1a
Summary:
`tracing_subscriber` has a fmt subscriber that satisfies the "log to stderr in
tests" need. It does not depend on `env_logger` or `TracingData` forwarding to
`env_logger`.
Reviewed By: sfilipco
Differential Revision: D26142175
fbshipit-source-id: 6e7dcd1585cb8431855322493d93bc49a8d57b76