From 768c709937fe8bfc0b0cf8a61887b14ef2bada41 Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Wed, 8 Apr 2020 11:49:43 +0800 Subject: [PATCH] holder.go: fix some logic errors --- holder.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/holder.go b/holder.go index 7fbb1b52c..a73550c21 100644 --- a/holder.go +++ b/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)