dirty_pages.go 437 B

12345678910111213141516171819202122232425262728
  1. package page_writer
  2. type DirtyPages interface {
  3. AddPage(offset int64, data []byte)
  4. FlushData() error
  5. ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64)
  6. GetStorageOptions() (collection, replication string)
  7. Destroy()
  8. }
  9. func max(x, y int64) int64 {
  10. if x > y {
  11. return x
  12. }
  13. return y
  14. }
  15. func min(x, y int64) int64 {
  16. if x < y {
  17. return x
  18. }
  19. return y
  20. }
  21. func minInt(x, y int) int {
  22. if x < y {
  23. return x
  24. }
  25. return y
  26. }