Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f2575e5f
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f2575e5f
编写于
2月 15, 2023
作者:
C
congqixia
提交者:
GitHub
2月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add unconvert & durationcheck linters and fix issues (#22161)
Signed-off-by:
N
Congqi Xia
<
congqi.xia@zilliz.com
>
上级
5351fee7
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
19 addition
and
17 deletion
+19
-17
.golangci.yml
.golangci.yml
+2
-0
internal/datacoord/mock_test.go
internal/datacoord/mock_test.go
+1
-1
internal/metastore/kv/datacoord/kv_catalog_test.go
internal/metastore/kv/datacoord/kv_catalog_test.go
+1
-1
internal/mq/mqimpl/rocksmq/server/rocksmq_impl_test.go
internal/mq/mqimpl/rocksmq/server/rocksmq_impl_test.go
+4
-4
internal/proxy/impl.go
internal/proxy/impl.go
+1
-1
internal/proxy/util.go
internal/proxy/util.go
+2
-2
internal/querynode/cgo_helper.go
internal/querynode/cgo_helper.go
+2
-2
internal/querynode/reduce.go
internal/querynode/reduce.go
+1
-1
internal/storage/binlog_test.go
internal/storage/binlog_test.go
+1
-1
internal/util/importutil/import_util.go
internal/util/importutil/import_util.go
+2
-2
internal/util/sessionutil/session_util.go
internal/util/sessionutil/session_util.go
+2
-2
未找到文件。
.golangci.yml
浏览文件 @
f2575e5f
...
...
@@ -19,6 +19,8 @@ linters:
-
gosimple
-
gosec
-
revive
-
durationcheck
-
unconvert
# - gocritic
linters-settings
:
...
...
internal/datacoord/mock_test.go
浏览文件 @
f2575e5f
...
...
@@ -298,7 +298,7 @@ func (c *mockDataNodeClient) ShowConfigurations(ctx context.Context, req *intern
func
(
c
*
mockDataNodeClient
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
// TODO(dragondriver): change the id, though it's not important in ut
nodeID
:=
UniqueID
(
c
.
id
)
nodeID
:=
c
.
id
nodeInfos
:=
metricsinfo
.
DataNodeInfos
{
BaseComponentInfos
:
metricsinfo
.
BaseComponentInfos
{
...
...
internal/metastore/kv/datacoord/kv_catalog_test.go
浏览文件 @
f2575e5f
...
...
@@ -796,7 +796,7 @@ func Test_parseBinlogKey(t *testing.T) {
func
verifyBinlogs
(
t
*
testing
.
T
,
binlogBytes
[]
byte
)
{
binlogs
:=
&
datapb
.
FieldBinlog
{}
err
:=
proto
.
Unmarshal
(
[]
byte
(
binlogBytes
)
,
binlogs
)
err
:=
proto
.
Unmarshal
(
binlogBytes
,
binlogs
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
1
,
len
(
binlogs
.
Binlogs
))
assert
.
Equal
(
t
,
int64
(
99
),
binlogs
.
Binlogs
[
0
]
.
GetLogID
())
...
...
internal/mq/mqimpl/rocksmq/server/rocksmq_impl_test.go
浏览文件 @
f2575e5f
...
...
@@ -403,9 +403,9 @@ func TestRocksmq_Dummy(t *testing.T) {
assert
.
Error
(
t
,
err
)
channelName2
:=
strings
.
Repeat
(
channelName1
,
100
)
err
=
rmq
.
CreateTopic
(
string
(
channelName2
)
)
err
=
rmq
.
CreateTopic
(
channelName2
)
assert
.
NoError
(
t
,
err
)
_
,
err
=
rmq
.
Produce
(
string
(
channelName2
)
,
nil
)
_
,
err
=
rmq
.
Produce
(
channelName2
,
nil
)
assert
.
Error
(
t
,
err
)
channelName3
:=
"channel/dummy"
...
...
@@ -950,7 +950,7 @@ func TestRocksmq_GetLatestMsg(t *testing.T) {
assert
.
Nil
(
t
,
err
)
msgID
,
err
:=
rmq
.
GetLatestMsg
(
channelName
)
assert
.
Equal
(
t
,
msgID
,
int64
(
DefaultMessageID
)
)
assert
.
Equal
(
t
,
msgID
,
DefaultMessageID
)
assert
.
Nil
(
t
,
err
)
loopNum
:=
10
...
...
@@ -990,7 +990,7 @@ func TestRocksmq_GetLatestMsg(t *testing.T) {
rmq
.
DestroyTopic
(
channelName
)
rmq
.
Close
()
msgID
,
err
=
rmq
.
GetLatestMsg
(
channelName
)
assert
.
Equal
(
t
,
msgID
,
int64
(
DefaultMessageID
)
)
assert
.
Equal
(
t
,
msgID
,
DefaultMessageID
)
assert
.
NotNil
(
t
,
err
)
}
...
...
internal/proxy/impl.go
浏览文件 @
f2575e5f
...
...
@@ -2270,7 +2270,7 @@ func (node *Proxy) Upsert(ctx context.Context, request *milvuspb.UpsertRequest)
req
:
&
milvuspb
.
UpsertRequest
{
Base
:
commonpbutil
.
NewMsgBase
(
commonpbutil
.
WithMsgType
(
commonpb
.
MsgType
(
commonpb
.
MsgType_Upsert
)
),
commonpbutil
.
WithMsgType
(
commonpb
.
MsgType
_Upsert
),
commonpbutil
.
WithSourceID
(
paramtable
.
GetNodeID
()),
),
CollectionName
:
request
.
CollectionName
,
...
...
internal/proxy/util.go
浏览文件 @
f2575e5f
...
...
@@ -634,8 +634,8 @@ func parseGuaranteeTs(ts, tMax typeutil.Timestamp) typeutil.Timestamp {
case
strongTS
:
ts
=
tMax
case
boundedTS
:
ratio
:=
time
.
Duration
(
-
Params
.
CommonCfg
.
GracefulTime
.
GetAsInt64
()
)
ts
=
tsoutil
.
AddPhysicalDurationOnTs
(
tMax
,
ratio
*
time
.
Millisecond
)
ratio
:=
Params
.
CommonCfg
.
GracefulTime
.
GetAsDuration
(
time
.
Millisecond
)
ts
=
tsoutil
.
AddPhysicalDurationOnTs
(
tMax
,
-
ratio
)
}
return
ts
}
...
...
internal/querynode/cgo_helper.go
浏览文件 @
f2575e5f
...
...
@@ -70,8 +70,8 @@ func HandleCProto(cRes *C.CProto, msg proto.Message) error {
// CopyCProtoBlob returns the copy of C memory
func
CopyCProtoBlob
(
cProto
*
C
.
CProto
)
[]
byte
{
blob
:=
C
.
GoBytes
(
unsafe
.
Pointer
(
cProto
.
proto_blob
)
,
C
.
int32_t
(
cProto
.
proto_size
))
C
.
free
(
unsafe
.
Pointer
(
cProto
.
proto_blob
)
)
blob
:=
C
.
GoBytes
(
cProto
.
proto_blob
,
C
.
int32_t
(
cProto
.
proto_size
))
C
.
free
(
cProto
.
proto_blob
)
return
blob
}
...
...
internal/querynode/reduce.go
浏览文件 @
f2575e5f
...
...
@@ -90,7 +90,7 @@ func reduceSearchResultsAndFillData(plan *SearchPlan, searchResults []*SearchRes
}
cSearchResults
=
append
(
cSearchResults
,
res
.
cSearchResult
)
}
cSearchResultPtr
:=
(
*
C
.
CSearchResult
)(
&
cSearchResults
[
0
])
cSearchResultPtr
:=
&
cSearchResults
[
0
]
cNumSegments
:=
C
.
int64_t
(
numSegments
)
var
cSliceNQSPtr
=
(
*
C
.
int64_t
)(
&
sliceNQs
[
0
])
var
cSliceTopKSPtr
=
(
*
C
.
int64_t
)(
&
sliceTopKs
[
0
])
...
...
internal/storage/binlog_test.go
浏览文件 @
f2575e5f
...
...
@@ -1293,7 +1293,7 @@ func TestNewBinlogReaderError(t *testing.T) {
assert
.
NotNil
(
t
,
err
)
buffer
:=
new
(
bytes
.
Buffer
)
err
=
binary
.
Write
(
buffer
,
common
.
Endian
,
int32
(
MagicNumber
)
)
err
=
binary
.
Write
(
buffer
,
common
.
Endian
,
MagicNumber
)
assert
.
Nil
(
t
,
err
)
data
=
buffer
.
Bytes
()
...
...
internal/util/importutil/import_util.go
浏览文件 @
f2575e5f
...
...
@@ -503,12 +503,12 @@ func getTypeName(dt schemapb.DataType) string {
func
pkToShard
(
pk
interface
{},
shardNum
uint32
)
(
uint32
,
error
)
{
var
shard
uint32
strPK
,
ok
:=
interface
{}(
pk
)
.
(
string
)
strPK
,
ok
:=
pk
.
(
string
)
if
ok
{
hash
:=
typeutil
.
HashString2Uint32
(
strPK
)
shard
=
hash
%
shardNum
}
else
{
intPK
,
ok
:=
interface
{}(
pk
)
.
(
int64
)
intPK
,
ok
:=
pk
.
(
int64
)
if
!
ok
{
log
.
Error
(
"Numpy parser: primary key field must be int64 or varchar"
)
return
0
,
fmt
.
Errorf
(
"primary key field must be int64 or varchar"
)
...
...
internal/util/sessionutil/session_util.go
浏览文件 @
f2575e5f
...
...
@@ -634,7 +634,7 @@ func (w *sessionWatcher) handleWatchResponse(wresp clientv3.WatchResponse) {
case
mvccpb
.
PUT
:
log
.
Debug
(
"watch services"
,
zap
.
Any
(
"add kv"
,
ev
.
Kv
))
err
:=
json
.
Unmarshal
(
[]
byte
(
ev
.
Kv
.
Value
)
,
session
)
err
:=
json
.
Unmarshal
(
ev
.
Kv
.
Value
,
session
)
if
err
!=
nil
{
log
.
Error
(
"watch services"
,
zap
.
Error
(
err
))
continue
...
...
@@ -650,7 +650,7 @@ func (w *sessionWatcher) handleWatchResponse(wresp clientv3.WatchResponse) {
case
mvccpb
.
DELETE
:
log
.
Debug
(
"watch services"
,
zap
.
Any
(
"delete kv"
,
ev
.
PrevKv
))
err
:=
json
.
Unmarshal
(
[]
byte
(
ev
.
PrevKv
.
Value
)
,
session
)
err
:=
json
.
Unmarshal
(
ev
.
PrevKv
.
Value
,
session
)
if
err
!=
nil
{
log
.
Error
(
"watch services"
,
zap
.
Error
(
err
))
continue
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录