options.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright 2017 Dgraph Labs, Inc. and Contributors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package options
  17. // ChecksumVerificationMode tells when should DB verify checksum for SSTable blocks.
  18. type ChecksumVerificationMode int
  19. const (
  20. // NoVerification indicates DB should not verify checksum for SSTable blocks.
  21. NoVerification ChecksumVerificationMode = iota
  22. // OnTableRead indicates checksum should be verified while opening SSTtable.
  23. OnTableRead
  24. // OnBlockRead indicates checksum should be verified on every SSTable block read.
  25. OnBlockRead
  26. // OnTableAndBlockRead indicates checksum should be verified
  27. // on SSTable opening and on every block read.
  28. OnTableAndBlockRead
  29. )
  30. // CompressionType specifies how a block should be compressed.
  31. type CompressionType uint32
  32. const (
  33. // None mode indicates that a block is not compressed.
  34. None CompressionType = 0
  35. // Snappy mode indicates that a block is compressed using Snappy algorithm.
  36. Snappy CompressionType = 1
  37. // ZSTD mode indicates that a block is compressed using ZSTD algorithm.
  38. ZSTD CompressionType = 2
  39. )