This commit is contained in:
2026-06-07 21:27:18 +03:00
parent 776a341c57
commit 964fe4b4a8
14 changed files with 2415 additions and 2283 deletions

34
qb.go
View File

@@ -23,34 +23,36 @@ const (
)
type TimestampCompressor interface {
CalcRequiredSpace(uint32) (int, int)
Append(int, uint32)
Size() int
Chunks() [][]byte
DeleteLast()
Renew()
// (timestamp) => compressionWay, requiredSpace
Evaluate(uint32) (int, int)
Compress(int, uint32)
//Size() int
//Chunks() [][]byte
//DeleteLast()
CaptureState()
ForgetCapturedState()
CreateDecompressor() TimestampDecompressor
Snapshot() ([]byte, []byte) // payload, additional payload
Snapshot() ([]byte, []byte) // tail, head
Offset() int
Sync()
Rotate([]byte) int // payloadSize
//LastTimestamp() uint32
}
type ValueCompressor interface {
CalcRequiredSpace(float64) int
Append(float64)
Size() int
Chunks() [][]byte
DeleteLast()
// (value) => compressionWay, requiredSpace
Evaluate(float64) (int, int)
Compress(int, float64)
//Size() int
//Chunks() [][]byte
//DeleteLast()
Renew() // створює новий conbuf, але не чіпає state
Lock()
Unlock()
CaptureState()
ForgetCapturedState()
// fracDigits
CreateDecompressor(byte) ValueDecompressor
Snapshot() ([][]byte, int) // chunks, size
Snapshot() ([]byte, []byte) // tail, head
Offset() int
Rotate([]byte) int // payloadSize
//LastValue() float64
}