2020-10-28 15:38:24 +08:00
|
|
|
package master
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-11-03 14:53:36 +08:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/master/id"
|
2020-11-12 17:58:05 +08:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/master/tso"
|
2020-10-28 15:38:24 +08:00
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb"
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/servicepb"
|
|
|
|
)
|
|
|
|
|
2020-10-29 09:31:08 +08:00
|
|
|
const slowThreshold = 5 * time.Millisecond
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) CreateCollection(ctx context.Context, in *internalpb.CreateCollectionRequest) (*commonpb.Status, error) {
|
2020-10-28 15:38:24 +08:00
|
|
|
var t task = &createCollectionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response := &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Reason = "Enqueue failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Reason = "Create collection failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response.ErrorCode = commonpb.ErrorCode_SUCCESS
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) DropCollection(ctx context.Context, in *internalpb.DropCollectionRequest) (*commonpb.Status, error) {
|
|
|
|
var t task = &dropCollectionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-29 12:39:41 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response := &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Reason = "Enqueue failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Reason = "Drop collection failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response.ErrorCode = commonpb.ErrorCode_SUCCESS
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) HasCollection(ctx context.Context, in *internalpb.HasCollectionRequest) (*servicepb.BoolResponse, error) {
|
|
|
|
var t task = &hasCollectionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-29 12:39:41 +08:00
|
|
|
},
|
|
|
|
hasCollection: false,
|
|
|
|
}
|
|
|
|
|
2020-11-13 12:46:24 +08:00
|
|
|
st := &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
}
|
|
|
|
|
|
|
|
response := &servicepb.BoolResponse{
|
|
|
|
Status: st,
|
2020-11-13 15:44:02 +08:00
|
|
|
Value: false,
|
2020-11-13 12:46:24 +08:00
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
st.Reason = "Enqueue failed: " + err.Error()
|
2020-11-13 12:46:24 +08:00
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
st.Reason = "Has collection failed: " + err.Error()
|
2020-11-13 12:46:24 +08:00
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-11-13 12:46:24 +08:00
|
|
|
st.ErrorCode = commonpb.ErrorCode_SUCCESS
|
2020-11-13 15:44:02 +08:00
|
|
|
response.Value = t.(*hasCollectionTask).hasCollection
|
2020-11-13 12:46:24 +08:00
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) DescribeCollection(ctx context.Context, in *internalpb.DescribeCollectionRequest) (*servicepb.CollectionDescription, error) {
|
|
|
|
var t task = &describeCollectionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
2020-10-29 12:39:41 +08:00
|
|
|
description: nil,
|
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response := &servicepb.CollectionDescription{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
},
|
|
|
|
Schema: nil,
|
|
|
|
}
|
|
|
|
|
|
|
|
t.(*describeCollectionTask).description = response
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Status.Reason = "Enqueue failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Status.Reason = "Describe collection failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-11-14 13:06:41 +08:00
|
|
|
response.Status.ErrorCode = commonpb.ErrorCode_SUCCESS
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) ShowCollections(ctx context.Context, in *internalpb.ShowCollectionRequest) (*servicepb.StringListResponse, error) {
|
|
|
|
var t task = &showCollectionsTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
2020-10-29 12:39:41 +08:00
|
|
|
stringListResponse: nil,
|
|
|
|
}
|
|
|
|
|
2020-11-14 15:37:07 +08:00
|
|
|
response := &servicepb.StringListResponse{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "",
|
|
|
|
},
|
|
|
|
Values: nil,
|
|
|
|
}
|
|
|
|
|
|
|
|
t.(*showCollectionsTask).stringListResponse = response
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 15:37:07 +08:00
|
|
|
response.Status.Reason = "Enqueue filed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 15:37:07 +08:00
|
|
|
response.Status.Reason = "Show Collections failed: " + err.Error()
|
|
|
|
return response, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-11-14 15:37:07 +08:00
|
|
|
response.Status.ErrorCode = commonpb.ErrorCode_SUCCESS
|
|
|
|
return response, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
func (s *Master) CreatePartition(ctx context.Context, in *internalpb.CreatePartitionRequest) (*commonpb.Status, error) {
|
|
|
|
var t task = &createPartitionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-29 12:39:41 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
|
|
|
return &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "Enqueue failed",
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "WaitToFinish failed",
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-10-28 15:38:24 +08:00
|
|
|
return &commonpb.Status{
|
2020-10-29 12:39:41 +08:00
|
|
|
ErrorCode: commonpb.ErrorCode_SUCCESS,
|
2020-10-28 15:38:24 +08:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) DropPartition(ctx context.Context, in *internalpb.DropPartitionRequest) (*commonpb.Status, error) {
|
|
|
|
var t task = &dropPartitionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-29 12:39:41 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
|
|
|
return &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "Enqueue failed",
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "WaitToFinish failed",
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-10-28 15:38:24 +08:00
|
|
|
return &commonpb.Status{
|
2020-10-29 12:39:41 +08:00
|
|
|
ErrorCode: commonpb.ErrorCode_SUCCESS,
|
2020-10-28 15:38:24 +08:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) HasPartition(ctx context.Context, in *internalpb.HasPartitionRequest) (*servicepb.BoolResponse, error) {
|
|
|
|
var t task = &hasPartitionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-29 12:39:41 +08:00
|
|
|
},
|
|
|
|
hasPartition: false,
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
|
|
|
return &servicepb.BoolResponse{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "Enqueue failed",
|
|
|
|
},
|
|
|
|
Value: t.(*hasPartitionTask).hasPartition,
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return &servicepb.BoolResponse{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "WaitToFinish failed",
|
|
|
|
},
|
|
|
|
Value: t.(*hasPartitionTask).hasPartition,
|
2020-11-13 17:20:13 +08:00
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
2020-10-28 15:38:24 +08:00
|
|
|
return &servicepb.BoolResponse{
|
|
|
|
Status: &commonpb.Status{
|
2020-10-29 12:39:41 +08:00
|
|
|
ErrorCode: commonpb.ErrorCode_SUCCESS,
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
2020-10-29 12:39:41 +08:00
|
|
|
Value: t.(*hasPartitionTask).hasPartition,
|
2020-10-28 15:38:24 +08:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) DescribePartition(ctx context.Context, in *internalpb.DescribePartitionRequest) (*servicepb.PartitionDescription, error) {
|
|
|
|
var t task = &describePartitionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
2020-10-29 12:39:41 +08:00
|
|
|
description: nil,
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-13 17:20:13 +08:00
|
|
|
return &servicepb.PartitionDescription{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "Enqueue failed",
|
|
|
|
},
|
|
|
|
Name: in.PartitionName,
|
|
|
|
Statistics: nil,
|
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-13 17:20:13 +08:00
|
|
|
return &servicepb.PartitionDescription{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "WaitToFinish failed",
|
|
|
|
},
|
|
|
|
Name: in.PartitionName,
|
|
|
|
Statistics: nil,
|
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return t.(*describePartitionTask).description, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
|
|
|
|
2020-10-29 12:39:41 +08:00
|
|
|
func (s *Master) ShowPartitions(ctx context.Context, in *internalpb.ShowPartitionRequest) (*servicepb.StringListResponse, error) {
|
|
|
|
var t task = &showPartitionTask{
|
|
|
|
req: in,
|
|
|
|
baseTask: baseTask{
|
2020-11-06 16:47:18 +08:00
|
|
|
kvBase: s.kvBase,
|
2020-11-12 11:18:23 +08:00
|
|
|
mt: s.mt,
|
|
|
|
cv: make(chan error),
|
2020-10-28 15:38:24 +08:00
|
|
|
},
|
2020-10-29 12:39:41 +08:00
|
|
|
stringListResponse: nil,
|
|
|
|
}
|
|
|
|
|
2020-11-12 11:18:23 +08:00
|
|
|
var err = s.scheduler.Enqueue(t)
|
2020-10-29 12:39:41 +08:00
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
return &servicepb.StringListResponse{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "Enqueue failed",
|
|
|
|
},
|
|
|
|
Values: nil,
|
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
err = t.WaitToFinish(ctx)
|
|
|
|
if err != nil {
|
2020-11-14 13:06:41 +08:00
|
|
|
return &servicepb.StringListResponse{
|
|
|
|
Status: &commonpb.Status{
|
|
|
|
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
|
|
|
|
Reason: "WaitToFinish failed",
|
|
|
|
},
|
|
|
|
Values: nil,
|
|
|
|
}, nil
|
2020-10-29 12:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return t.(*showPartitionTask).stringListResponse, nil
|
2020-10-28 15:38:24 +08:00
|
|
|
}
|
2020-10-29 09:31:08 +08:00
|
|
|
|
|
|
|
//----------------------------------------Internal GRPC Service--------------------------------
|
|
|
|
|
2020-11-03 14:53:36 +08:00
|
|
|
func (s *Master) AllocTimestamp(ctx context.Context, request *internalpb.TsoRequest) (*internalpb.TsoResponse, error) {
|
|
|
|
count := request.GetCount()
|
2020-11-12 11:18:23 +08:00
|
|
|
ts, err := tso.Alloc(count)
|
2020-11-03 14:53:36 +08:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return &internalpb.TsoResponse{
|
|
|
|
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR},
|
2020-11-14 14:39:52 +08:00
|
|
|
}, nil
|
2020-11-03 14:53:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
response := &internalpb.TsoResponse{
|
2020-11-14 15:26:14 +08:00
|
|
|
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS},
|
2020-11-03 14:53:36 +08:00
|
|
|
Timestamp: ts,
|
|
|
|
Count: count,
|
|
|
|
}
|
|
|
|
|
|
|
|
return response, nil
|
|
|
|
}
|
|
|
|
|
2020-11-13 15:17:18 +08:00
|
|
|
func (s *Master) AllocID(ctx context.Context, request *internalpb.IDRequest) (*internalpb.IDResponse, error) {
|
2020-11-03 14:53:36 +08:00
|
|
|
count := request.GetCount()
|
|
|
|
ts, err := id.AllocOne()
|
|
|
|
|
|
|
|
if err != nil {
|
2020-11-13 15:17:18 +08:00
|
|
|
return &internalpb.IDResponse{
|
2020-11-03 14:53:36 +08:00
|
|
|
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR},
|
2020-11-14 14:39:52 +08:00
|
|
|
}, nil
|
2020-11-03 14:53:36 +08:00
|
|
|
}
|
|
|
|
|
2020-11-13 15:17:18 +08:00
|
|
|
response := &internalpb.IDResponse{
|
2020-11-14 15:26:14 +08:00
|
|
|
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS},
|
2020-11-13 15:17:18 +08:00
|
|
|
ID: ts,
|
2020-11-03 14:53:36 +08:00
|
|
|
Count: count,
|
|
|
|
}
|
|
|
|
|
|
|
|
return response, nil
|
|
|
|
}
|