mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: Elastic Search return correct kv error
fix https://github.com/chrislusf/seaweedfs/issues/1452
This commit is contained in:
parent
d80538a187
commit
44b3f2efc8
|
@ -3,9 +3,9 @@ package elastic
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
elastic "github.com/olivere/elastic/v7"
|
elastic "github.com/olivere/elastic/v7"
|
||||||
)
|
)
|
||||||
|
@ -32,7 +32,7 @@ func (store *ElasticStore) KvGet(ctx context.Context, key []byte) (value []byte,
|
||||||
Id(string(key)).
|
Id(string(key)).
|
||||||
Do(ctx)
|
Do(ctx)
|
||||||
if elastic.IsNotFound(err) {
|
if elastic.IsNotFound(err) {
|
||||||
return nil, filer_pb.ErrNotFound
|
return nil, filer.ErrKvNotFound
|
||||||
}
|
}
|
||||||
if searchResult != nil && searchResult.Found {
|
if searchResult != nil && searchResult.Found {
|
||||||
esEntry := &ESKVEntry{}
|
esEntry := &ESKVEntry{}
|
||||||
|
@ -41,7 +41,7 @@ func (store *ElasticStore) KvGet(ctx context.Context, key []byte) (value []byte,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glog.Errorf("find key(%s),%v.", string(key), err)
|
glog.Errorf("find key(%s),%v.", string(key), err)
|
||||||
return nil, filer_pb.ErrNotFound
|
return nil, filer.ErrKvNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
func (store *ElasticStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
|
func (store *ElasticStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
|
||||||
|
|
Loading…
Reference in a new issue