Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 25 additions & 15 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[prune]
unused-packages = true
go-tests = true

[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "v1.10.8"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ update-gazelle: $(PROTOS_GO)
bazel run //:gazelle

update-vendor:
dep ensure && dep prune
dep ensure
git status | grep BUILD.bazel | cut -d' ' -f 5 | xargs git checkout HEAD

bazel: $(PROTOS_GO)
Expand Down
2 changes: 1 addition & 1 deletion cmd/table-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
schemaConfig.IndexTables.WriteScale.Enabled ||
schemaConfig.ChunkTables.InactiveWriteScale.Enabled ||
schemaConfig.IndexTables.InactiveWriteScale.Enabled) &&
storageConfig.ApplicationAutoScaling.URL == nil {
storageConfig.AWSStorageConfig.ApplicationAutoScaling.URL == nil {
level.Error(util.Logger).Log("msg", "WriteScale is enabled but no ApplicationAutoScaling URL has been provided")
os.Exit(1)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chunk
package aws

import (
"context"
Expand All @@ -15,6 +15,7 @@ import (
"golang.org/x/time/rate"

"github.com/weaveworks/common/instrument"
"github.com/weaveworks/cortex/pkg/chunk"
"github.com/weaveworks/cortex/pkg/util"
)

Expand All @@ -39,7 +40,7 @@ type dynamoTableClient struct {
}

// NewDynamoDBTableClient makes a new DynamoTableClient.
func NewDynamoDBTableClient(cfg DynamoDBConfig) (TableClient, error) {
func NewDynamoDBTableClient(cfg DynamoDBConfig) (chunk.TableClient, error) {
dynamoDB, err := dynamoClientFromURL(cfg.DynamoDB.URL)
if err != nil {
return nil, err
Expand Down Expand Up @@ -97,7 +98,7 @@ func (d dynamoTableClient) ListTables(ctx context.Context) ([]string, error) {
return table, err
}

func (d dynamoTableClient) CreateTable(ctx context.Context, desc TableDesc) error {
func (d dynamoTableClient) CreateTable(ctx context.Context, desc chunk.TableDesc) error {
var tableARN *string
if err := d.backoffAndRetry(ctx, func(ctx context.Context) error {
return instrument.TimeRequestHistogram(ctx, "DynamoDB.CreateTable", dynamoRequestDuration, func(ctx context.Context) error {
Expand Down Expand Up @@ -161,7 +162,7 @@ func (d dynamoTableClient) CreateTable(ctx context.Context, desc TableDesc) erro
return nil
}

func (d dynamoTableClient) DescribeTable(ctx context.Context, name string) (desc TableDesc, status string, err error) {
func (d dynamoTableClient) DescribeTable(ctx context.Context, name string) (desc chunk.TableDesc, status string, err error) {
var tableARN *string
err = d.backoffAndRetry(ctx, func(ctx context.Context) error {
return instrument.TimeRequestHistogram(ctx, "DynamoDB.DescribeTable", dynamoRequestDuration, func(ctx context.Context) error {
Expand Down Expand Up @@ -241,7 +242,7 @@ func (d dynamoTableClient) DescribeTable(ctx context.Context, name string) (desc
return
}

func (d dynamoTableClient) UpdateTable(ctx context.Context, current, expected TableDesc) error {
func (d dynamoTableClient) UpdateTable(ctx context.Context, current, expected chunk.TableDesc) error {
var err error
if !current.WriteScale.Enabled {
if expected.WriteScale.Enabled {
Expand Down Expand Up @@ -305,7 +306,7 @@ func (d dynamoTableClient) UpdateTable(ctx context.Context, current, expected Ta
return nil
}

func (d dynamoTableClient) enableAutoScaling(ctx context.Context, desc TableDesc) error {
func (d dynamoTableClient) enableAutoScaling(ctx context.Context, desc chunk.TableDesc) error {
// Registers or updates a scalable target
if err := d.backoffAndRetry(ctx, func(ctx context.Context) error {
return instrument.TimeRequestHistogram(ctx, "ApplicationAutoScaling.RegisterScalableTarget", applicationAutoScalingRequestDuration, func(ctx context.Context) error {
Expand Down Expand Up @@ -351,7 +352,7 @@ func (d dynamoTableClient) enableAutoScaling(ctx context.Context, desc TableDesc
})
}

func (d dynamoTableClient) disableAutoScaling(ctx context.Context, desc TableDesc) error {
func (d dynamoTableClient) disableAutoScaling(ctx context.Context, desc chunk.TableDesc) error {
// Deregister scalable target
if err := d.backoffAndRetry(ctx, func(ctx context.Context) error {
return instrument.TimeRequestHistogram(ctx, "ApplicationAutoScaling.DeregisterScalableTarget", applicationAutoScalingRequestDuration, func(ctx context.Context) error {
Expand Down
Loading