mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
enhance: Resolve existing lint issues (#40797)
This PR - Format import issues in datacoord & datanode - Fix JSONPathIndex naming issue Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
e23f429299
commit
77515310b9
@ -20,24 +20,24 @@ import (
|
||||
"github.com/milvus-io/milvus/pkg/v2/common"
|
||||
)
|
||||
|
||||
var _ Index = &JsonPathIndex{}
|
||||
var _ Index = &JSONPathIndex{}
|
||||
|
||||
// JsonPathIndex is the pre-defined index model for json path scalar index.
|
||||
type JsonPathIndex struct {
|
||||
// JSONPathIndex is the pre-defined index model for json path scalar index.
|
||||
type JSONPathIndex struct {
|
||||
scalarIndex
|
||||
jsonCastType string
|
||||
jsonPath string
|
||||
}
|
||||
|
||||
// WithIndexName setup the index name of JsonPathIndex.
|
||||
func (idx *JsonPathIndex) WithIndexName(name string) *JsonPathIndex {
|
||||
func (idx *JSONPathIndex) WithIndexName(name string) *JSONPathIndex {
|
||||
idx.name = name
|
||||
return idx
|
||||
}
|
||||
|
||||
// Params implements Index interface
|
||||
// returns the create index related parameters.
|
||||
func (idx *JsonPathIndex) Params() map[string]string {
|
||||
func (idx *JSONPathIndex) Params() map[string]string {
|
||||
return map[string]string{
|
||||
IndexTypeKey: string(idx.indexType),
|
||||
common.JSONCastTypeKey: idx.jsonCastType,
|
||||
@ -45,9 +45,9 @@ func (idx *JsonPathIndex) Params() map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
// NewJsonPathIndex creates a `JsonPathIndex` with provided parameters.
|
||||
func NewJsonPathIndex(indexType IndexType, jsonCastType string, jsonPath string) *JsonPathIndex {
|
||||
return &JsonPathIndex{
|
||||
// NewJSONPathIndex creates a `JsonPathIndex` with provided parameters.
|
||||
func NewJSONPathIndex(indexType IndexType, jsonCastType string, jsonPath string) *JSONPathIndex {
|
||||
return &JSONPathIndex{
|
||||
scalarIndex: scalarIndex{
|
||||
indexType: indexType,
|
||||
},
|
||||
|
||||
@ -36,7 +36,7 @@ func TestJsonPathIndex(t *testing.T) {
|
||||
indexType := indexTypes[rand.Intn(len(indexTypes))]
|
||||
castType := jsonCastTypes[rand.Intn(len(jsonCastTypes))]
|
||||
|
||||
idx := NewJsonPathIndex(indexType, castType, jsonPath).WithIndexName(indexName)
|
||||
idx := NewJSONPathIndex(indexType, castType, jsonPath).WithIndexName(indexName)
|
||||
assert.Equal(t, indexType, idx.IndexType())
|
||||
assert.Equal(t, indexName, idx.Name())
|
||||
|
||||
|
||||
@ -19,9 +19,10 @@ package datacoord
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"strconv"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/metastore"
|
||||
"github.com/milvus-io/milvus/pkg/v2/log"
|
||||
|
||||
@ -26,6 +26,7 @@ package index
|
||||
#include "indexbuilder/init_c.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
package index
|
||||
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
@ -20,13 +20,12 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/dependency"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/internal/storage"
|
||||
"github.com/milvus-io/milvus/internal/util/dependency"
|
||||
"github.com/milvus-io/milvus/pkg/v2/common"
|
||||
"github.com/milvus-io/milvus/pkg/v2/proto/etcdpb"
|
||||
"github.com/milvus-io/milvus/pkg/v2/proto/indexpb"
|
||||
|
||||
@ -26,6 +26,7 @@ package index
|
||||
#include "indexbuilder/init_c.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"github.com/cockroachdb/errors"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user