-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fileexporter/receiver: refactor fileexporter and read compressed json in filereceiver #22021
fileexporter/receiver: refactor fileexporter and read compressed json in filereceiver #22021
Conversation
Before you push too much into this, please know this PR's scope is too big for review. Please break it in 2. |
if cfg.Compression == "zstd" { | ||
if fw, err := zstd.NewWriter(file); err == nil { | ||
// flushing the compressed writer every second. | ||
go func() { | ||
for { | ||
time.Sleep(1 * time.Second) | ||
if fw.Flush() != nil { | ||
return | ||
} | ||
} | ||
}() | ||
|
||
return &lineWriter{ | ||
file: bufio.NewWriter(fw), | ||
} | ||
} | ||
} | ||
|
||
return &lineWriter{ |
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.
👍 👍
if cfg.Compression == "zstd" { | ||
if fw, err := zstd.NewWriter(file); err == nil { | ||
// flushing the compressed writer every second. | ||
go func() { | ||
for { | ||
time.Sleep(1 * time.Second) | ||
if fw.Flush() != nil { | ||
return | ||
} | ||
} | ||
}() | ||
return &fileWriter{ | ||
file: bufio.NewWriter(fw), | ||
} | ||
} | ||
} |
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 changes compression to be per-stream not per-record, which I think is OK as long as the reader (a) has never supported this, (b) will support this after your change.
Description:
[WIP] not working
This PR: