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

Add topic endpoints #1060

Merged
merged 3 commits into from
Oct 10, 2018
Merged

Add topic endpoints #1060

merged 3 commits into from
Oct 10, 2018

Conversation

cw9
Copy link
Collaborator

@cw9 cw9 commented Oct 10, 2018

No description provided.

@codecov
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #1060 into master will decrease coverage by 0.01%.
The diff coverage is 50.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1060      +/-   ##
==========================================
- Coverage   77.46%   77.44%   -0.02%     
==========================================
  Files         537      541       +4     
  Lines       45771    45896     +125     
==========================================
+ Hits        35457    35546      +89     
- Misses       8070     8096      +26     
- Partials     2244     2254      +10
Flag Coverage Δ
#aggregator 81.67% <ø> (ø) ⬆️
#collector 61% <ø> (ø) ⬆️
#dbnode 81.35% <ø> (+0.11%) ⬆️
#m3em 73.21% <ø> (ø) ⬆️
#m3ninx 75.25% <ø> (-0.08%) ⬇️
#m3nsch 51.19% <ø> (ø) ⬆️
#query 63.25% <50.78%> (-0.24%) ⬇️
#x 75.1% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcfd851...6006c84. Read the comment docs.

}

func (h *AddHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
Copy link
Contributor

Choose a reason for hiding this comment

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

var()

ctx := r.Context()
logger := logging.WithContext(ctx)

var req admin.TopicAddRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

var()

return
}

service, err := h.fn(h.client, r.Header)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename this serviceFn

return
}

t, err := service.Get(topicName(r))
Copy link
Contributor

Choose a reason for hiding this comment

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

can t be nil? Do you need to handle that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

t can't be nil when err==nil

client clusterclient.Client
cfg config.Configuration

fn serviceFn
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename this serviceFn

}

// Service gets a topic service from m3cluster client
func Service(clusterClient clusterclient.Client, headers http.Header) (topic.Service, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to accept headers?

r.HandleFunc(AddURL, logged(NewAddHandler(client, cfg)).ServeHTTP).Methods(AddHTTPMethod)
}

func topicName(r *http.Request) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isnt the request a proto? How is this expected to be used. Can we just put it in the proto fields?

return
}

tn := topicName(r)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you just call this name

Copy link
Contributor

@richardartoul richardartoul left a comment

Choose a reason for hiding this comment

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

LGTM

@cw9 cw9 merged commit 668d176 into master Oct 10, 2018
@cw9 cw9 deleted the chao/topic branch October 10, 2018 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants