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

Avoid duplicate ident.ID conversions #935

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/query/storage/m3/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ func (s *m3storage) Write(
}

id := query.Tags.ID()
// TODO: Consider caching id -> identID
identID := ident.StringID(id)
common := &writeRequestCommon{
store: s,
annotation: query.Annotation,
unit: query.Unit,
id: id,
id: identID,
tagIterator: storage.TagsToIdentTagIterator(query.Tags),
attributes: query.Attributes,
}
Expand All @@ -282,7 +284,7 @@ func (s *m3storage) Close() error {
func (w *writeRequest) Process(ctx context.Context) error {
common := w.writeRequestCommon
store := common.store
id := ident.StringID(common.id)
id := common.id

var (
namespace ClusterNamespace
Expand Down Expand Up @@ -321,7 +323,7 @@ type writeRequestCommon struct {
store *m3storage
annotation []byte
unit xtime.Unit
id string
id ident.ID
tagIterator ident.TagIterator
attributes storage.Attributes
}
Expand Down