mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
#33285 - add segment alloc interceptor for streamingnode. - add add manual alloc segment rpc for datacoord. --------- Signed-off-by: chyezh <chyezh@outlook.com>
28 lines
772 B
Go
28 lines
772 B
Go
package manager
|
|
|
|
import (
|
|
"go.uber.org/atomic"
|
|
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors/segment/stats"
|
|
)
|
|
|
|
// AssignSegmentRequest is a request to allocate segment.
|
|
type AssignSegmentRequest struct {
|
|
CollectionID int64
|
|
PartitionID int64
|
|
InsertMetrics stats.InsertMetrics
|
|
}
|
|
|
|
// AssignSegmentResult is a result of segment allocation.
|
|
// The sum of Results.Row is equal to InserMetrics.NumRows.
|
|
type AssignSegmentResult struct {
|
|
SegmentID int64
|
|
Acknowledge *atomic.Int32 // used to ack the segment assign result has been consumed
|
|
}
|
|
|
|
// Ack acks the segment assign result has been consumed.
|
|
// Must be only call once after the segment assign result has been consumed.
|
|
func (r *AssignSegmentResult) Ack() {
|
|
r.Acknowledge.Dec()
|
|
}
|