don't fetch indices , add indices to cache, and add esmonthly func #1931

Merged
merged 2 commits into from Oct 20, 2016

Conversation

Projects
None yet
2 participants
@kylebrandt
Member

kylebrandt commented Oct 9, 2016

No description provided.

@kylebrandt

This comment has been minimized.

Show comment
Hide comment
@kylebrandt

kylebrandt Oct 9, 2016

Member

Currently if the time series is missing it errors inside ESDateHistrogram when it can't get the expected time series in the result. This result gets cached. Before when it would error on no indices in getFn, a wrapper for func (e ElasticHosts) Query(r *ElasticRequest) (*elastic.SearchResult, error), ensuring it was not cached. But now a lack of indices throws an error. Need to research inspecting the shards of the result and understanding what the means in this context.

Member

kylebrandt commented Oct 9, 2016

Currently if the time series is missing it errors inside ESDateHistrogram when it can't get the expected time series in the result. This result gets cached. Before when it would error on no indices in getFn, a wrapper for func (e ElasticHosts) Query(r *ElasticRequest) (*elastic.SearchResult, error), ensuring it was not cached. But now a lack of indices throws an error. Need to research inspecting the shards of the result and understanding what the means in this context.

@kylebrandt

This comment has been minimized.

Show comment
Hide comment
@kylebrandt

kylebrandt Oct 9, 2016

Member

I think counting the resulting shards and erroring when there were no shards that matched will get the result I want.

However, it depends on the following PR olivere/elastic#373

Alternatively, I could go for the date math method mentioned in #1926 (comment) . But only if allow_no_indices applies to datemath and not just wildcard. According to the documentation it only applies to wildcard which I haven't tested yet. Even if does work I think the implementation will be a bit of pain.

Member

kylebrandt commented Oct 9, 2016

I think counting the resulting shards and erroring when there were no shards that matched will get the result I want.

However, it depends on the following PR olivere/elastic#373

Alternatively, I could go for the date math method mentioned in #1926 (comment) . But only if allow_no_indices applies to datemath and not just wildcard. According to the documentation it only applies to wildcard which I haven't tested yet. Even if does work I think the implementation will be a bit of pain.

@kylebrandt

This comment has been minimized.

Show comment
Hide comment
@kylebrandt

kylebrandt Oct 20, 2016

Member

note: forgot to fmt, force pushed the fmt.

Member

kylebrandt commented Oct 20, 2016

note: forgot to fmt, force pushed the fmt.

@kylebrandt kylebrandt changed the title from WIP: don't fetch indices , add indices to cache to don't fetch indices , add indices to cache, and add esmonthly func Oct 20, 2016

}
- return str, nil
+ return fmt.Sprintf("%v\n%s", r.Indices, b), nil

This comment has been minimized.

@captncraig

captncraig Oct 20, 2016

Contributor

probably use string(b) here. Don't want [42 31 13] in you key.

@captncraig

captncraig Oct 20, 2016

Contributor

probably use string(b) here. Don't want [42 31 13] in you key.

This comment has been minimized.

@captncraig

captncraig Oct 20, 2016

Contributor

additionally, what does the source have that causes it to be a different key? What varies?

@captncraig

captncraig Oct 20, 2016

Contributor

additionally, what does the source have that causes it to be a different key? What varies?

This comment has been minimized.

@captncraig

captncraig Oct 20, 2016

Contributor

I ask because it surprises me that something like getting a cache key even has a possibility of erroring.

@captncraig

captncraig Oct 20, 2016

Contributor

I ask because it surprises me that something like getting a cache key even has a possibility of erroring.

@kylebrandt

This comment has been minimized.

Show comment
Hide comment
Member

kylebrandt commented Oct 20, 2016

fixes #1926

@kylebrandt kylebrandt merged commit 3438de5 into master Oct 20, 2016

2 checks passed

bosun All checks Passed!
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gbrayut gbrayut deleted the esNoIndexRefactor branch Mar 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment