2022-02-14 06:50:44 +00:00
|
|
|
package page_writer
|
|
|
|
|
|
|
|
type DirtyPages interface {
|
2022-03-14 01:17:35 +00:00
|
|
|
AddPage(offset int64, data []byte, isSequential bool)
|
2022-02-14 06:50:44 +00:00
|
|
|
FlushData() error
|
|
|
|
ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64)
|
|
|
|
GetStorageOptions() (collection, replication string)
|
|
|
|
Destroy()
|
|
|
|
LockForRead(startOffset, stopOffset int64)
|
|
|
|
UnlockForRead(startOffset, stopOffset int64)
|
|
|
|
}
|
|
|
|
|
|
|
|
func max(x, y int64) int64 {
|
|
|
|
if x > y {
|
|
|
|
return x
|
|
|
|
}
|
|
|
|
return y
|
|
|
|
}
|
|
|
|
func min(x, y int64) int64 {
|
|
|
|
if x < y {
|
|
|
|
return x
|
|
|
|
}
|
|
|
|
return y
|
|
|
|
}
|
|
|
|
func minInt(x, y int) int {
|
|
|
|
if x < y {
|
|
|
|
return x
|
|
|
|
}
|
|
|
|
return y
|
|
|
|
}
|