2021-10-09 10:03:34 +00: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-04-19 11:28:11 +00:00
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
2021-10-09 10:03:34 +00:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-04-19 11:28:11 +00:00
|
|
|
//
|
2021-10-09 10:03:34 +00: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-04-19 11:28:11 +00:00
|
|
|
|
2021-02-01 03:36:59 +00:00
|
|
|
package components
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-06-08 17:28:37 +00:00
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
|
2022-04-07 14:05:32 +00:00
|
|
|
"github.com/milvus-io/milvus/internal/util/dependency"
|
2023-04-06 11:14:32 +00:00
|
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
|
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
2021-02-01 03:36:59 +00:00
|
|
|
)
|
|
|
|
|
2021-09-27 11:04:08 +00:00
|
|
|
// IndexCoord implements IndexCoord grpc server
|
2023-09-21 01:45:27 +00:00
|
|
|
type IndexCoord struct{}
|
2021-02-01 03:36:59 +00:00
|
|
|
|
2021-06-21 09:28:03 +00:00
|
|
|
// NewIndexCoord creates a new IndexCoord
|
2022-04-07 14:05:32 +00:00
|
|
|
func NewIndexCoord(ctx context.Context, factory dependency.Factory) (*IndexCoord, error) {
|
2023-01-06 06:21:37 +00:00
|
|
|
return &IndexCoord{}, nil
|
2021-02-01 03:36:59 +00:00
|
|
|
}
|
2021-06-18 07:20:08 +00:00
|
|
|
|
2024-09-26 13:23:16 +00:00
|
|
|
func (s *IndexCoord) Prepare() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-06-18 07:20:08 +00:00
|
|
|
// Run starts service
|
|
|
|
func (s *IndexCoord) Run() error {
|
2023-01-06 06:21:37 +00:00
|
|
|
log.Info("IndexCoord running ...")
|
2021-02-01 03:36:59 +00:00
|
|
|
return nil
|
|
|
|
}
|
2021-06-18 07:20:08 +00:00
|
|
|
|
|
|
|
// Stop terminates service
|
|
|
|
func (s *IndexCoord) Stop() error {
|
2023-01-06 06:21:37 +00:00
|
|
|
log.Info("IndexCoord stopping ...")
|
2021-02-01 03:36:59 +00:00
|
|
|
return nil
|
|
|
|
}
|
2021-09-22 08:18:21 +00:00
|
|
|
|
2021-09-27 11:04:08 +00:00
|
|
|
// GetComponentStates returns indexnode's states
|
2022-10-14 06:19:24 +00:00
|
|
|
func (s *IndexCoord) Health(ctx context.Context) commonpb.StateCode {
|
2023-01-06 06:21:37 +00:00
|
|
|
return commonpb.StateCode_Healthy
|
2022-10-14 06:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *IndexCoord) GetName() string {
|
|
|
|
return typeutil.IndexCoordRole
|
2021-09-22 08:18:21 +00:00
|
|
|
}
|