wp
This commit is contained in:
@@ -31,6 +31,7 @@ type _metric struct {
|
|||||||
RLocks int
|
RLocks int
|
||||||
WaitQueue []any
|
WaitQueue []any
|
||||||
indexLevelTails []storage.IndexLevelTail // root - last element
|
indexLevelTails []storage.IndexLevelTail // root - last element
|
||||||
|
capturedState *CapturedState
|
||||||
}
|
}
|
||||||
|
|
||||||
//IndexLevels [][]IndexRec // root - last element
|
//IndexLevels [][]IndexRec // root - last element
|
||||||
@@ -59,59 +60,45 @@ func (s *_metric) DeleteMeasures() {
|
|||||||
// s.UntilValue = 0
|
// s.UntilValue = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CapturedState struct {
|
||||||
|
Pages []storage.DataPayload
|
||||||
|
TimeState qb.TimeDeltaCapturedState
|
||||||
|
ValueState qb.ValueDeltaCapturedState
|
||||||
|
}
|
||||||
|
|
||||||
// func (s *_metric) startAppendMeasures(req tryAppendMeasuresReq, sendToStorage func(storage.AppendedMeasures)) {
|
// func (s *_metric) startAppendMeasures(req tryAppendMeasuresReq, sendToStorage func(storage.AppendedMeasures)) {
|
||||||
func (s *_metric) StartAppendMeasures(req tryAppendMeasuresReq, tmp []byte, sendToStorage func(any)) {
|
func (s *_metric) StartAppendMeasures(req tryAppendMeasuresReq, tmp []byte, sendToStorage func(any)) {
|
||||||
|
if s.capturedState != nil {
|
||||||
|
s.WaitQueue = append(s.WaitQueue, req)
|
||||||
|
}
|
||||||
var (
|
var (
|
||||||
timestamps = s.timestamps
|
timestamps = s.timestamps
|
||||||
values = s.values
|
values = s.values
|
||||||
|
|
||||||
dataPages []storage.DataPayload
|
|
||||||
|
|
||||||
// офсети на head сторінці
|
// офсети на head сторінці
|
||||||
timestampsOffset int
|
timestampsOffset int
|
||||||
valuesOffset int
|
valuesOffset int
|
||||||
|
|
||||||
//written int
|
written int
|
||||||
//resultCode byte
|
resultCode byte
|
||||||
)
|
)
|
||||||
|
|
||||||
s.values.CaptureState()
|
s.capturedState = &CapturedState{
|
||||||
s.timestamps.CaptureState()
|
//
|
||||||
|
TimeState: s.timestamps.CaptureState(),
|
||||||
|
ValueState: s.values.CaptureState(),
|
||||||
|
}
|
||||||
|
|
||||||
for idx, measure := range req.Measures {
|
for idx, measure := range req.Measures {
|
||||||
// FIX - у випадку помилки треба в транзакції зберегти що помилка, але також зафіксувати скільки елементів збережено.
|
|
||||||
// якщо idx == 0 - одразу знімаю блокування і нічого не відправляю в storage
|
|
||||||
if measure.Timestamp <= s.timestamps.LastTimestamp() {
|
if measure.Timestamp <= s.timestamps.LastTimestamp() {
|
||||||
if idx == 0 {
|
resultCode = ExpiredMeasure
|
||||||
s.values.ForgetCapturedState()
|
|
||||||
s.timestamps.ForgetCapturedState()
|
|
||||||
|
|
||||||
req.ResultCh <- tryAppendMeasuresResult{
|
|
||||||
ResultCode: ExpiredMeasure,
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//resultCode = ExpiredMeasure
|
|
||||||
//written = idx
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.metricType == qb.Cumulative && measure.Value < s.lastValue {
|
if s.metricType == qb.Cumulative && measure.Value < s.lastValue {
|
||||||
if idx == 0 {
|
resultCode = NonMonotonicValue
|
||||||
s.values.ForgetCapturedState()
|
|
||||||
s.timestamps.ForgetCapturedState()
|
|
||||||
|
|
||||||
req.ResultCh <- tryAppendMeasuresResult{
|
|
||||||
ResultCode: NonMonotonicValue,
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//resultCode = NonMonotonicValue
|
|
||||||
//written = idx
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
// fix - 1 + 8 bytes
|
// fix - 1 + 8 bytes
|
||||||
|
|
||||||
@@ -144,13 +131,13 @@ func (s *_metric) StartAppendMeasures(req tryAppendMeasuresReq, tmp []byte, send
|
|||||||
// сторінка заповнена
|
// сторінка заповнена
|
||||||
since := s.timestamps.ReplaceSinceWithUntil()
|
since := s.timestamps.ReplaceSinceWithUntil()
|
||||||
|
|
||||||
if len(dataPages) == 0 {
|
if len(s.capturedState.Pages) == 0 {
|
||||||
// head page FIX
|
// head page FIX
|
||||||
// timestampsPayload =
|
// timestampsPayload =
|
||||||
// valuesPayload =
|
// valuesPayload =
|
||||||
}
|
}
|
||||||
|
|
||||||
dataPages = append(dataPages, storage.DataPayload{
|
s.capturedState.Pages = append(s.capturedState.Pages, storage.DataPayload{
|
||||||
Since: since,
|
Since: since,
|
||||||
Content: s.buffer,
|
Content: s.buffer,
|
||||||
TimestampsSize: timestamps.Size(),
|
TimestampsSize: timestamps.Size(),
|
||||||
@@ -171,37 +158,53 @@ func (s *_metric) StartAppendMeasures(req tryAppendMeasuresReq, tmp []byte, send
|
|||||||
values.Append(vReport.Offset, tmp[7:7+vReport.ChangeSize], measure.Value, vReport.Delta)
|
values.Append(vReport.Offset, tmp[7:7+vReport.ChangeSize], measure.Value, vReport.Delta)
|
||||||
//
|
//
|
||||||
s.lastValue = measure.Value
|
s.lastValue = measure.Value
|
||||||
|
written++
|
||||||
|
}
|
||||||
|
|
||||||
|
if written == 0 {
|
||||||
|
s.capturedState = nil
|
||||||
|
req.ResultCh <- tryAppendMeasuresResult{
|
||||||
|
ResultCode: resultCode,
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// виділити змінені байти.
|
// виділити змінені байти.
|
||||||
// скопіювати. Причому можна скопіювати зрізи chunks
|
// скопіювати. Причому можна скопіювати зрізи chunks
|
||||||
|
|
||||||
if len(dataPages) > 0 {
|
if len(s.capturedState.Pages) > 0 {
|
||||||
|
head := s.capturedState.Pages[0]
|
||||||
|
databuf := head.Content[:storage.DataPagePayloadSize]
|
||||||
// пишу в storage довгим шляхом через redo файл і запис в data файл
|
// пишу в storage довгим шляхом через redo файл і запис в data файл
|
||||||
sendToStorage(storage.AppendedMeasures{
|
sendToStorage(storage.AppendedMeasures{
|
||||||
MetricID: req.MetricID,
|
MetricID: req.MetricID,
|
||||||
LastPageNo: s.lastPageNo,
|
LastPageNo: s.lastPageNo,
|
||||||
TimestampsOffset: timestampsOffset,
|
TimestampsOffset: timestampsOffset,
|
||||||
|
Timestamps: databuf[len(databuf)-head.TimestampsSize : len(databuf)-timestampsOffset],
|
||||||
ValuesOffset: valuesOffset,
|
ValuesOffset: valuesOffset,
|
||||||
//Payload: s.payload, // fix - timestamps + values ? or timestamps and values (for WAL)
|
Values: databuf[valuesOffset:head.ValuesSize],
|
||||||
IndexLevelTails: s.indexLevelTails,
|
IndexLevelTails: s.indexLevelTails,
|
||||||
DataPages: dataPages,
|
DataPages: s.capturedState.Pages,
|
||||||
Timestamps: nil,
|
TailTimestamps: nil, // payload
|
||||||
Values: nil,
|
TailValues: s.buffer[:values.Size()],
|
||||||
//ResultCode: resultCode,
|
ResultCode: resultCode,
|
||||||
//WrittenCount: wri,
|
WrittenCount: written,
|
||||||
ResultCh: nil,
|
ResultCh: nil,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
databuf := s.buffer
|
||||||
|
if len(s.buffer) == storage.DataPageSize {
|
||||||
|
databuf = s.buffer[:storage.DataPagePayloadSize]
|
||||||
|
}
|
||||||
// короткий шлях - запис лише в storage
|
// короткий шлях - запис лише в storage
|
||||||
sendToStorage(storage.AppendedMeasures{
|
sendToStorage(storage.AppendedMeasures{
|
||||||
MetricID: req.MetricID,
|
MetricID: req.MetricID,
|
||||||
TimestampsOffset: timestampsOffset,
|
TimestampsOffset: timestampsOffset,
|
||||||
ValuesOffset: valuesOffset,
|
ValuesOffset: valuesOffset,
|
||||||
Timestamps: nil, // pos - offset
|
Timestamps: databuf[len(databuf)-timestamps.Size() : len(databuf)-timestampsOffset],
|
||||||
Values: nil,
|
Values: databuf[valuesOffset:values.Size()],
|
||||||
//ResultCode: resultCode,
|
ResultCode: resultCode,
|
||||||
//WrittenCount: wri,
|
WrittenCount: written,
|
||||||
ResultCh: nil,
|
ResultCh: nil,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -210,8 +213,7 @@ func (s *_metric) StartAppendMeasures(req tryAppendMeasuresReq, tmp []byte, send
|
|||||||
|
|
||||||
func (s *_metric) FinAppendMeasures(rec storage.AppendMeasuresSummary) {
|
func (s *_metric) FinAppendMeasures(rec storage.AppendMeasuresSummary) {
|
||||||
// Видаляю state. Оригінальні Timestamps і Values вже мають останню версію
|
// Видаляю state. Оригінальні Timestamps і Values вже мають останню версію
|
||||||
s.values.ForgetCapturedState()
|
s.capturedState = nil
|
||||||
s.timestamps.ForgetCapturedState()
|
|
||||||
|
|
||||||
if rec.LastPageNo > 0 {
|
if rec.LastPageNo > 0 {
|
||||||
s.lastPageNo = rec.LastPageNo
|
s.lastPageNo = rec.LastPageNo
|
||||||
@@ -367,13 +369,21 @@ func (s *_metric) WriteTo(w io.Writer) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var (
|
||||||
|
timestampsCapturedState *qb.TimeDeltaCapturedState
|
||||||
|
valuesCapturedState *qb.ValueDeltaCapturedState
|
||||||
|
)
|
||||||
|
if s.capturedState != nil {
|
||||||
|
timestampsCapturedState = &s.capturedState.TimeState
|
||||||
|
valuesCapturedState = &s.capturedState.ValueState
|
||||||
|
}
|
||||||
// timestamps payload
|
// timestamps payload
|
||||||
err = s.timestamps.WritePayloadTo(w)
|
err = s.timestamps.WritePayloadTo(w, timestampsCapturedState)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// values payload
|
// values payload
|
||||||
err = s.values.WritePayloadTo(w)
|
err = s.values.WritePayloadTo(w, valuesCapturedState)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -398,3 +408,32 @@ func (s *_metric) WriteTo(w io.Writer) (err error) {
|
|||||||
// since - 4b
|
// since - 4b
|
||||||
// sinceValue - 8b -
|
// sinceValue - 8b -
|
||||||
// untilValue - 8b
|
// untilValue - 8b
|
||||||
|
|
||||||
|
// time
|
||||||
|
|
||||||
|
// if s.state != nil {
|
||||||
|
// h = s.state.H
|
||||||
|
// lastUnixtime = s.state.LastUnixtime
|
||||||
|
// lastDelta = s.state.LastDelta
|
||||||
|
// payload = s.state.Payload
|
||||||
|
// }
|
||||||
|
// return NewTimeDeltaDecompressorFromState(TimeDeltaDecompressorFromStateOptions{
|
||||||
|
// H: h,
|
||||||
|
// LastUnixtime: lastUnixtime,
|
||||||
|
// LastDelta: lastDelta,
|
||||||
|
// Payload: payload,
|
||||||
|
// })
|
||||||
|
|
||||||
|
// value
|
||||||
|
// if s.state != nil {
|
||||||
|
// h = s.state.H
|
||||||
|
// lastDelta = s.state.LastDelta
|
||||||
|
// payload = s.state.Payload
|
||||||
|
// }
|
||||||
|
// return NewValueDeltaDecompressorFromState(ValueDeltaDecompressorFromStateOptions{
|
||||||
|
// Coef: s.coef,
|
||||||
|
// ToFloat64: s.toFloat64,
|
||||||
|
// H: s.buf[s.pos-1],
|
||||||
|
// LastDelta: s.lastDelta,
|
||||||
|
// Payload: s.buf[:s.pos],
|
||||||
|
// })
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ func (s *Database) processMetricQueue(metricID uint32, metric *_metric) {
|
|||||||
s.tryGetMetric(req)
|
s.tryGetMetric(req)
|
||||||
|
|
||||||
case tryAppendMeasuresReq:
|
case tryAppendMeasuresReq:
|
||||||
metric.StartAppendMeasures(req, s.storage.Append)
|
//metric.StartAppendMeasures(req, s.storage.Append) FIX
|
||||||
|
|
||||||
case tryDeleteMetricReq:
|
case tryDeleteMetricReq:
|
||||||
s.startDeleteMetric(metric, req)
|
s.startDeleteMetric(metric, req)
|
||||||
@@ -322,7 +322,7 @@ func (s *Database) tryAppendMeasures(req tryAppendMeasuresReq) {
|
|||||||
metric.WaitQueue = append(metric.WaitQueue, req)
|
metric.WaitQueue = append(metric.WaitQueue, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
metric.StartAppendMeasures(req, s.storage.Append)
|
//metric.StartAppendMeasures(req, s.storage.Append) FIX
|
||||||
}
|
}
|
||||||
|
|
||||||
type tryRangeScanReq struct {
|
type tryRangeScanReq struct {
|
||||||
@@ -472,20 +472,14 @@ func (s *Database) applyAddMetric(rec storage.MetricAddRecord) {
|
|||||||
|
|
||||||
func (s *Database) addMetric(rec storage.MetricAddRecord) {
|
func (s *Database) addMetric(rec storage.MetricAddRecord) {
|
||||||
var (
|
var (
|
||||||
values qb.ValueCompressor
|
|
||||||
buffer = make([]byte, minBufferSize)
|
buffer = make([]byte, minBufferSize)
|
||||||
)
|
)
|
||||||
if rec.MetricType == qb.Cumulative {
|
|
||||||
values = enc.NewCumulativeDeltaCompressor(byte(rec.FracDigits), buffer, 0)
|
|
||||||
} else {
|
|
||||||
values = enc.NewInstantDeltaCompressor(byte(rec.FracDigits), buffer, 0)
|
|
||||||
}
|
|
||||||
s.metrics[rec.MetricID] = &_metric{
|
s.metrics[rec.MetricID] = &_metric{
|
||||||
metricType: rec.MetricType,
|
metricType: rec.MetricType,
|
||||||
fracDigits: byte(rec.FracDigits),
|
fracDigits: byte(rec.FracDigits),
|
||||||
buffer: buffer,
|
buffer: buffer,
|
||||||
timestamps: enc.NewTimeDeltaCompressor(buffer, 0),
|
timestamps: enc.NewTimeDeltaCompressor(buffer, 0),
|
||||||
values: values,
|
values: enc.NewValueDeltaCompressor(rec.MetricType, byte(rec.FracDigits), buffer, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,6 @@ func composeHeadDataPage(databuf []byte, head storage.HeadDataPage) storage.Page
|
|||||||
|
|
||||||
func (s *ReplayMetric) ToMetric() *_metric {
|
func (s *ReplayMetric) ToMetric() *_metric {
|
||||||
var (
|
var (
|
||||||
values qb.ValueCompressor
|
|
||||||
requiredSpace = s.tSize + s.vSize
|
requiredSpace = s.tSize + s.vSize
|
||||||
)
|
)
|
||||||
bufferSize := calculateDataBufferSize(requiredSpace)
|
bufferSize := calculateDataBufferSize(requiredSpace)
|
||||||
@@ -284,11 +283,7 @@ func (s *ReplayMetric) ToMetric() *_metric {
|
|||||||
NewBufferSize: bufferSize,
|
NewBufferSize: bufferSize,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if s.metricType == qb.Cumulative {
|
values := enc.NewValueDeltaCompressor(s.metricType, s.fracDigits, s.buf, s.vSize)
|
||||||
values = enc.NewCumulativeDeltaCompressor(s.fracDigits, s.buf, s.vSize)
|
|
||||||
} else {
|
|
||||||
values = enc.NewInstantDeltaCompressor(s.fracDigits, s.buf, s.vSize)
|
|
||||||
}
|
|
||||||
return &_metric{
|
return &_metric{
|
||||||
metricType: s.metricType,
|
metricType: s.metricType,
|
||||||
fracDigits: s.fracDigits,
|
fracDigits: s.fracDigits,
|
||||||
|
|||||||
16
enc/enc.go
16
enc/enc.go
@@ -5,14 +5,14 @@ const eps = 0.000001
|
|||||||
const (
|
const (
|
||||||
flagLiteral = 128
|
flagLiteral = 128
|
||||||
|
|
||||||
hSize = 1
|
//hSize = 1
|
||||||
|
|
||||||
// append scripts
|
// append scripts
|
||||||
addBaseValue = 0 // cumulative and instant only
|
// addBaseValue = 0 // cumulative and instant only
|
||||||
addUnixtime = 0 // time only
|
// addUnixtime = 0 // time only
|
||||||
incrementRun = 1
|
// incrementRun = 1
|
||||||
incrementLiteral = 2
|
// incrementLiteral = 2
|
||||||
endSeries = 3
|
// endSeries = 3
|
||||||
startRun = 4
|
// startRun = 4
|
||||||
add1stDelta = 5 // time only
|
// add1stDelta = 5 // time only
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ type TimeDeltaCompressor struct {
|
|||||||
pos int
|
pos int
|
||||||
lastUnixtime uint32
|
lastUnixtime uint32
|
||||||
lastDelta uint32
|
lastDelta uint32
|
||||||
state *TimeDeltaCapturedState
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Початкове створення, коли даних немає
|
// Початкове створення, коли даних немає
|
||||||
@@ -61,11 +60,6 @@ func NewTimeDeltaCompressor(buf []byte, payloadSize int) *TimeDeltaCompressor {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIX - restire lastUnixtime
|
|
||||||
// func (s *TimeDeltaCompressor) RestoreState() {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (s *TimeDeltaCompressor) Evaluate(tmp []byte, timestamp uint32) qb.TimeEvaluationReport {
|
func (s *TimeDeltaCompressor) Evaluate(tmp []byte, timestamp uint32) qb.TimeEvaluationReport {
|
||||||
var (
|
var (
|
||||||
delta = timestamp - s.lastUnixtime
|
delta = timestamp - s.lastUnixtime
|
||||||
@@ -160,20 +154,10 @@ func (s *TimeDeltaCompressor) Append(offset int, change []byte, timestamp uint32
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
type TimeDeltaCapturedState struct {
|
|
||||||
H byte
|
|
||||||
LastUnixtime uint32
|
|
||||||
LastDelta uint32
|
|
||||||
Payload []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
// delta h
|
// delta h
|
||||||
func (s *TimeDeltaCompressor) CaptureState() {
|
func (s *TimeDeltaCompressor) CaptureState() qb.TimeDeltaCapturedState {
|
||||||
if s.state != nil {
|
|
||||||
qb.Abort(qb.RepeatableLock, nil)
|
|
||||||
}
|
|
||||||
// позиція посувається вліво, отже може перескочити на попередній chunk
|
// позиція посувається вліво, отже може перескочити на попередній chunk
|
||||||
s.state = &TimeDeltaCapturedState{
|
return qb.TimeDeltaCapturedState{
|
||||||
H: s.buf[s.pos],
|
H: s.buf[s.pos],
|
||||||
LastUnixtime: s.lastUnixtime,
|
LastUnixtime: s.lastUnixtime,
|
||||||
LastDelta: s.lastDelta,
|
LastDelta: s.lastDelta,
|
||||||
@@ -181,11 +165,6 @@ func (s *TimeDeltaCompressor) CaptureState() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix - повернути в Pool буфери
|
|
||||||
func (s *TimeDeltaCompressor) ForgetCapturedState() {
|
|
||||||
s.state = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// коли сторінка заповнена і відправляється в txlog, since замінюю на until
|
// коли сторінка заповнена і відправляється в txlog, since замінюю на until
|
||||||
func (s *TimeDeltaCompressor) ReplaceSinceWithUntil() uint32 {
|
func (s *TimeDeltaCompressor) ReplaceSinceWithUntil() uint32 {
|
||||||
pos := len(s.buf) - 4
|
pos := len(s.buf) - 4
|
||||||
@@ -218,34 +197,26 @@ func (s *TimeDeltaCompressor) Size() int {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
func (s *TimeDeltaCompressor) WritePayloadTo(w io.Writer) (err error) {
|
func (s *TimeDeltaCompressor) WritePayloadTo(w io.Writer, state *qb.TimeDeltaCapturedState) (err error) {
|
||||||
if s.state == nil {
|
if state == nil {
|
||||||
_, err = w.Write(s.buf[:s.pos])
|
_, err = w.Write(s.buf[:s.pos])
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
_, err = w.Write(s.state.Payload)
|
_, err = w.Write(state.Payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = bin.WriteVarUint64(w, uint64(s.state.LastDelta))
|
_, err = bin.WriteVarUint64(w, uint64(state.LastDelta))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = w.Write([]byte{
|
_, err = w.Write([]byte{
|
||||||
s.state.H,
|
state.H,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// func (s *TimeDeltaCompressor) encodeTail(lastUnixtime, lastDelta uint32, h byte) []byte {
|
|
||||||
// tail := make([]byte, 9)
|
|
||||||
// bin.PutUint32(tail, lastUnixtime)
|
|
||||||
// tail[4] = h
|
|
||||||
// n, _ := bin.PutVarUint64(tail[5:], uint64(lastDelta))
|
|
||||||
// return tail[:n+5]
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (s *TimeDeltaCompressor) Rotate(newbuf []byte) {
|
func (s *TimeDeltaCompressor) Rotate(newbuf []byte) {
|
||||||
// УВАГА!
|
// УВАГА!
|
||||||
// state не чіпаємо
|
// state не чіпаємо
|
||||||
@@ -259,23 +230,11 @@ func (s *TimeDeltaCompressor) CreateDecompressor() qb.TimestampDecompressor {
|
|||||||
if s.pos == len(s.buf) {
|
if s.pos == len(s.buf) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var (
|
|
||||||
h = s.buf[s.pos]
|
|
||||||
lastUnixtime = s.lastUnixtime
|
|
||||||
lastDelta = s.lastDelta
|
|
||||||
payload = s.buf[s.pos:]
|
|
||||||
)
|
|
||||||
if s.state != nil {
|
|
||||||
h = s.state.H
|
|
||||||
lastUnixtime = s.state.LastUnixtime
|
|
||||||
lastDelta = s.state.LastDelta
|
|
||||||
payload = s.state.Payload
|
|
||||||
}
|
|
||||||
return NewTimeDeltaDecompressorFromState(TimeDeltaDecompressorFromStateOptions{
|
return NewTimeDeltaDecompressorFromState(TimeDeltaDecompressorFromStateOptions{
|
||||||
H: h,
|
H: s.buf[s.pos],
|
||||||
LastUnixtime: lastUnixtime,
|
LastUnixtime: s.lastUnixtime,
|
||||||
LastDelta: lastDelta,
|
LastDelta: s.lastDelta,
|
||||||
Payload: payload,
|
Payload: s.buf[s.pos:],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,7 +265,6 @@ func NewTimeDeltaDecompressor(buf []byte) *TimeDeltaDecompressor {
|
|||||||
log.Fatalf("bug: get last unixtime: %s", err)
|
log.Fatalf("bug: get last unixtime: %s", err)
|
||||||
}
|
}
|
||||||
s.pos += 4
|
s.pos += 4
|
||||||
//fmt.Println("restored last unixtime", s.lastUnixtime)
|
|
||||||
} else {
|
} else {
|
||||||
s.done = true
|
s.done = true
|
||||||
}
|
}
|
||||||
@@ -329,15 +287,10 @@ func NewTimeDeltaDecompressorFromState(opt TimeDeltaDecompressorFromStateOptions
|
|||||||
s.lastDelta = opt.LastDelta
|
s.lastDelta = opt.LastDelta
|
||||||
s.decodeHeaderByte(opt.H)
|
s.decodeHeaderByte(opt.H)
|
||||||
}
|
}
|
||||||
//fmt.Println("-------------------")
|
|
||||||
//fmt.Printf("restore from bound: isRun=%t, pending=%d, lastUnix=%d, lastDelta=%d\n",
|
|
||||||
//s.isRun, s.pending, s.lastUnixtime, s.lastDelta)
|
|
||||||
//fmt.Printf("buf: %d\n", s.buf)
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimeDeltaDecompressor) NextValue() (value uint32, done bool) {
|
func (s *TimeDeltaDecompressor) NextValue() (value uint32, done bool) {
|
||||||
//fmt.Printf("NextValue(): pos: %d, isRegular: %t, pending: %d\n", s.pos, s.isRegular, s.pending)
|
|
||||||
if s.done {
|
if s.done {
|
||||||
return 0, true
|
return 0, true
|
||||||
}
|
}
|
||||||
@@ -346,7 +299,6 @@ func (s *TimeDeltaDecompressor) NextValue() (value uint32, done bool) {
|
|||||||
if s.lastDelta > 0 {
|
if s.lastDelta > 0 {
|
||||||
s.lastUnixtime -= s.lastDelta
|
s.lastUnixtime -= s.lastDelta
|
||||||
s.pending--
|
s.pending--
|
||||||
//fmt.Printf("lastUnix: %d, s.pending: %d\n", s.lastUnixtime, s.pending)
|
|
||||||
if s.pending > 0 {
|
if s.pending > 0 {
|
||||||
// якщо в серії залишаються елементи
|
// якщо в серії залишаються елементи
|
||||||
if !s.isRun {
|
if !s.isRun {
|
||||||
@@ -358,7 +310,6 @@ func (s *TimeDeltaDecompressor) NextValue() (value uint32, done bool) {
|
|||||||
s.readHeader()
|
s.readHeader()
|
||||||
s.readDelta()
|
s.readDelta()
|
||||||
} else {
|
} else {
|
||||||
//s.done = true
|
|
||||||
s.lastDelta = 0
|
s.lastDelta = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -372,12 +323,6 @@ func (s *TimeDeltaDecompressor) readHeader() {
|
|||||||
h := s.buf[s.pos]
|
h := s.buf[s.pos]
|
||||||
s.pos++
|
s.pos++
|
||||||
s.decodeHeaderByte(h)
|
s.decodeHeaderByte(h)
|
||||||
// fmt.Println()
|
|
||||||
// fmt.Println("read from pos:", s.pos)
|
|
||||||
// fmt.Println("h:", h)
|
|
||||||
// fmt.Println("isRun:", s.isRun)
|
|
||||||
// fmt.Println("pending:", s.pending)
|
|
||||||
// fmt.Println()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *TimeDeltaDecompressor) decodeHeaderByte(h byte) {
|
func (s *TimeDeltaDecompressor) decodeHeaderByte(h byte) {
|
||||||
@@ -394,11 +339,6 @@ func (s *TimeDeltaDecompressor) readDelta() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
// fmt.Println()
|
|
||||||
// fmt.Println("read from pos:", s.pos)
|
|
||||||
// fmt.Println("read delta:", u64)
|
|
||||||
// fmt.Println("read delta n:", n)
|
|
||||||
// fmt.Println()
|
|
||||||
s.pos += n
|
s.pos += n
|
||||||
s.lastDelta = uint32(u64)
|
s.lastDelta = uint32(u64)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ type ValueDeltaCompressor struct {
|
|||||||
pos int // payload size
|
pos int // payload size
|
||||||
baseValue float64
|
baseValue float64
|
||||||
lastDelta uint64
|
lastDelta uint64
|
||||||
state *ValueDeltaCapturedState
|
|
||||||
// (baseValue, coef, value) => delta
|
// (baseValue, coef, value) => delta
|
||||||
calcDelta func(float64, float64, float64) uint64
|
calcDelta func(float64, float64, float64) uint64
|
||||||
// (value, coef) => uint64
|
// (value, coef) => uint64
|
||||||
@@ -75,18 +74,6 @@ func (s *ValueDeltaCompressor) Evaluate(tmp []byte, value float64) qb.ValueEvalu
|
|||||||
)
|
)
|
||||||
if s.pos > 0 {
|
if s.pos > 0 {
|
||||||
delta = s.calcDelta(s.baseValue, s.coef, value)
|
delta = s.calcDelta(s.baseValue, s.coef, value)
|
||||||
// if false {
|
|
||||||
// delta = uint64((value-s.baseValue)*s.coef + eps)
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// f64 := (value - s.baseValue) * s.coef
|
|
||||||
// if f64 > 0 {
|
|
||||||
// f64 += eps
|
|
||||||
// } else {
|
|
||||||
// f64 -= eps
|
|
||||||
// }
|
|
||||||
// delta = bin.EncodeZigZag(int64(f64))
|
|
||||||
// }
|
|
||||||
h := s.buf[s.pos-1]
|
h := s.buf[s.pos-1]
|
||||||
if h < 128 {
|
if h < 128 {
|
||||||
// run
|
// run
|
||||||
@@ -137,12 +124,6 @@ func (s *ValueDeltaCompressor) Evaluate(tmp []byte, value float64) qb.ValueEvalu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// var baseValue uint64
|
|
||||||
// if false {
|
|
||||||
// baseValue = uint64(value * s.coef)
|
|
||||||
// } else {
|
|
||||||
// baseValue = bin.EncodeZigZag(int64(value * s.coef))
|
|
||||||
// }
|
|
||||||
n, _ := bin.PutVarUint64(tmp, s.toUint64(value, s.coef))
|
n, _ := bin.PutVarUint64(tmp, s.toUint64(value, s.coef))
|
||||||
i += n
|
i += n
|
||||||
n, _ = bin.ReversePutVarUint64(tmp[i:], 0) // delta
|
n, _ = bin.ReversePutVarUint64(tmp[i:], 0) // delta
|
||||||
@@ -173,30 +154,19 @@ func (s *ValueDeltaCompressor) DeleteLast() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ValueDeltaCapturedState struct {
|
func (s *ValueDeltaCompressor) CaptureState() qb.ValueDeltaCapturedState {
|
||||||
H byte
|
// if s.state != nil {
|
||||||
LastDelta uint64
|
// qb.Abort(qb.RepeatableLock, nil)
|
||||||
Payload []byte
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
func (s *ValueDeltaCompressor) CaptureState() {
|
|
||||||
if s.state != nil {
|
|
||||||
qb.Abort(qb.RepeatableLock, nil)
|
|
||||||
}
|
|
||||||
// позиція посувається вліво, отже може перескочити на попередній chunk
|
// позиція посувається вліво, отже може перескочити на попередній chunk
|
||||||
pos := s.pos - 1 - bin.CountVarUint64(s.lastDelta)
|
pos := s.pos - 1 - bin.CountVarUint64(s.lastDelta)
|
||||||
s.state = &ValueDeltaCapturedState{
|
return qb.ValueDeltaCapturedState{
|
||||||
H: s.buf[s.pos-1],
|
H: s.buf[s.pos-1],
|
||||||
LastDelta: s.lastDelta,
|
LastDelta: s.lastDelta,
|
||||||
Payload: s.buf[:pos],
|
Payload: s.buf[:pos],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix - повернути в Pool буфери
|
|
||||||
func (s *ValueDeltaCompressor) ForgetCapturedState() {
|
|
||||||
s.state = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// для зростання буфера під час вставки даних. State не цікавить
|
// для зростання буфера під час вставки даних. State не цікавить
|
||||||
func (s *ValueDeltaCompressor) Size() int {
|
func (s *ValueDeltaCompressor) Size() int {
|
||||||
//if s.state == nil {
|
//if s.state == nil {
|
||||||
@@ -215,21 +185,21 @@ func (s *ValueDeltaCompressor) Size() int {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
func (s *ValueDeltaCompressor) WritePayloadTo(w io.Writer) (err error) {
|
func (s *ValueDeltaCompressor) WritePayloadTo(w io.Writer, state *qb.ValueDeltaCapturedState) (err error) {
|
||||||
if s.state == nil {
|
if state == nil {
|
||||||
_, err = w.Write(s.buf[:s.pos])
|
_, err = w.Write(s.buf[:s.pos])
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
_, err = w.Write(s.state.Payload)
|
_, err = w.Write(state.Payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = bin.WriteVarUint64(w, s.state.LastDelta)
|
_, err = bin.WriteVarUint64(w, state.LastDelta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = w.Write([]byte{
|
_, err = w.Write([]byte{
|
||||||
s.state.H,
|
state.H,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -245,35 +215,27 @@ func (s *ValueDeltaCompressor) Rotate(newbuf []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *ValueDeltaCompressor) LastValue() float64 {
|
func (s *ValueDeltaCompressor) LastValue() float64 {
|
||||||
var delta uint64
|
// FIX
|
||||||
if s.state == nil {
|
// var delta uint64
|
||||||
delta = s.lastDelta
|
// if s.state == nil {
|
||||||
} else {
|
// delta = s.lastDelta
|
||||||
delta = s.state.LastDelta
|
// } else {
|
||||||
}
|
// delta = s.state.LastDelta
|
||||||
return s.baseValue + s.toFloat64(delta, s.coef)
|
// }
|
||||||
|
// return s.baseValue + s.toFloat64(delta, s.coef)
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ValueDeltaCompressor) CreateDecompressor() qb.ValueDecompressor {
|
func (s *ValueDeltaCompressor) CreateDecompressor() qb.ValueDecompressor {
|
||||||
if s.pos == 0 {
|
if s.pos == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var (
|
|
||||||
h = s.buf[s.pos-1]
|
|
||||||
lastDelta = s.lastDelta
|
|
||||||
payload = s.buf[:s.pos]
|
|
||||||
)
|
|
||||||
if s.state != nil {
|
|
||||||
h = s.state.H
|
|
||||||
lastDelta = s.state.LastDelta
|
|
||||||
payload = s.state.Payload
|
|
||||||
}
|
|
||||||
return NewValueDeltaDecompressorFromState(ValueDeltaDecompressorFromStateOptions{
|
return NewValueDeltaDecompressorFromState(ValueDeltaDecompressorFromStateOptions{
|
||||||
Coef: s.coef,
|
Coef: s.coef,
|
||||||
ToFloat64: s.toFloat64,
|
ToFloat64: s.toFloat64,
|
||||||
H: h,
|
H: s.buf[s.pos-1],
|
||||||
LastDelta: lastDelta,
|
LastDelta: s.lastDelta,
|
||||||
Payload: payload,
|
Payload: s.buf[:s.pos],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,17 +264,10 @@ func NewValueDeltaDecompressor(fracDigits byte, buf []byte, toFloat64 func(uint6
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("bug: get base value: %s", err)
|
log.Fatalf("bug: get base value: %s", err)
|
||||||
}
|
}
|
||||||
// if false {
|
|
||||||
// baseValue = float64(u64) / coef
|
|
||||||
// } else {
|
|
||||||
// baseValue = float64(bin.DecodeZigZag(u64)) / coef
|
|
||||||
// }
|
|
||||||
//fmt.Printf("baseValue: %.2f, bound: %d, pos: %d\n", float64(u64)/coef, n, size)
|
|
||||||
s := &ValueDeltaDecompressor{
|
s := &ValueDeltaDecompressor{
|
||||||
buf: buf,
|
buf: buf,
|
||||||
coef: coef,
|
coef: coef,
|
||||||
pos: len(buf), // first free
|
pos: len(buf), // first free
|
||||||
// baseValue: baseValue,
|
|
||||||
bound: n,
|
bound: n,
|
||||||
toFloat64: toFloat64,
|
toFloat64: toFloat64,
|
||||||
}
|
}
|
||||||
@@ -337,32 +292,16 @@ func NewValueDeltaDecompressorFromState(opt ValueDeltaDecompressorFromStateOptio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("bug: get base value: %s", err)
|
log.Fatalf("bug: get base value: %s", err)
|
||||||
}
|
}
|
||||||
// var baseValue float64
|
|
||||||
// if false {
|
|
||||||
// baseValue = float64(u64) / opt.Coef
|
|
||||||
// } else {
|
|
||||||
// baseValue = float64(bin.DecodeZigZag(u64)) / opt.Coef
|
|
||||||
// }
|
|
||||||
//fmt.Printf("baseValue: %.2f, bound: %d, pos: %d\n", float64(u64)/opt.Coef, n, size)
|
|
||||||
s := &ValueDeltaDecompressor{
|
s := &ValueDeltaDecompressor{
|
||||||
buf: opt.Payload,
|
buf: opt.Payload,
|
||||||
coef: opt.Coef,
|
coef: opt.Coef,
|
||||||
pos: len(opt.Payload), // first free
|
pos: len(opt.Payload), // first free
|
||||||
//baseValue: baseValue,
|
|
||||||
bound: n,
|
bound: n,
|
||||||
toFloat64: opt.ToFloat64,
|
toFloat64: opt.ToFloat64,
|
||||||
}
|
}
|
||||||
s.baseValue = s.toFloat64(u64, s.coef)
|
s.baseValue = s.toFloat64(u64, s.coef)
|
||||||
// if false {
|
|
||||||
// s.lastValue = s.baseValue + float64(opt.LastDelta)/s.coef
|
|
||||||
// } else {
|
|
||||||
// s.lastValue = s.baseValue + float64(bin.DecodeZigZag(opt.LastDelta))/s.coef
|
|
||||||
// }
|
|
||||||
s.lastValue = s.baseValue + s.toFloat64(opt.LastDelta, s.coef)
|
s.lastValue = s.baseValue + s.toFloat64(opt.LastDelta, s.coef)
|
||||||
s.decodeHeaderByte(opt.H)
|
s.decodeHeaderByte(opt.H)
|
||||||
//fmt.Printf("payload: %d\n", opt.Payload)
|
|
||||||
//fmt.Printf("restore from state: bound=%d, isRun=%t, pending=%d, baseValue=%v, lastValue=%v\n",
|
|
||||||
// n, s.isRun, s.pending, s.baseValue, s.lastValue)
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,33 +331,17 @@ func (s *ValueDeltaDecompressor) NextValue() (value float64, done bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *ValueDeltaDecompressor) readHeader() {
|
func (s *ValueDeltaDecompressor) readHeader() {
|
||||||
//fmt.Println("read from pos:", s.pos)
|
|
||||||
s.pos--
|
s.pos--
|
||||||
h := s.buf[s.pos]
|
h := s.buf[s.pos]
|
||||||
s.decodeHeaderByte(h)
|
s.decodeHeaderByte(h)
|
||||||
|
|
||||||
// fmt.Println("h:", h)
|
|
||||||
// fmt.Println("isRun:", s.isRun)
|
|
||||||
// fmt.Println("pending:", s.pending)
|
|
||||||
}
|
}
|
||||||
func (s *ValueDeltaDecompressor) readValue() {
|
func (s *ValueDeltaDecompressor) readValue() {
|
||||||
u64, n, err := bin.ReverseGetVarUint64(s.buf[:s.pos])
|
u64, n, err := bin.ReverseGetVarUint64(s.buf[:s.pos])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
// fmt.Println()
|
|
||||||
// fmt.Println("read from pos:", s.pos)
|
|
||||||
// fmt.Println("read delta:", u64)
|
|
||||||
// fmt.Println("read delta n:", n)
|
|
||||||
// fmt.Println()
|
|
||||||
s.pos -= n
|
s.pos -= n
|
||||||
// if false {
|
|
||||||
// s.lastValue = s.baseValue + float64(u64)/s.coef
|
|
||||||
// } else {
|
|
||||||
// s.lastValue = s.baseValue + float64(bin.DecodeZigZag(u64))/s.coef
|
|
||||||
// }
|
|
||||||
s.lastValue = s.baseValue + s.toFloat64(u64, s.coef)
|
s.lastValue = s.baseValue + s.toFloat64(u64, s.coef)
|
||||||
//fmt.Println(s.baseValue, float64(u64)/s.coef)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ValueDeltaDecompressor) decodeHeaderByte(h byte) {
|
func (s *ValueDeltaDecompressor) decodeHeaderByte(h byte) {
|
||||||
|
|||||||
23
qb.go
23
qb.go
@@ -31,17 +31,23 @@ type TimestampCompressor interface {
|
|||||||
Size() int
|
Size() int
|
||||||
//Chunks() [][]byte
|
//Chunks() [][]byte
|
||||||
//DeleteLast()
|
//DeleteLast()
|
||||||
CaptureState()
|
CaptureState() TimeDeltaCapturedState
|
||||||
ForgetCapturedState()
|
|
||||||
CreateDecompressor() TimestampDecompressor
|
CreateDecompressor() TimestampDecompressor
|
||||||
//Payload() []byte // для снапшота
|
//Payload() []byte // для снапшота
|
||||||
// Offset() int
|
// Offset() int
|
||||||
Rotate([]byte)
|
Rotate([]byte)
|
||||||
WritePayloadTo(io.Writer) error
|
WritePayloadTo(io.Writer, *TimeDeltaCapturedState) error
|
||||||
LastTimestamp() uint32
|
LastTimestamp() uint32
|
||||||
ReplaceSinceWithUntil() uint32
|
ReplaceSinceWithUntil() uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TimeDeltaCapturedState struct {
|
||||||
|
H byte
|
||||||
|
LastUnixtime uint32
|
||||||
|
LastDelta uint32
|
||||||
|
Payload []byte
|
||||||
|
}
|
||||||
|
|
||||||
type TimeEvaluationReport struct {
|
type TimeEvaluationReport struct {
|
||||||
TotalSpace int
|
TotalSpace int
|
||||||
Offset int
|
Offset int
|
||||||
@@ -56,17 +62,22 @@ type ValueCompressor interface {
|
|||||||
Size() int
|
Size() int
|
||||||
//Chunks() [][]byte
|
//Chunks() [][]byte
|
||||||
//DeleteLast()
|
//DeleteLast()
|
||||||
CaptureState()
|
CaptureState() ValueDeltaCapturedState
|
||||||
ForgetCapturedState()
|
|
||||||
// fracDigits
|
// fracDigits
|
||||||
CreateDecompressor() ValueDecompressor
|
CreateDecompressor() ValueDecompressor
|
||||||
//Payload() []byte // для снапшота
|
//Payload() []byte // для снапшота
|
||||||
//Offset() int
|
//Offset() int
|
||||||
Rotate([]byte)
|
Rotate([]byte)
|
||||||
WritePayloadTo(io.Writer) error
|
WritePayloadTo(io.Writer, *ValueDeltaCapturedState) error
|
||||||
LastValue() float64
|
LastValue() float64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ValueDeltaCapturedState struct {
|
||||||
|
H byte
|
||||||
|
LastDelta uint64
|
||||||
|
Payload []byte
|
||||||
|
}
|
||||||
|
|
||||||
type ValueEvaluationReport struct {
|
type ValueEvaluationReport struct {
|
||||||
TotalSpace int
|
TotalSpace int
|
||||||
Offset int
|
Offset int
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ type AppendedMeasures struct {
|
|||||||
DataPages []DataPayload
|
DataPages []DataPayload
|
||||||
TailTimestamps []byte // data level tail
|
TailTimestamps []byte // data level tail
|
||||||
TailValues []byte // data level tail
|
TailValues []byte // data level tail
|
||||||
ResultCode int
|
ResultCode byte
|
||||||
WrittenCount int
|
WrittenCount int
|
||||||
ResultCh chan struct{}
|
ResultCh chan struct{}
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ type AppendMeasuresSummary struct {
|
|||||||
MetricID uint32
|
MetricID uint32
|
||||||
LastPageNo uint32
|
LastPageNo uint32
|
||||||
Index []IndexLevelTail
|
Index []IndexLevelTail
|
||||||
ResultCode int
|
ResultCode byte
|
||||||
WrittenCount int
|
WrittenCount int
|
||||||
ResultCh chan struct{}
|
ResultCh chan struct{}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user