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 solr client. #106

Merged
merged 14 commits into from
Jul 30, 2024
Merged

Add solr client. #106

merged 14 commits into from
Jul 30, 2024

Conversation

pritamdas99
Copy link
Member

Signed-off-by: pritamdas99 [email protected]

}

switch {
case version.Major() == 9:
Copy link
Contributor

Choose a reason for hiding this comment

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

should be - version.Major() >= 9: for future compatability

config := Config{
host: o.url,
transport: &http.Transport{
IdleConnTimeout: time.Minute * 6,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have 6 minutes (such long periods) of timeouts everywhere? and can we use a variable for it?

)

type Client struct {
SLClient
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this pointer type?

Copy link
Member Author

Choose a reason for hiding this comment

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

can't use pointer for embedded types

return &Client{
&SLClientV8{
Client: newClient,
log: config.log,
Copy link
Contributor

Choose a reason for hiding this comment

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

If Config have log inside it, do we need to set log as a separate parameter here? Can't we extract log from config later.

return nil, gerr.Wrap(err, "failed to parse version")
}

switch {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need different switch cases for v8 and v9? are there differences in their clients/method implementations ?

Copy link
Member Author

Choose a reason for hiding this comment

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

some v2 apis are not supported by version 8

solr/solrv8.go Outdated
}

func (sc *SLClientV8) ReadCollection() (*Response, error) {
sc.Config.log.V(5).Info("READING COLLECTION: kubedb-system")
Copy link
Contributor

Choose a reason for hiding this comment

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

kubedb-system should be used as a constant everywhere

solr/util.go Show resolved Hide resolved
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Signed-off-by: pritamdas99 <[email protected]>
Copy link
Contributor

@raihankhan raihankhan left a comment

Choose a reason for hiding this comment

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

LGTM!

@raihankhan raihankhan merged commit 495ccff into master Jul 30, 2024
5 checks passed
@raihankhan raihankhan deleted the solr branch July 30, 2024 08:35
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