wp
This commit is contained in:
29
qb.go
29
qb.go
@@ -2,6 +2,7 @@ package qb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -23,37 +24,41 @@ const (
|
||||
)
|
||||
|
||||
type TimestampCompressor interface {
|
||||
RestoreState(int, uint32) // (payload size, last timestamp)
|
||||
// (timestamp) => compressionWay, requiredSpace
|
||||
Evaluate(uint32) (int, int)
|
||||
Compress(int, uint32)
|
||||
//Size() int
|
||||
Size() int
|
||||
//Chunks() [][]byte
|
||||
//DeleteLast()
|
||||
CaptureState()
|
||||
ForgetCapturedState()
|
||||
CreateDecompressor() TimestampDecompressor
|
||||
Snapshot() ([]byte, []byte) // tail, head
|
||||
//Payload() []byte // для снапшота
|
||||
Offset() int
|
||||
Rotate([]byte) int // payloadSize
|
||||
//LastTimestamp() uint32
|
||||
Rotate([]byte)
|
||||
WritePayloadTo(io.Writer) error
|
||||
LastTimestamp() uint32
|
||||
ReplaceSinceWithUntil() uint32
|
||||
}
|
||||
|
||||
type ValueCompressor interface {
|
||||
RestoreState(int) // payload size
|
||||
// (value) => compressionWay, requiredSpace
|
||||
Evaluate(float64) (int, int)
|
||||
Compress(int, float64)
|
||||
//Size() int
|
||||
Size() int
|
||||
//Chunks() [][]byte
|
||||
//DeleteLast()
|
||||
Renew() // створює новий conbuf, але не чіпає state
|
||||
CaptureState()
|
||||
ForgetCapturedState()
|
||||
// fracDigits
|
||||
CreateDecompressor(byte) ValueDecompressor
|
||||
Snapshot() ([]byte, []byte) // tail, head
|
||||
CreateDecompressor() ValueDecompressor
|
||||
//Payload() []byte // для снапшота
|
||||
Offset() int
|
||||
Rotate([]byte) int // payloadSize
|
||||
//LastValue() float64
|
||||
Rotate([]byte)
|
||||
WritePayloadTo(io.Writer) error
|
||||
LastValue() float64
|
||||
}
|
||||
|
||||
type TimestampDecompressor interface {
|
||||
@@ -90,6 +95,8 @@ const (
|
||||
UnknownMetricWaitQueueItemBug AbortCode = 21
|
||||
RepeatableLock AbortCode = 22
|
||||
NoSpaceOnIndexPage AbortCode = 23
|
||||
|
||||
WriteSnapshotFailed AbortCode = 24
|
||||
//
|
||||
GetRecoveryRecipeFailed AbortCode = 26
|
||||
LoadSnapshotFailed AbortCode = 27
|
||||
@@ -101,6 +108,8 @@ const (
|
||||
ReplayREDOFileFailed AbortCode = 33
|
||||
DeletePrevChangesFileFailed AbortCode = 34
|
||||
DeletePrevSnapshotFileFailed AbortCode = 35
|
||||
|
||||
MetricNotFoundDuringReplay AbortCode = 36
|
||||
)
|
||||
|
||||
func Abort(code AbortCode, err error) {
|
||||
|
||||
Reference in New Issue
Block a user