mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
holder.go: fix some logic errors
This commit is contained in:
parent
eb73042e82
commit
768c709937
1 changed files with 0 additions and 17 deletions
17
holder.go
17
holder.go
|
|
@ -145,13 +145,6 @@ func (h *Holder) Open() error {
|
|||
return errors.Wrap(err, "creating directory")
|
||||
}
|
||||
|
||||
// Verify that we are not trying to open with v1 translation data.
|
||||
if ok, err := h.hasV1TranslateKeysFile(); err != nil {
|
||||
return errors.Wrap(err, "verify v1 translation file")
|
||||
} else if !ok {
|
||||
return ErrCannotOpenV1TranslateFile
|
||||
}
|
||||
|
||||
// Open path to read all index directories.
|
||||
f, err := os.Open(h.Path)
|
||||
if err != nil {
|
||||
|
|
@ -278,16 +271,6 @@ func (h *Holder) HasData() (bool, error) {
|
|||
return false, nil
|
||||
}
|
||||
|
||||
// hasV1TranslateKeysFile returns true if a v1 translation data file exists on disk.
|
||||
func (h *Holder) hasV1TranslateKeysFile() (bool, error) {
|
||||
if _, err := os.Stat(filepath.Join(h.Path, ".keys")); os.IsNotExist(err) {
|
||||
return true, nil
|
||||
} else if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// availableShardsByIndex returns a bitmap of all shards by indexes.
|
||||
func (h *Holder) availableShardsByIndex() map[string]*roaring.Bitmap {
|
||||
m := make(map[string]*roaring.Bitmap)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue