Skip to content

Commit

Permalink
Update transport
Browse files Browse the repository at this point in the history
fixed writeValue
fixed writeUnique
  • Loading branch information
alpinskiy committed Jul 13, 2024
1 parent 956322f commit 33e4705
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/vk/statshouse/Transport.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ synchronized void writeCount(boolean hasEnv, String name, String[] tagsNames, St
synchronized void writeValue(boolean hasEnv, String name, String[] tagsNames, String[] tags, double[] values, long ts) throws IOException {
int fieldMask = VALUE_FIELDS_MASK | NEW_SEMANTIC_FIELDS_MASK;
var now = Instant.now();
for (int i = 0; i < values.length; i++) {
for (int i = 0; i < values.length;) {
var needWriteCount = values.length - i;
var spaceLeft = writeHeader(fieldMask, hasEnv, name, tagsNames, tags, 0, ts, TL_INT_32_SIZE + TL_FLOAT_64_SIZE);
if (spaceLeft < 0) {
Expand All @@ -125,7 +125,7 @@ synchronized void writeValue(boolean hasEnv, String name, String[] tagsNames, St
synchronized void writeUnique(boolean hasEnv, String name, String[] tagsNames, String[] tags, long[] values, long ts) throws IOException {
var fieldMask = UNIQUE_FIELDS_MASK | NEW_SEMANTIC_FIELDS_MASK;
var now = Instant.now();
for (int i = 0; i < values.length; i++) {
for (int i = 0; i < values.length;) {
var needWriteCount = values.length - i;
var spaceLeft = writeHeader(fieldMask, hasEnv, name, tagsNames, tags, 0, ts, TL_INT_32_SIZE + TL_INT_64_SIZE);
if (spaceLeft < 0) {
Expand Down

0 comments on commit 33e4705

Please sign in to comment.