Skip to content
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

chore(storage): Simplify store interfaces and abstractions (pt 3) #10516

Closed
wants to merge 10 commits into from

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Sep 8, 2023

What this PR does / why we need it:

In an attempt to simplify the storage layer, this PR implements best practices:

  • Remove inline interfaces from structs
  • Move AsyncStore to the same package as CompositeStore, as they implement the same interface
  • Accept PeriodConfig instead of SchemaConfig where component operates on single schema period

Special notes for your reviewer:

See individual commit messages.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR

@chaudum chaudum force-pushed the chaudum/store-interfaces-v5 branch from 7e012ca to 76934e7 Compare September 12, 2023 08:50
@chaudum chaudum force-pushed the chaudum/store-interfaces-v3 branch from f37324f to 9ca7323 Compare September 12, 2023 09:39
Base automatically changed from chaudum/store-interfaces-v3 to main September 12, 2023 10:00
@chaudum chaudum force-pushed the chaudum/store-interfaces-v5 branch 4 times, most recently from b2eb5f0 to d7cad48 Compare September 18, 2023 15:31
@chaudum chaudum marked this pull request as ready for review September 25, 2023 11:55
@chaudum chaudum requested a review from a team as a code owner September 25, 2023 11:55
@chaudum chaudum force-pushed the chaudum/store-interfaces-v5 branch from 340a623 to 6698aff Compare September 26, 2023 09:04
Copy link
Contributor

@ashwanthgoli ashwanthgoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chaudum chaudum force-pushed the chaudum/store-interfaces-v5 branch from 6698aff to d978e47 Compare November 2, 2023 08:00
pkg/storage/stores/shipper/bloomshipper/TODO.md Outdated Show resolved Hide resolved
pkg/storage/stores/composite_store_entry.go Outdated Show resolved Hide resolved
pkg/storage/stores/testutils.go Show resolved Hide resolved
Use composition instead of "inline inheritance". This requires LokiStore
to implement additional methods that were previously inherited from the
inline Store field.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Use composition instead of "inline inheritance". This requires
storeEntry to implement additional methods to that were previously
inherited from ChunkWriter.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Use composition instead of "inline inheritance". This requires to
implement additional methods that were previously inherited from the
inline Store field.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
AsyncStore and CompositeStore share the same interface implementation.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
instead of full SchemaConfig

Both stores only ever operate on a single schema period and the schema
was only used to determine the external key of a chunk. This can be done
by the PeriodConfig as well.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@chaudum chaudum force-pushed the chaudum/store-interfaces-v5 branch from d978e47 to 8a53e34 Compare November 10, 2023 13:29
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@chaudum chaudum closed this Dec 20, 2024
@chaudum chaudum deleted the chaudum/store-interfaces-v5 branch December 20, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants