mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-06-18 05:23:49 +02:00
Deflate compression to avro writer
This commit is contained in:
parent
d00bfc6b9c
commit
3d768ec8a0
@ -140,7 +140,6 @@ func getTimestamp(dir string) int64 {
|
|||||||
updateTime := time.Unix(maxTs, 0).Add(interval).Add(time.Duration(CheckpointBufferMinutes-1) * time.Minute).Unix()
|
updateTime := time.Unix(maxTs, 0).Add(interval).Add(time.Duration(CheckpointBufferMinutes-1) * time.Minute).Unix()
|
||||||
|
|
||||||
if updateTime < time.Now().Unix() {
|
if updateTime < time.Now().Unix() {
|
||||||
fmt.Printf("maxTs : %d, updateTime : %d, now : %d\n", maxTs, updateTime, time.Now().Unix())
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,8 +294,9 @@ func (l *AvroLevel) toCheckpoint(dir string, from int64, dumpAll bool) error {
|
|||||||
// fmt.Printf("Codec : %#v\n", codec)
|
// fmt.Printf("Codec : %#v\n", codec)
|
||||||
|
|
||||||
writer, err := goavro.NewOCFWriter(goavro.OCFConfig{
|
writer, err := goavro.NewOCFWriter(goavro.OCFConfig{
|
||||||
W: f,
|
W: f,
|
||||||
Codec: codec,
|
Codec: codec,
|
||||||
|
CompressionName: goavro.CompressionDeflateLabel,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create OCF writer: %v", err)
|
return fmt.Errorf("failed to create OCF writer: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user