2021-11-10 23:56:41 +08:00
|
|
|
// Licensed to the LF AI & Data foundation under one
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
// distributed with this work for additional information
|
|
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance
|
2021-09-06 20:49:04 +08:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-11-10 23:56:41 +08:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-09-06 20:49:04 +08:00
|
|
|
//
|
2021-11-10 23:56:41 +08:00
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2021-09-06 20:49:04 +08:00
|
|
|
|
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-09-26 09:57:25 +08:00
|
|
|
"google.golang.org/grpc"
|
|
|
|
|
2021-09-06 20:49:04 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
|
|
|
|
)
|
|
|
|
|
|
|
|
// use interface tsoAllocator to keep other components testable
|
|
|
|
// include: channelsTimeTickerImpl, baseTaskQueue, taskScheduler
|
|
|
|
type tsoAllocator interface {
|
2023-03-09 18:51:52 +08:00
|
|
|
AllocOne(ctx context.Context) (Timestamp, error)
|
2021-09-06 20:49:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// use timestampAllocatorInterface to keep other components testable
|
2023-06-07 19:34:36 +08:00
|
|
|
//
|
2023-05-19 12:51:23 +08:00
|
|
|
//go:generate mockery --name=timestampAllocatorInterface --filename=mock_tso_test.go --outpkg=proxy --output=. --inpackage --structname=mockTimestampAllocator --with-expecter
|
2021-09-06 20:49:04 +08:00
|
|
|
type timestampAllocatorInterface interface {
|
2023-09-26 09:57:25 +08:00
|
|
|
AllocTimestamp(ctx context.Context, req *rootcoordpb.AllocTimestampRequest, opts ...grpc.CallOption) (*rootcoordpb.AllocTimestampResponse, error)
|
2021-09-06 20:49:04 +08:00
|
|
|
}
|