-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Finish tsm file exporter #7046
Conversation
} | ||
defer reader.Close() | ||
|
||
for i := 0; i < reader.KeyCount(); i++ { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
if err != nil { | ||
return err | ||
} | ||
defer reader.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These deferred Close
s won't execute until the end of writeFiles
- maybe wrap the inner loop in an anonymous function?
7d53279
to
3d7a942
Compare
@jwilder comments addressed. Ready for review. |
for _, value := range values { | ||
switch typ { | ||
case tsm1.BlockFloat64: | ||
pairs = field + "=" + fmt.Sprintf("%v", value.Value()) |
There was a problem hiding this comment.
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.
Two small things, but looks good! 👍 |
620ae1d
to
968d322
Compare
Is this part of the 1.0 beta? |
@retorquere It's in the current nightlies. |
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? |
@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). |
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. |
Add ability to export TSM files to line protocol to be imported back into another database.