-
Notifications
You must be signed in to change notification settings - Fork 820
Rename chunk.ObjectClient and implement generic object store chunk client #2108
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
Rename chunk.ObjectClient and implement generic object store chunk client #2108
Conversation
pkg/chunk/testutils/testutils.go
Outdated
@@ -22,7 +23,7 @@ const ( | |||
// Fixture type for per-backend testing. | |||
type Fixture interface { | |||
Name() string | |||
Clients() (chunk.IndexClient, chunk.ObjectClient, chunk.TableClient, chunk.SchemaConfig, error) | |||
Clients() (chunk.IndexClient, chunk.Client, chunk.ObjectClient, chunk.TableClient, chunk.SchemaConfig, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having both chunk.Client
and chunk.ObjectClient
sounds redundant to me. Could you explain why we need chunk.ObjectClient
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can have the downstream fixtures wrap the object client before returning them
5179c15
to
34315dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @jtlisi! I left few nits, but please consider it already approved 👏
@@ -155,7 +155,7 @@ func NewDynamoDBIndexClient(cfg DynamoDBConfig, schemaCfg chunk.SchemaConfig) (c | |||
} | |||
|
|||
// NewDynamoDBObjectClient makes a new DynamoDB-backed ObjectClient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectClient
> chunk.Client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, I will also rename this function to be NewDynamoDBChunkClient
pkg/chunk/storage/factory.go
Outdated
@@ -164,13 +165,12 @@ func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chun | |||
} | |||
|
|||
// NewObjectClient makes a new ObjectClient of the desired types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectClient
> chunk.Client
pkg/chunk/storage/factory.go
Outdated
@@ -164,13 +165,12 @@ func NewIndexClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chun | |||
} | |||
|
|||
// NewObjectClient makes a new ObjectClient of the desired types. | |||
func NewObjectClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.ObjectClient, error) { | |||
func NewObjectClient(name string, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.Client, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit that now the function name NewObjectClient()
is quite confusing, cause it returns chunk.Client
and not chunk.ObjectClient
. Given it's just called in this file, we may easily rename it to NewChunkClient
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update it to reflect the changes.
…eneric ObjectClient chunk.Client Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
f9238f9
to
e48f0af
Compare
What this PR does:
ObjectClient
toClient
pkg/chunk/object
object.ChunkClient
when S3/GCS/AzureBlobStore/LocalFS is specified as a chunk store, all of these backends already implement theObjectClient
interface.Which issue(s) this PR fixes:
Fixes #2107
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]