chore: restructure compactor package (#10775)

**What this PR does / why we need it**:
This pr moves the compactor pkg from
`pkg/storage/stores/shipper/indexshipper/compactor` to `pkg/compactor` -
same level as other high level components (querier, distributor...)

table compaction code however resides in the respective store pkg closer
to other store specific code.

`pkg/storage/stores/shipper/indexshipper/boltdb/compactor/table_compactor.go`
`pkg/storage/stores/shipper/indexshipper/tsdb/compactor.go`

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/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](d10549e3ec)
pull/10734/head
Ashwanth 2 years ago committed by GitHub
parent ba95f80e5a
commit 91cae03fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      pkg/compactor/client/grpc.go
  2. 73
      pkg/compactor/client/grpc/grpc.pb.go
  3. 0
      pkg/compactor/client/grpc/grpc.proto
  4. 2
      pkg/compactor/client/http.go
  5. 4
      pkg/compactor/compactor.go
  6. 0
      pkg/compactor/compactor_test.go
  7. 2
      pkg/compactor/deletion/delete_request.go
  8. 2
      pkg/compactor/deletion/delete_request_test.go
  9. 0
      pkg/compactor/deletion/delete_requests_client.go
  10. 0
      pkg/compactor/deletion/delete_requests_client_test.go
  11. 4
      pkg/compactor/deletion/delete_requests_manager.go
  12. 4
      pkg/compactor/deletion/delete_requests_manager_test.go
  13. 0
      pkg/compactor/deletion/delete_requests_store.go
  14. 0
      pkg/compactor/deletion/delete_requests_store_test.go
  15. 0
      pkg/compactor/deletion/delete_requests_table.go
  16. 0
      pkg/compactor/deletion/delete_requests_table_test.go
  17. 2
      pkg/compactor/deletion/grpc_request_handler.go
  18. 4
      pkg/compactor/deletion/grpc_request_handler_test.go
  19. 0
      pkg/compactor/deletion/metrics.go
  20. 0
      pkg/compactor/deletion/noop_delete_requests_store.go
  21. 0
      pkg/compactor/deletion/request_handler.go
  22. 0
      pkg/compactor/deletion/request_handler_test.go
  23. 0
      pkg/compactor/deletion/tenant_delete_requests_client.go
  24. 0
      pkg/compactor/deletion/tenant_delete_requests_client_test.go
  25. 0
      pkg/compactor/deletion/tenant_request_handler.go
  26. 0
      pkg/compactor/deletion/tenant_request_handler_test.go
  27. 2
      pkg/compactor/deletion/util.go
  28. 0
      pkg/compactor/deletion/util_test.go
  29. 0
      pkg/compactor/deletionmode/mode.go
  30. 0
      pkg/compactor/deletionmode/mode_test.go
  31. 0
      pkg/compactor/generationnumber/gennumber_loader.go
  32. 0
      pkg/compactor/generationnumber/gennumber_loader_test.go
  33. 0
      pkg/compactor/generationnumber/metrics.go
  34. 2
      pkg/compactor/index_set.go
  35. 0
      pkg/compactor/metrics.go
  36. 0
      pkg/compactor/retention/expiration.go
  37. 0
      pkg/compactor/retention/expiration_test.go
  38. 0
      pkg/compactor/retention/marker.go
  39. 0
      pkg/compactor/retention/marker_test.go
  40. 0
      pkg/compactor/retention/metrics.go
  41. 0
      pkg/compactor/retention/pool.go
  42. 0
      pkg/compactor/retention/retention.go
  43. 0
      pkg/compactor/retention/retention_test.go
  44. 0
      pkg/compactor/retention/series.go
  45. 0
      pkg/compactor/retention/series_test.go
  46. 0
      pkg/compactor/retention/util.go
  47. 0
      pkg/compactor/retention/util_test.go
  48. 2
      pkg/compactor/table.go
  49. 2
      pkg/compactor/table_test.go
  50. 2
      pkg/compactor/testutil.go
  51. 2
      pkg/distributor/distributor.go
  52. 2
      pkg/distributor/limits.go
  53. 2
      pkg/loki/delete_store_listener.go
  54. 48
      pkg/loki/loki.go
  55. 18
      pkg/loki/modules.go
  56. 2
      pkg/querier/querier.go
  57. 2
      pkg/querier/querier_test.go
  58. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/compacted_index.go
  59. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/compacted_index_test.go
  60. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/index.go
  61. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/index_compactor.go
  62. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/iterator.go
  63. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/iterator_test.go
  64. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/table_compactor.go
  65. 2
      pkg/storage/stores/shipper/indexshipper/boltdb/compactor/table_compactor_test.go
  66. 2
      pkg/storage/stores/shipper/indexshipper/downloads/table_manager.go
  67. 4
      pkg/storage/stores/shipper/indexshipper/tsdb/compactor.go
  68. 4
      pkg/storage/stores/shipper/indexshipper/tsdb/compactor_test.go
  69. 2
      pkg/util/limiter/combined_limits.go
  70. 2
      pkg/validation/limits.go
  71. 2
      pkg/validation/limits_test.go
  72. 2
      tools/doc-generator/parse/root_blocks.go
  73. 2
      tools/tsdb/tsdb-map/main.go

