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

Finish tsm file exporter #7046

Merged
merged 1 commit into from
Jul 21, 2016
Merged

Finish tsm file exporter #7046

merged 1 commit into from
Jul 21, 2016

Conversation

corylanou
Copy link
Contributor

@corylanou corylanou commented Jul 21, 2016

Add ability to export TSM files to line protocol to be imported back into another database.

  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Update docs issue created
  • Update README.md

}
defer reader.Close()

for i := 0; i < reader.KeyCount(); i++ {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jwilder feels like there should be an easier way to get the data back to line protocol, but I couldn't find it. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the best way. It arrives as a Point, but it's not stored or retrieved in that format ever again.

Copy link
Contributor

@jwilder jwilder Jul 21, 2016

Choose a reason for hiding this comment

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

Actually, the fastest way to walk the file is to use a BlockIterator and then decode each block based on the type. reader.ReadAll via keys works, but will be slower and allocates a lot of memory.

@beckettsean
Copy link
Contributor

@gunnaraasen

if err != nil {
return err
}
defer reader.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

These deferred Closes won't execute until the end of writeFiles - maybe wrap the inner loop in an anonymous function?

@corylanou
Copy link
Contributor Author

@jwilder comments addressed. Ready for review.

for _, value := range values {
switch typ {
case tsm1.BlockFloat64:
pairs = field + "=" + fmt.Sprintf("%v", value.Value())
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this format float64(0) as 0.0? Floats should include a decimal to ensure their types won't switch to an int inadvertently.

@jwilder
Copy link
Contributor

jwilder commented Jul 21, 2016

Two small things, but looks good! 👍

@corylanou corylanou force-pushed the cjl-tsm-export branch 3 times, most recently from 620ae1d to 968d322 Compare July 21, 2016 22:20
@retorquere
Copy link

Is this part of the 1.0 beta?

@jwilder
Copy link
Contributor

jwilder commented Jul 29, 2016

@retorquere It's in the current nightlies.

@retorquere
Copy link

Ok, no issue. Is this compatible with 0.13 and could I compile it separately? Alternatively, are the nightlies usable enough to be mostly-available, and is there a clean upgrade path between 0.13?

Is there a timeline for 1.0?

@kostasb
Copy link

kostasb commented Aug 16, 2016

@retorquere The upgrade bath from 0.13 is straight-forward, installing the new package over the existing 0.13 will be sufficient. Please review the Changelog before upgrading in case you want to modify the new default configuration values (particularly max-series-per-database).

@retorquere
Copy link

Thanks for the feedback, and I'm looking at that parameter now, but this is about the number of series, not taking into account the cardinality of the tags? Not that it would affect me I think; I have 3 series, each with one tag with cardinality 3, but with 70 fields.

@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 19, 2016
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.

7 participants