mirror of
https://github.com/taigrr/bitcask
synced 2025-01-18 04:03:17 -08:00
move error definition to errors file
This commit is contained in:
parent
0acd498992
commit
6444849ada
@ -3,7 +3,6 @@ package bitcask
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
"io"
|
"io"
|
||||||
@ -34,8 +33,6 @@ const (
|
|||||||
ttlIndexFile = "ttl_index"
|
ttlIndexFile = "ttl_index"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrContextDeadlineExceeded = errors.New("Context deadline exceeded.")
|
|
||||||
|
|
||||||
// Bitcask is a struct that represents a on-disk LSM and WAL data structure
|
// Bitcask is a struct that represents a on-disk LSM and WAL data structure
|
||||||
// and in-memory hash of key/value pairs as per the Bitcask paper and seen
|
// and in-memory hash of key/value pairs as per the Bitcask paper and seen
|
||||||
// in the Riak database.
|
// in the Riak database.
|
||||||
|
14
v2/errors.go
14
v2/errors.go
@ -35,12 +35,17 @@ var (
|
|||||||
// ErrInvalidRange is the error returned when the range scan is invalid
|
// ErrInvalidRange is the error returned when the range scan is invalid
|
||||||
ErrInvalidRange = errors.New("error: invalid range")
|
ErrInvalidRange = errors.New("error: invalid range")
|
||||||
|
|
||||||
// ErrInvalidVersion is the error returned when the database version is invalid
|
// ErrInvalidVersion is the error returned when the database version is
|
||||||
|
// invalid
|
||||||
ErrInvalidVersion = errors.New("error: invalid db version")
|
ErrInvalidVersion = errors.New("error: invalid db version")
|
||||||
|
|
||||||
// ErrMergeInProgress is the error returned if merge is called when already a merge
|
// ErrMergeInProgress is the error returned if merge is called when already
|
||||||
// is in progress
|
// a merge is in progress
|
||||||
ErrMergeInProgress = errors.New("error: merge already in progress")
|
ErrMergeInProgress = errors.New("error: merge already in progress")
|
||||||
|
|
||||||
|
// ErrContextDeadlineExceeded occurs when a call to bitcask doesn't finish
|
||||||
|
// before the caller's context Deadline expires
|
||||||
|
ErrContextDeadlineExceeded = errors.New("Context deadline exceeded.")
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrBadConfig is the error returned on failure to load the database config
|
// ErrBadConfig is the error returned on failure to load the database config
|
||||||
@ -59,7 +64,8 @@ func (e *ErrBadConfig) Error() string {
|
|||||||
return fmt.Sprintf("error reading config.json: %s", e.Err)
|
return fmt.Sprintf("error reading config.json: %s", e.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrBadMetadata is the error returned on failure to load the database metadata
|
// ErrBadMetadata is the error returned on failure to load the database
|
||||||
|
// metadata
|
||||||
type ErrBadMetadata struct {
|
type ErrBadMetadata struct {
|
||||||
Err error
|
Err error
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user