-
Notifications
You must be signed in to change notification settings - Fork 478
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
influxdb-java-182 Allow write precision of TimeUnit other than Nanoseconds #321
Merged
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
02fe3a5
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
237c926
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
4b34e7a
Merge remote-tracking branch 'origin/influxdb-java-182' into influxdb…
7c185d1
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
7015197
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
1b26692
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
3cf468e
revert automatic import reorganize
joelmarty 69801af
revert automatic indent
joelmarty 0d9a033
Merge branch 'master' into influxdb-java-182
1f98f1e
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
b181bf7
Merge remote-tracking branch 'origin/influxdb-java-182' into influxdb…
514998b
Merge branch 'master' into influxdb-java-182
joelmarty da2e1b9
influxdb-java-182 Allow write precision of TimeUnit other than Nanose…
6c13ff2
Merge branch 'master' into influxdb-java-182
lxhoan f5634ce
fix build javadocs failed + fix unit test
lxhoan 348faa1
set method accessibility to default
lxhoan cf4608a
Merge branch 'master' of https://github.com/influxdata/influxdb-java …
lxhoan 565c535
change log entry for PR #321
lxhoan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,6 +328,20 @@ public String lineProtocol() { | |
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Calculate the lineprotocol entry for a single point, using a specific {@link TimeUnit} for the timestamp. | ||
* @param precision the time precision unit for this point | ||
* @return the String without newLine | ||
*/ | ||
public String lineProtocol(final TimeUnit precision) { | ||
final StringBuilder sb = new StringBuilder(); | ||
sb.append(KEY_ESCAPER.escape(this.measurement)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
sb.append(concatenatedTags()); | ||
sb.append(concatenateFields()); | ||
sb.append(formatedTime(precision)); | ||
return sb.toString(); | ||
} | ||
|
||
private StringBuilder concatenatedTags() { | ||
final StringBuilder sb = new StringBuilder(); | ||
for (Entry<String, String> tag : this.tags.entrySet()) { | ||
|
@@ -385,4 +399,10 @@ private StringBuilder formatedTime() { | |
return sb; | ||
} | ||
|
||
private StringBuilder formatedTime(final TimeUnit precision) { | ||
final StringBuilder sb = new StringBuilder(); | ||
sb.append(" ").append(precision.convert(this.time, this.precision)); | ||
return sb; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why is this setter public, we have a builder which is responsible to do the object creation ?
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.
well, seems this long-standing PR has not attracted its author anymore. Let me see if I can help something