milvus/internal/querynode/streaming.go
bigsheeper 8aae0f7cc9
Refactor flow graph and load/watchDML in query node (#5682)
* Refactor flow graph and load/watchDML in query node

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2021-06-09 11:37:55 +08:00

56 lines
1.4 KiB
Go

// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// 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.
package querynode
import (
"context"
"github.com/milvus-io/milvus/internal/msgstream"
)
type streaming struct {
ctx context.Context
replica ReplicaInterface
tSafeReplica TSafeReplicaInterface
dataSyncService *dataSyncService
msFactory msgstream.Factory
}
func newStreaming(ctx context.Context, factory msgstream.Factory) *streaming {
replica := newCollectionReplica()
tReplica := newTSafeReplica()
newDS := newDataSyncService(ctx, replica, tReplica, factory)
return &streaming{
replica: replica,
tSafeReplica: tReplica,
dataSyncService: newDS,
}
}
func (s *streaming) start() {
// TODO: start stats
}
func (s *streaming) close() {
// TODO: stop stats
if s.dataSyncService != nil {
s.dataSyncService.close()
}
// free collectionReplica
s.replica.freeAll()
}