This commit is contained in:
2026-06-15 10:47:24 +00:00
parent ca125c99d2
commit 06823ee547
28 changed files with 1243 additions and 1383 deletions

View File

@@ -310,10 +310,33 @@ func (s *TimeDeltaCompressor) FirstTimestamp() uint32 {
return timestamp
}
func (s *TimeDeltaCompressor) LastTimestamp() uint32 {
func (s *TimeDeltaCompressor) Until() uint32 {
return s.lastUnixtime
}
func (s *TimeDeltaCompressor) CommitedSince() uint32 {
if s.state == nil {
if s.pos < len(s.buf) {
timestamp, _ := bin.GetUint32(s.buf[len(s.buf)-4:])
return timestamp
}
} else {
payload := s.state.Payload
if len(payload) > 0 {
timestamp, _ := bin.GetUint32(payload[len(payload)-4:])
return timestamp
}
}
return 0
}
func (s *TimeDeltaCompressor) CommitedUntil() uint32 {
if s.state == nil {
return s.lastUnixtime
}
return s.state.LastUnixtime
}
// DECOMPRESSOR
type TimeDeltaDecompressor struct {