@ -12,8 +12,8 @@ import (
"github.com/prometheus/common/model"
"google.golang.org/grpc"
deletion_grpc "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
deletion_grpc "github.com/grafana/loki/pkg/compactor/client/grpc"
"github.com/grafana/loki/pkg/compactor/deletion"
)
type GRPCConfig struct {

@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pkg/storage/stores/shipper/indexshipper/compactor/client/grpc/grpc.proto
// source: pkg/compactor/client/grpc/grpc.proto
package grpc
@ -34,7 +34,7 @@ type GetDeleteRequestsRequest struct {
func (m *GetDeleteRequestsRequest) Reset() { *m = GetDeleteRequestsRequest{} }
func (*GetDeleteRequestsRequest) ProtoMessage() {}
func (*GetDeleteRequestsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_5620dfc5f1418630, []int{0}
return fileDescriptor_24a5f361c0f660df, []int{0}
}
func (m *GetDeleteRequestsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -70,7 +70,7 @@ type GetDeleteRequestsResponse struct {
func (m *GetDeleteRequestsResponse) Reset() { *m = GetDeleteRequestsResponse{} }
func (*GetDeleteRequestsResponse) ProtoMessage() {}
func (*GetDeleteRequestsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_5620dfc5f1418630, []int{1}
return fileDescriptor_24a5f361c0f660df, []int{1}
}
func (m *GetDeleteRequestsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -118,7 +118,7 @@ type DeleteRequest struct {
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_5620dfc5f1418630, []int{2}
return fileDescriptor_24a5f361c0f660df, []int{2}
}
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -195,7 +195,7 @@ type GetCacheGenNumbersRequest struct {
func (m *GetCacheGenNumbersRequest) Reset() { *m = GetCacheGenNumbersRequest{} }
func (*GetCacheGenNumbersRequest) ProtoMessage() {}
func (*GetCacheGenNumbersRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_5620dfc5f1418630, []int{3}
return fileDescriptor_24a5f361c0f660df, []int{3}
}
func (m *GetCacheGenNumbersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -231,7 +231,7 @@ type GetCacheGenNumbersResponse struct {
func (m *GetCacheGenNumbersResponse) Reset() { *m = GetCacheGenNumbersResponse{} }
func (*GetCacheGenNumbersResponse) ProtoMessage() {}
func (*GetCacheGenNumbersResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_5620dfc5f1418630, []int{4}
return fileDescriptor_24a5f361c0f660df, []int{4}
}
func (m *GetCacheGenNumbersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -276,36 +276,35 @@ func init() {
}
func init() {
proto.RegisterFile("pkg/storage/stores/shipper/indexshipper/compactor/client/grpc/grpc.proto", fileDescriptor_5620dfc5f1418630)
}
var fileDescriptor_5620dfc5f1418630 = []byte{
// 393 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x3d, 0x4f, 0xe3, 0x30,
0x18, 0x8e, 0xaf, 0x1f, 0xa7, 0xfa, 0x74, 0x77, 0x3a, 0xdf, 0xe9, 0x64, 0x02, 0x32, 0x51, 0xa6,
0x4c, 0x8d, 0x54, 0xd8, 0x98, 0xa0, 0x15, 0x85, 0x85, 0x21, 0xaa, 0x04, 0x6b, 0x9a, 0xbc, 0x6a,
0x23, 0xda, 0x24, 0xb5, 0x1d, 0x09, 0x36, 0x7e, 0x02, 0x3f, 0x83, 0x95, 0x95, 0x5f, 0xc0, 0xd8,
0xb1, 0x23, 0x4d, 0x17, 0xc6, 0xfe, 0x04, 0x54, 0x27, 0x69, 0xd5, 0xaf, 0x25, 0xf6, 0xf3, 0x61,
0xbf, 0x7e, 0x9f, 0x37, 0xf8, 0x2a, 0xbe, 0xef, 0xd9, 0x42, 0x46, 0xdc, 0xed, 0x81, 0x5a, 0x41,
0xd8, 0xa2, 0x1f, 0xc4, 0x31, 0x70, 0x3b, 0x08, 0x7d, 0x78, 0x28, 0x80, 0x17, 0x0d, 0x63, 0xd7,
0x93, 0x11, 0xb7, 0xbd, 0x41, 0x00, 0xa1, 0xb4, 0x7b, 0x3c, 0xf6, 0xd4, 0xa7, 0x1e, 0xf3, 0x48,
0x46, 0xa4, 0xbc, 0xd8, 0x9b, 0x3a, 0xa6, 0x6d, 0x90, 0x2d, 0x18, 0x80, 0x04, 0x07, 0x46, 0x09,
0x08, 0x29, 0xf2, 0xd5, 0xbc, 0xc3, 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x1d, 0x4f,
0x99, 0x36, 0x99, 0x32, 0x6d, 0x3e, 0x65, 0xe8, 0x29, 0x65, 0xe8, 0x25, 0x65, 0xe8, 0x3d, 0x65,
0x68, 0x9c, 0x32, 0xf4, 0x91, 0x32, 0xf4, 0x99, 0x32, 0x6d, 0x9e, 0x32, 0xf4, 0x3c, 0x63, 0xda,
0x78, 0xc6, 0xb4, 0xc9, 0x8c, 0x69, 0xdd, 0xaa, 0xfa, 0x1d, 0x4f, 0xbe, 0x02, 0x00, 0x00, 0xff,
0xff, 0xd3, 0x51, 0x00, 0xbe, 0xda, 0x02, 0x00, 0x00,
proto.RegisterFile("pkg/compactor/client/grpc/grpc.proto", fileDescriptor_24a5f361c0f660df)
}
var fileDescriptor_24a5f361c0f660df = []byte{
// 373 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xbb, 0x4e, 0xe3, 0x40,
0x14, 0xf5, 0x6c, 0x1e, 0xab, 0xcc, 0x6a, 0x77, 0xc5, 0x80, 0xd0, 0x60, 0xd0, 0xc5, 0xb2, 0x28,
0x5c, 0x25, 0x52, 0xa0, 0xa3, 0x82, 0x44, 0x44, 0x34, 0x14, 0x56, 0x24, 0x68, 0x1d, 0xe7, 0x2a,
0x44, 0x24, 0xb6, 0x33, 0x33, 0x2e, 0xe8, 0xf8, 0x04, 0x3e, 0x83, 0x96, 0x96, 0x2f, 0xa0, 0x4c,
0x99, 0x92, 0x38, 0x0d, 0x65, 0x3e, 0x01, 0x65, 0xec, 0x24, 0xca, 0xab, 0xb1, 0xe7, 0x9e, 0x73,
0xe6, 0x3e, 0xce, 0x1d, 0x7a, 0x16, 0x3d, 0x75, 0x2a, 0x7e, 0xd8, 0x8f, 0x3c, 0x5f, 0x85, 0xa2,
0xe2, 0xf7, 0xba, 0x18, 0xa8, 0x4a, 0x47, 0x44, 0xbe, 0xfe, 0x94, 0x23, 0x11, 0xaa,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0xf3, 0x74, 0x27, 0x9f, 0x75, 0x73, 0x4f, 0xd9, 0x66, 0xaf,
0x6c, 0x79, 0x6d, 0xfb, 0x88, 0xa6, 0xb5, 0x5b, 0x90, 0x26, 0xbe, 0xbe, 0x18, 0x8e, 0xc1, 0x18,
0x8d, 0xc1, 0x98, 0x8e, 0x81, 0xbc, 0x24, 0x40, 0xde, 0x12, 0x20, 0x9f, 0x09, 0x90, 0x61, 0x02,
0xe4, 0x2b, 0x01, 0xf2, 0x9d, 0x80, 0x31, 0x4d, 0x80, 0xbc, 0x4e, 0xc0, 0x18, 0x4e, 0xc0, 0x18,
0x4d, 0xc0, 0x68, 0x15, 0xf5, 0x73, 0x3c, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x80, 0xfa, 0x3c,
0xc9, 0xb6, 0x02, 0x00, 0x00,
}
func (this *GetDeleteRequestsRequest) Equal(that interface{}) bool {
@ -619,7 +618,7 @@ var _Compactor_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pkg/storage/stores/shipper/indexshipper/compactor/client/grpc/grpc.proto",
Metadata: "pkg/compactor/client/grpc/grpc.proto",
}
func (m *GetDeleteRequestsRequest) Marshal() (dAtA []byte, err error) {

@ -13,7 +13,7 @@ import (
"github.com/go-kit/log/level"
"github.com/grafana/dskit/crypto/tls"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/util/log"
)

@ -21,12 +21,12 @@ import (
"github.com/prometheus/common/model"
"github.com/grafana/loki/pkg/analytics"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/chunk/client"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
chunk_util "github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
"github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/filter"

@ -7,8 +7,8 @@ import (
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/util/filter"
util_log "github.com/grafana/loki/pkg/util/log"
)

@ -12,8 +12,8 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/util/filter"
)

@ -12,8 +12,8 @@ import (
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/compactor/deletionmode"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/util/filter"
util_log "github.com/grafana/loki/pkg/util/log"
)

@ -10,9 +10,9 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor/deletionmode"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/util/filter"
)

@ -8,7 +8,7 @@ import (
"github.com/grafana/dskit/tenant"
"github.com/pkg/errors"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/compactor/client/grpc"
util_log "github.com/grafana/loki/pkg/util/log"
)

@ -17,8 +17,8 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/grpc/test/bufconn"
compactor_client_grpc "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
compactor_client_grpc "github.com/grafana/loki/pkg/compactor/client/grpc"
"github.com/grafana/loki/pkg/compactor/deletionmode"
)
func server(t *testing.T, h *GRPCRequestHandler) (compactor_client_grpc.CompactorClient, func()) {

@ -3,8 +3,8 @@ package deletion
import (
"errors"
"github.com/grafana/loki/pkg/compactor/deletionmode"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
)
var (

@ -13,8 +13,8 @@ import (
"github.com/pkg/errors"
"github.com/grafana/loki/pkg/chunkenc"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
util_log "github.com/grafana/loki/pkg/util/log"

@ -12,9 +12,9 @@ import (
"github.com/grafana/dskit/concurrency"
"github.com/prometheus/common/model"
"github.com/grafana/loki/pkg/compactor/retention"
chunk_util "github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
util_log "github.com/grafana/loki/pkg/util/log"
)

@ -12,9 +12,9 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
)

@ -17,10 +17,10 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/testutil"
)

@ -33,6 +33,7 @@ import (
"go.uber.org/atomic"
"github.com/grafana/loki/pkg/analytics"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/distributor/clientpool"
"github.com/grafana/loki/pkg/distributor/shardstreams"
"github.com/grafana/loki/pkg/distributor/writefailures"
@ -41,7 +42,6 @@ import (
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/runtime"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/util"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/validation"

@ -3,8 +3,8 @@ package distributor
import (
"time"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/distributor/shardstreams"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
)
// Limits is an interface for distributor limits/related configs

@ -3,7 +3,7 @@ package loki
import (
"github.com/grafana/dskit/services"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/compactor/deletion"
)
func deleteRequestsStoreListener(d deletion.DeleteRequestsClient) *listener {

@ -30,6 +30,9 @@ import (
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/loki/pkg/analytics"
"github.com/grafana/loki/pkg/compactor"
compactorclient "github.com/grafana/loki/pkg/compactor/client"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
ingester_client "github.com/grafana/loki/pkg/ingester/client"
@ -48,9 +51,6 @@ import (
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/tracing"
"github.com/grafana/loki/pkg/util"
@ -73,27 +73,27 @@ type Config struct {
UseBufferedLogger bool `yaml:"use_buffered_logger" doc:"hidden"`
UseSyncLogger bool `yaml:"use_sync_logger" doc:"hidden"`
Server server.Config `yaml:"server,omitempty"`
InternalServer internalserver.Config `yaml:"internal_server,omitempty" doc:"hidden"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
QueryScheduler scheduler.Config `yaml:"query_scheduler"`
Frontend lokifrontend.Config `yaml:"frontend,omitempty"`
QueryRange queryrange.Config `yaml:"query_range,omitempty"`
Ruler ruler.Config `yaml:"ruler,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
IndexGateway indexgateway.Config `yaml:"index_gateway"`
StorageConfig storage.Config `yaml:"storage_config,omitempty"`
ChunkStoreConfig config.ChunkStoreConfig `yaml:"chunk_store_config,omitempty"`
SchemaConfig config.SchemaConfig `yaml:"schema_config,omitempty"`
CompactorConfig compactor.Config `yaml:"compactor,omitempty"`
CompactorHTTPClient compactor_client.HTTPConfig `yaml:"compactor_client,omitempty" doc:"hidden"`
CompactorGRPCClient compactor_client.GRPCConfig `yaml:"compactor_grpc_client,omitempty" doc:"hidden"`
LimitsConfig validation.Limits `yaml:"limits_config,omitempty"`
Worker worker.Config `yaml:"frontend_worker,omitempty"`
TableManager index.TableManagerConfig `yaml:"table_manager,omitempty"`
MemberlistKV memberlist.KVConfig `yaml:"memberlist"`
Server server.Config `yaml:"server,omitempty"`
InternalServer internalserver.Config `yaml:"internal_server,omitempty" doc:"hidden"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
QueryScheduler scheduler.Config `yaml:"query_scheduler"`
Frontend lokifrontend.Config `yaml:"frontend,omitempty"`
QueryRange queryrange.Config `yaml:"query_range,omitempty"`
Ruler ruler.Config `yaml:"ruler,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
IndexGateway indexgateway.Config `yaml:"index_gateway"`
StorageConfig storage.Config `yaml:"storage_config,omitempty"`
ChunkStoreConfig config.ChunkStoreConfig `yaml:"chunk_store_config,omitempty"`
SchemaConfig config.SchemaConfig `yaml:"schema_config,omitempty"`
CompactorConfig compactor.Config `yaml:"compactor,omitempty"`
CompactorHTTPClient compactorclient.HTTPConfig `yaml:"compactor_client,omitempty" doc:"hidden"`
CompactorGRPCClient compactorclient.GRPCConfig `yaml:"compactor_grpc_client,omitempty" doc:"hidden"`
LimitsConfig validation.Limits `yaml:"limits_config,omitempty"`
Worker worker.Config `yaml:"frontend_worker,omitempty"`
TableManager index.TableManagerConfig `yaml:"table_manager,omitempty"`
MemberlistKV memberlist.KVConfig `yaml:"memberlist"`
RuntimeConfig runtimeconfig.Config `yaml:"runtime_config,omitempty"`
Tracing tracing.Config `yaml:"tracing"`

@ -34,6 +34,11 @@ import (
"github.com/prometheus/common/version"
"github.com/grafana/loki/pkg/analytics"
"github.com/grafana/loki/pkg/compactor"
compactorclient "github.com/grafana/loki/pkg/compactor/client"
"github.com/grafana/loki/pkg/compactor/client/grpc"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/compactor/generationnumber"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
"github.com/grafana/loki/pkg/logproto"
@ -59,11 +64,6 @@ import (
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
boltdbcompactor "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
compactor_client "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/client/grpc"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/generationnumber"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
"github.com/grafana/loki/pkg/util/httpreq"
@ -765,12 +765,12 @@ func (t *Loki) initCacheGenerationLoader() (_ services.Service, err error) {
reg := prometheus.WrapRegistererWith(prometheus.Labels{"for": "cache_gen", "client_type": t.Cfg.Target.String()}, prometheus.DefaultRegisterer)
if isGRPCAddress {
client, err = compactor_client.NewGRPCClient(compactorAddress, t.Cfg.CompactorGRPCClient, reg)
client, err = compactorclient.NewGRPCClient(compactorAddress, t.Cfg.CompactorGRPCClient, reg)
if err != nil {
return nil, err
}
} else {
client, err = compactor_client.NewHTTPClient(compactorAddress, t.Cfg.CompactorHTTPClient)
client, err = compactorclient.NewHTTPClient(compactorAddress, t.Cfg.CompactorHTTPClient)
if err != nil {
return nil, err
}
@ -1386,12 +1386,12 @@ func (t *Loki) deleteRequestsClient(clientType string, limits limiter.CombinedLi
reg := prometheus.WrapRegistererWith(prometheus.Labels{"for": "delete_requests", "client_type": clientType}, prometheus.DefaultRegisterer)
var compactorClient deletion.CompactorClient
if isGRPCAddress {
compactorClient, err = compactor_client.NewGRPCClient(compactorAddress, t.Cfg.CompactorGRPCClient, reg)
compactorClient, err = compactorclient.NewGRPCClient(compactorAddress, t.Cfg.CompactorGRPCClient, reg)
if err != nil {
return nil, err
}
} else {
compactorClient, err = compactor_client.NewHTTPClient(compactorAddress, t.Cfg.CompactorHTTPClient)
compactorClient, err = compactorclient.NewHTTPClient(compactorAddress, t.Cfg.CompactorHTTPClient)
if err != nil {
return nil, err
}

@ -21,6 +21,7 @@ import (
"golang.org/x/sync/errgroup"
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/iter"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logproto"
@ -28,7 +29,6 @@ import (
"github.com/grafana/loki/pkg/logql/syntax"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/stores/index/stats"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
listutil "github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/spanlogger"
util_validation "github.com/grafana/loki/pkg/util/validation"

@ -18,11 +18,11 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/ingester/client"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logql"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/validation"
)

@ -12,12 +12,12 @@ import (
"github.com/prometheus/prometheus/model/labels"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
seriesindex "github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
shipperindex "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/index"
shipperutil "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/util"
)

@ -12,12 +12,12 @@ import (
"github.com/stretchr/testify/require"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
util_log "github.com/grafana/loki/pkg/util/log"
)

@ -8,7 +8,7 @@ import (
"github.com/prometheus/common/model"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/compactor/retention"
)
const (

@ -5,8 +5,8 @@ import (
"github.com/go-kit/log"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
)
const (

@ -8,9 +8,9 @@ import (
"github.com/prometheus/prometheus/model/labels"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/config"
series_index "github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
)
const (

@ -15,11 +15,11 @@ import (
"github.com/stretchr/testify/require"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
)
func Test_ChunkIterator(t *testing.T) {

@ -15,9 +15,9 @@ import (
"github.com/pkg/errors"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
shipper_util "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/util"
)

@ -16,11 +16,11 @@ import (
"github.com/stretchr/testify/require"
"go.etcd.io/bbolt"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/storage/chunk/client"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/testutil"
util_log "github.com/grafana/loki/pkg/util/log"

@ -14,9 +14,9 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"github.com/grafana/loki/pkg/compactor/deletion"
"github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletion"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
"github.com/grafana/loki/pkg/validation"

@ -14,11 +14,11 @@ import (
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
shipperindex "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/index"
tsdbindex "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
)

@ -17,14 +17,14 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/grafana/loki/pkg/storage/chunk/client"
"github.com/grafana/loki/pkg/storage/chunk/client/local"
"github.com/grafana/loki/pkg/storage/chunk/client/util"
"github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/storage"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
util_log "github.com/grafana/loki/pkg/util/log"

@ -1,6 +1,7 @@
package limiter
import (
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
"github.com/grafana/loki/pkg/querier"
@ -8,7 +9,6 @@ import (
"github.com/grafana/loki/pkg/ruler"
"github.com/grafana/loki/pkg/scheduler"
"github.com/grafana/loki/pkg/storage"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
)

@ -19,11 +19,11 @@ import (
"golang.org/x/time/rate"
"gopkg.in/yaml.v2"
"github.com/grafana/loki/pkg/compactor/deletionmode"
"github.com/grafana/loki/pkg/distributor/shardstreams"
"github.com/grafana/loki/pkg/logql/syntax"
ruler_config "github.com/grafana/loki/pkg/ruler/config"
"github.com/grafana/loki/pkg/ruler/util"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
"github.com/grafana/loki/pkg/util/flagext"
util_log "github.com/grafana/loki/pkg/util/log"
"github.com/grafana/loki/pkg/util/validation"

@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/deletionmode"
"github.com/grafana/loki/pkg/compactor/deletionmode"
)
func TestLimitsTagsYamlMatchJson(t *testing.T) {

@ -14,6 +14,7 @@ import (
"github.com/grafana/dskit/server"
"github.com/grafana/loki/pkg/analytics"
"github.com/grafana/loki/pkg/compactor"
"github.com/grafana/loki/pkg/distributor"
"github.com/grafana/loki/pkg/ingester"
ingester_client "github.com/grafana/loki/pkg/ingester/client"
@ -36,7 +37,6 @@ import (
"github.com/grafana/loki/pkg/storage/chunk/client/openstack"
storage_config "github.com/grafana/loki/pkg/storage/config"
"github.com/grafana/loki/pkg/storage/stores/series/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/indexgateway"
"github.com/grafana/loki/pkg/tracing"
"github.com/grafana/loki/pkg/validation"

@ -11,9 +11,9 @@ import (
"go.etcd.io/bbolt"
"gopkg.in/yaml.v2"
"github.com/grafana/loki/pkg/compactor/retention"
"github.com/grafana/loki/pkg/storage/config"
boltdbcompactor "github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/boltdb/compactor"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/compactor/retention"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/tsdb/index"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexshipper/util"

Loading…
Cancel
Save