wp
This commit is contained in:
35
qb.go
35
qb.go
@@ -24,28 +24,36 @@ const (
|
||||
)
|
||||
|
||||
type TimestampCompressor interface {
|
||||
// (timestamp) => compressionWay, requiredSpace
|
||||
Evaluate(uint32) (int, int)
|
||||
Compress(int, uint32)
|
||||
Size() int
|
||||
// (tmp, timestamp)
|
||||
Evaluate([]byte, uint32) TimeEvaluationReport
|
||||
// (offset, tmp)
|
||||
Append(int, []byte)
|
||||
//Size() int
|
||||
//Chunks() [][]byte
|
||||
//DeleteLast()
|
||||
CaptureState()
|
||||
ForgetCapturedState()
|
||||
CreateDecompressor() TimestampDecompressor
|
||||
//Payload() []byte // для снапшота
|
||||
Offset() int
|
||||
// Offset() int
|
||||
Rotate([]byte)
|
||||
WritePayloadTo(io.Writer) error
|
||||
LastTimestamp() uint32
|
||||
ReplaceSinceWithUntil() uint32
|
||||
}
|
||||
|
||||
type TimeEvaluationReport struct {
|
||||
TotalSpace int
|
||||
Offset int
|
||||
ChangeSize int
|
||||
}
|
||||
|
||||
type ValueCompressor interface {
|
||||
// (value) => compressionWay, requiredSpace
|
||||
Evaluate(float64) (int, int)
|
||||
Compress(int, float64)
|
||||
Size() int
|
||||
// (tmp, value)
|
||||
Evaluate([]byte, float64) ValueEvaluationReport
|
||||
// (offset, tmp, delta)
|
||||
Append(int, []byte, uint64)
|
||||
//Size() int
|
||||
//Chunks() [][]byte
|
||||
//DeleteLast()
|
||||
CaptureState()
|
||||
@@ -53,12 +61,19 @@ type ValueCompressor interface {
|
||||
// fracDigits
|
||||
CreateDecompressor() ValueDecompressor
|
||||
//Payload() []byte // для снапшота
|
||||
Offset() int
|
||||
//Offset() int
|
||||
Rotate([]byte)
|
||||
WritePayloadTo(io.Writer) error
|
||||
LastValue() float64
|
||||
}
|
||||
|
||||
type ValueEvaluationReport struct {
|
||||
TotalSpace int
|
||||
Offset int
|
||||
ChangeSize int
|
||||
Delta uint64
|
||||
}
|
||||
|
||||
type TimestampDecompressor interface {
|
||||
NextValue() (uint32, bool)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user