Removed unused cache metrics [DPP-1246].
CHANGELOG_BEGIN
The following metrics were removed from the metrics relevant to caches:
- load_successes
- load_failures
- load_total_time
CHANGELOG_END
Continues the work started in https://github.com/digital-asset/daml/pull/12543
These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.
changelog_begin
changelog_end
Adding
- `PersistentUserManagementStore` and `CachedUserManagementStore`,
- `UserManagementStorageBackendTemplate` and sql migrations,
- CLI flags: `--user-management-max-cache-size` and `--user-management-cache-expiry`;
And wiring `PersistentUserManagementStore` where before we had `InMemoryUserManagementStore`.
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.
I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.
CHANGELOG_BEGIN
CHANGELOG_END
Soft references allow the garbage collector to collect the values referenced
by soft references in case of memory pressure. Since these caches are not the
source of truth for the data, it's better to remove values from the cache
instead of having the process die due to OOM (not enough heap or excessive GC).
Fixes DPP-561.
CHANGELOG_BEGIN
CHANGELOG_END
* Upgrade Scalatest to v3.2.9.
Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.
The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.
As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.
CHANGELOG_BEGIN
CHANGELOG_END
* http-json-oracle: Fix a Scalatest dependency.
* ledger-api-client: Fix a Scalatest dependency.
* Port parts of //ledger/... to Scala 2.13
Fairly random choice of directories, I just went through them in
alphabetical order. The one thing that I had to disable for now are
the conformance tests since the ledger API test tool has a dependency
not compatible with Scala 2.13.
changelog_begin
changelog_end
* Remove accidentally included //ledger/ledger-api-client/...
doesn’t actually work yet
changelog_begin
changelog_end
This PR updates scalafmt and enables trailingCommas =
multiple. Unfortunately, scalafmt broke the version field which means
we cannot fully preserve the rest of the config. I’ve made some
attempts to stay reasonably close to the original config but couldn’t
find an exact equivalent in a lot of cases. I don’t feel strongly
about any of the settings so happy to change them to something else.
As announced, this will be merged on Saturday to avoid too many conflicts.
changelog_begin
changelog_end
* kvutils: Remove QueryableReadSet, and simplify caching a little.
* kvutils: Generalize the caching ledger state reader.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils: Make StateReader even more general (no Option).
* kvutils: Convert LedgerStateReaderWithFingerprints to a type alias.
And DamlLedgerStateReaderWithFingerprints too.
* kvutils: Replace LedgerStateReaderWithFingerprintsFromValues.
With LedgerStateOperationsReader and a `.map`.
* kvutils: Replace RawToDamlLedgerStateReaderWithFingerprintsAdapter.
With a `.comapKeys`.
* kvutils: Delete duplicate caching code.
* caching: Move `Cache#get` into its own subtrait.
This method is used by the submission validator, but not by the
caching state readers.
* caching: Move cache mapping from CachingStateReader into Cache.
* caching: Remove an over-eager comment.
* kvutils: Rename `StateReader#comapKeys` to `contramapKeys`.
I got contravariant functors confused with cofunctors.
* caching: Add Scaladoc and improve parameter names in MappedCache.
* kvutils: Adapters everywhere!
* caching: Rename the base test class.
This is necessary to at least attempt an upgrade to 2.13 and
generally, I want to keep our rulesets up2date. rules-scala forces the
version of scalatest so we have to bump that at the same time.
This requires changes to basically all Scala test suites since the
import structure has changed and a bunch of things (primarily
scalacheck support) got split out.
Apologies for the giant PR, I don’t see a way to keep it smaller.
changelog_begin
changelog_end
* caching: Wait for the cache to evict some values in tests.
Windows, especially, might not do it the first time. Not sure why;
caching is weird.
CHANGELOG_BEGIN
CHANGELOG_END
* caching: Pull out duplicate tests into CacheEvictionSpecBase.
* caching: Split caches into new files.
* caching: Rename `Cache.from` to `WeightedCache.from`.
* caching: Move `Configuration` inside `WeightedCache`.
* caching: Add test cases.
* caching: Allow for Caffeine builders to be covariant.
* caching: When instrumenting the Caffeine cache, compose, don't inherit.
* caching: Add a size-based cache.
* caching: Extract out common test cases into base classes.
* caching: Use the size-based cache for LF value translation.
CHANGELOG_BEGIN
CHANGELOG_END
* caching: Simplify the eviction tests.
* caching: Increase the encapsulation in CaffeineCache.
* caching: Commas are important.
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>