Documentation
¶
Index ¶
- Variables
- type Physical
- func (p *Physical) ActivityStatus() string
- func (p *Physical) AddReplica(replica string) error
- func (p *Physical) AdjustReplicas(count int, nodes cluster.NodeSelector) error
- func (p Physical) BelongsToNode() string
- func (p Physical) DeepCopy() Physical
- func (p *Physical) DeleteReplica(replica string) error
- func (p *Physical) IsLocalShard(nodeName string) bool
- type RemoteIncomingRepo
- type RemoteIncomingSchema
- type RemoteIndex
- func (ri *RemoteIndex) Aggregate(ctx context.Context, shard string, params aggregation.Params) (*aggregation.Result, error)
- func (ri *RemoteIndex) BatchAddReferences(ctx context.Context, shardName string, refs objects.BatchReferences, ...) []error
- func (ri *RemoteIndex) BatchPutObjects(ctx context.Context, shardName string, objs []*storobj.Object, ...) []error
- func (ri *RemoteIndex) DeleteObject(ctx context.Context, shardName string, id strfmt.UUID, deletionTime time.Time, ...) error
- func (ri *RemoteIndex) DeleteObjectBatch(ctx context.Context, shardName string, uuids []strfmt.UUID, ...) objects.BatchSimpleObjects
- func (ri *RemoteIndex) Exists(ctx context.Context, shardName string, id strfmt.UUID) (bool, error)
- func (ri *RemoteIndex) FindUUIDs(ctx context.Context, shardName string, filters *filters.LocalFilter) ([]strfmt.UUID, error)
- func (ri *RemoteIndex) GetObject(ctx context.Context, shardName string, id strfmt.UUID, ...) (*storobj.Object, error)
- func (ri *RemoteIndex) GetShardQueueSize(ctx context.Context, shardName string) (int64, error)
- func (ri *RemoteIndex) GetShardStatus(ctx context.Context, shardName string) (string, error)
- func (ri *RemoteIndex) MergeObject(ctx context.Context, shardName string, mergeDoc objects.MergeDocument, ...) error
- func (ri *RemoteIndex) MultiGetObjects(ctx context.Context, shardName string, ids []strfmt.UUID) ([]*storobj.Object, error)
- func (ri *RemoteIndex) PutObject(ctx context.Context, shardName string, obj *storobj.Object, ...) error
- func (ri *RemoteIndex) SearchAllReplicas(ctx context.Context, log logrus.FieldLogger, shard string, ...) ([]ReplicasSearchResult, error)
- func (ri *RemoteIndex) SearchShard(ctx context.Context, shard string, queryVec []models.Vector, ...) ([]*storobj.Object, []float32, string, error)
- func (ri *RemoteIndex) UpdateShardStatus(ctx context.Context, shardName, targetStatus string, schemaVersion uint64) error
- type RemoteIndexClient
- type RemoteIndexIncoming
- func (rii *RemoteIndexIncoming) AddAsyncReplicationTargetNode(ctx context.Context, indexName, shardName string, ...) error
- func (rii *RemoteIndexIncoming) Aggregate(ctx context.Context, indexName, shardName string, params aggregation.Params) (*aggregation.Result, error)
- func (rii *RemoteIndexIncoming) BatchAddReferences(ctx context.Context, indexName, shardName string, refs objects.BatchReferences, ...) []error
- func (rii *RemoteIndexIncoming) BatchPutObjects(ctx context.Context, indexName, shardName string, objs []*storobj.Object, ...) []error
- func (rii *RemoteIndexIncoming) CreateShard(ctx context.Context, indexName, shardName string) error
- func (rii *RemoteIndexIncoming) DeleteObject(ctx context.Context, indexName, shardName string, id strfmt.UUID, ...) error
- func (rii *RemoteIndexIncoming) DeleteObjectBatch(ctx context.Context, indexName, shardName string, uuids []strfmt.UUID, ...) objects.BatchSimpleObjects
- func (rii *RemoteIndexIncoming) DigestObjects(ctx context.Context, indexName, shardName string, ids []strfmt.UUID) ([]types.RepairResponse, error)
- func (rii *RemoteIndexIncoming) DigestObjectsInRange(ctx context.Context, indexName, shardName string, ...) ([]types.RepairResponse, error)
- func (rii *RemoteIndexIncoming) Exists(ctx context.Context, indexName, shardName string, id strfmt.UUID) (bool, error)
- func (rii *RemoteIndexIncoming) FilePutter(ctx context.Context, indexName, shardName, filePath string) (io.WriteCloser, error)
- func (rii *RemoteIndexIncoming) FindUUIDs(ctx context.Context, indexName, shardName string, filters *filters.LocalFilter) ([]strfmt.UUID, error)
- func (rii *RemoteIndexIncoming) GetFile(ctx context.Context, indexName, shardName, relativeFilePath string) (io.ReadCloser, error)
- func (rii *RemoteIndexIncoming) GetFileMetadata(ctx context.Context, indexName, shardName, relativeFilePath string) (file.FileMetadata, error)
- func (rii *RemoteIndexIncoming) GetObject(ctx context.Context, indexName, shardName string, id strfmt.UUID, ...) (*storobj.Object, error)
- func (rii *RemoteIndexIncoming) GetShardQueueSize(ctx context.Context, indexName, shardName string) (int64, error)
- func (rii *RemoteIndexIncoming) GetShardStatus(ctx context.Context, indexName, shardName string) (string, error)
- func (rii *RemoteIndexIncoming) HashTreeLevel(ctx context.Context, indexName, shardName string, level int, ...) (digests []hashtree.Digest, err error)
- func (rii *RemoteIndexIncoming) ListFiles(ctx context.Context, indexName, shardName string) ([]string, error)
- func (rii *RemoteIndexIncoming) MergeObject(ctx context.Context, indexName, shardName string, ...) error
- func (rii *RemoteIndexIncoming) MultiGetObjects(ctx context.Context, indexName, shardName string, ids []strfmt.UUID) ([]*storobj.Object, error)
- func (rii *RemoteIndexIncoming) OverwriteObjects(ctx context.Context, indexName, shardName string, vobjects []*objects.VObject) ([]types.RepairResponse, error)
- func (rii *RemoteIndexIncoming) PauseFileActivity(ctx context.Context, indexName, shardName string, schemaVersion uint64) error
- func (rii *RemoteIndexIncoming) PutObject(ctx context.Context, indexName, shardName string, obj *storobj.Object, ...) error
- func (rii *RemoteIndexIncoming) ReInitShard(ctx context.Context, indexName, shardName string) error
- func (rii *RemoteIndexIncoming) RemoveAsyncReplicationTargetNode(ctx context.Context, indexName, shardName string, ...) error
- func (rii *RemoteIndexIncoming) ResumeFileActivity(ctx context.Context, indexName, shardName string) error
- func (rii *RemoteIndexIncoming) Search(ctx context.Context, indexName, shardName string, vectors []models.Vector, ...) ([]*storobj.Object, []float32, error)
- func (rii *RemoteIndexIncoming) UpdateShardStatus(ctx context.Context, indexName, shardName, targetStatus string, ...) error
- type RemoteIndexIncomingRepo
- type RemoteNode
- type RemoteNodeClient
- type RemoteNodeIncoming
- type RemoteNodeIncomingRepo
- type ReplicasSearchResult
- type State
- func (s *State) AddPartition(name string, nodes []string, status string) (Physical, error)
- func (s *State) AddReplicaToShard(shard string, replica string) error
- func (s *State) AllLocalPhysicalShards() []string
- func (s *State) AllPhysicalShards() []string
- func (s *State) AllPhysicalShardsAndReplicas() map[string][]string
- func (s *State) ApplyNodeMapping(nodeMapping map[string]string)
- func (s *State) CountPhysicalShards() int
- func (s State) DeepCopy() State
- func (s *State) DeletePartition(name string) (string, bool, error)
- func (s *State) DeleteReplicaFromShard(shard string, replica string) error
- func (s State) GetPartitions(nodes []string, shards []string, replFactor int64) (map[string][]string, error)
- func (s *State) IsLocalShard(name string) bool
- func (s *State) JSON() ([]byte, error)
- func (s *State) MigrateFromOldFormat()
- func (s *State) MigrateShardingStateReplicationFactor() error
- func (s *State) NumberOfReplicas(shard string) (int64, error)
- func (s *State) PhysicalShard(in []byte) string
- func (s *State) SetLocalName(name string)
- func (s *State) Shard(partitionKey, objectID string) string
- func (s *State) VirtualByName(name string) *Virtual
- type Virtual
Constants ¶
This section is empty.
Variables ¶
var ErrReplicaAlreadyExists = errors.New("replica already exists")
Functions ¶
This section is empty.
Types ¶
type Physical ¶
type Physical struct {
Name string `json:"name"`
OwnsVirtual []string `json:"ownsVirtual,omitempty"`
OwnsPercentage float64 `json:"ownsPercentage"`
LegacyBelongsToNodeForBackwardCompat string `json:"belongsToNode,omitempty"`
BelongsToNodes []string `json:"belongsToNodes,omitempty"`
Status string `json:"status,omitempty"`
}
func (*Physical) ActivityStatus ¶ added in v1.21.0
func (*Physical) AddReplica ¶ added in v1.31.0
func (*Physical) AdjustReplicas ¶
func (p *Physical) AdjustReplicas(count int, nodes cluster.NodeSelector) error
AdjustReplicas shrinks or extends the replica set (p.BelongsToNodes)
func (Physical) BelongsToNode ¶
BelongsToNode for backward-compatibility when there was no replication. It always returns the first node of the list
func (*Physical) DeleteReplica ¶ added in v1.31.0
func (*Physical) IsLocalShard ¶ added in v1.27.27
type RemoteIncomingRepo ¶
type RemoteIncomingRepo interface {
GetIndexForIncomingSharding(className schema.ClassName) RemoteIndexIncomingRepo
}
type RemoteIncomingSchema ¶ added in v1.25.0
type RemoteIndex ¶
type RemoteIndex struct {
// contains filtered or unexported fields
}
func NewRemoteIndex ¶
func NewRemoteIndex(className string, stateGetter shardingStateGetter, nodeResolver nodeResolver, client RemoteIndexClient, ) *RemoteIndex
func (*RemoteIndex) Aggregate ¶
func (ri *RemoteIndex) Aggregate( ctx context.Context, shard string, params aggregation.Params, ) (*aggregation.Result, error)
func (*RemoteIndex) BatchAddReferences ¶
func (ri *RemoteIndex) BatchAddReferences(ctx context.Context, shardName string, refs objects.BatchReferences, schemaVersion uint64, ) []error
func (*RemoteIndex) BatchPutObjects ¶
func (*RemoteIndex) DeleteObject ¶
func (*RemoteIndex) DeleteObjectBatch ¶
func (*RemoteIndex) FindUUIDs ¶ added in v1.22.8
func (ri *RemoteIndex) FindUUIDs(ctx context.Context, shardName string, filters *filters.LocalFilter, ) ([]strfmt.UUID, error)
func (*RemoteIndex) GetObject ¶
func (ri *RemoteIndex) GetObject(ctx context.Context, shardName string, id strfmt.UUID, props search.SelectProperties, additional additional.Properties, ) (*storobj.Object, error)
func (*RemoteIndex) GetShardQueueSize ¶ added in v1.22.0
func (*RemoteIndex) GetShardStatus ¶
func (*RemoteIndex) MergeObject ¶
func (ri *RemoteIndex) MergeObject(ctx context.Context, shardName string, mergeDoc objects.MergeDocument, schemaVersion uint64, ) error
func (*RemoteIndex) MultiGetObjects ¶
func (*RemoteIndex) SearchAllReplicas ¶ added in v1.24.20
func (ri *RemoteIndex) SearchAllReplicas(ctx context.Context, log logrus.FieldLogger, shard string, queryVec []models.Vector, targetVector []string, distance float32, limit int, filters *filters.LocalFilter, keywordRanking *searchparams.KeywordRanking, sort []filters.Sort, cursor *filters.Cursor, groupBy *searchparams.GroupBy, adds additional.Properties, replEnabled bool, localNode string, targetCombination *dto.TargetCombination, properties []string, ) ([]ReplicasSearchResult, error)
func (*RemoteIndex) SearchShard ¶
func (ri *RemoteIndex) SearchShard(ctx context.Context, shard string, queryVec []models.Vector, targetVector []string, distance float32, limit int, filters *filters.LocalFilter, keywordRanking *searchparams.KeywordRanking, sort []filters.Sort, cursor *filters.Cursor, groupBy *searchparams.GroupBy, adds additional.Properties, replEnabled bool, targetCombination *dto.TargetCombination, properties []string, ) ([]*storobj.Object, []float32, string, error)
func (*RemoteIndex) UpdateShardStatus ¶
type RemoteIndexClient ¶
type RemoteIndexClient interface {
PutObject(ctx context.Context, hostName, indexName, shardName string,
obj *storobj.Object, schemaVersion uint64) error
BatchPutObjects(ctx context.Context, hostName, indexName, shardName string,
objs []*storobj.Object, repl *additional.ReplicationProperties, schemaVersion uint64) []error
BatchAddReferences(ctx context.Context, hostName, indexName, shardName string,
refs objects.BatchReferences, schemaVersion uint64) []error
GetObject(ctx context.Context, hostname, indexName, shardName string,
id strfmt.UUID, props search.SelectProperties,
additional additional.Properties) (*storobj.Object, error)
Exists(ctx context.Context, hostname, indexName, shardName string,
id strfmt.UUID) (bool, error)
DeleteObject(ctx context.Context, hostname, indexName, shardName string,
id strfmt.UUID, deletionTime time.Time, schemaVersion uint64) error
MergeObject(ctx context.Context, hostname, indexName, shardName string,
mergeDoc objects.MergeDocument, schemaVersion uint64) error
MultiGetObjects(ctx context.Context, hostname, indexName, shardName string,
ids []strfmt.UUID) ([]*storobj.Object, error)
SearchShard(ctx context.Context, hostname, indexName, shardName string,
searchVector []models.Vector, targetVector []string, distance float32, limit int, filters *filters.LocalFilter,
keywordRanking *searchparams.KeywordRanking, sort []filters.Sort,
cursor *filters.Cursor, groupBy *searchparams.GroupBy,
additional additional.Properties, targetCombination *dto.TargetCombination, properties []string,
) ([]*storobj.Object, []float32, error)
Aggregate(ctx context.Context, hostname, indexName, shardName string,
params aggregation.Params) (*aggregation.Result, error)
FindUUIDs(ctx context.Context, hostName, indexName, shardName string,
filters *filters.LocalFilter) ([]strfmt.UUID, error)
DeleteObjectBatch(ctx context.Context, hostName, indexName, shardName string,
uuids []strfmt.UUID, deletionTime time.Time, dryRun bool, schemaVersion uint64) objects.BatchSimpleObjects
GetShardQueueSize(ctx context.Context, hostName, indexName, shardName string) (int64, error)
GetShardStatus(ctx context.Context, hostName, indexName, shardName string) (string, error)
UpdateShardStatus(ctx context.Context, hostName, indexName, shardName, targetStatus string, schemaVersion uint64) error
PutFile(ctx context.Context, hostName, indexName, shardName, fileName string,
payload io.ReadSeekCloser) error
// PauseFileActivity pauses the shard replica background processes on the specified node.
// You should explicitly resume the background processes once you're done.
PauseFileActivity(ctx context.Context, hostName, indexName, shardName string, schemaVersion uint64) error
// ResumeFileActivity resumes the shard replica background processes on the specified node.
ResumeFileActivity(ctx context.Context, hostName, indexName, shardName string) error
// ListFiles returns a list of files that can be used to get the shard data at the time the pause was
// requested.
ListFiles(ctx context.Context, hostName, indexName, shardName string) ([]string, error)
// GetFileMetadata returns file info at the given path in the shard's root directory.
GetFileMetadata(ctx context.Context, hostName, indexName, shardName, fileName string) (file.FileMetadata, error)
// GetFile returns a reader for the file at the given path in the shard's root directory.
// The caller must close the returned io.ReadCloser if no error is returned.
GetFile(ctx context.Context, hostName, indexName, shardName, fileName string) (io.ReadCloser, error)
// AddAsyncReplicationTargetNode adds the async replication target node for a shard.
AddAsyncReplicationTargetNode(ctx context.Context, hostName, indexName, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride, schemaVersion uint64) error
// RemoveAsyncReplicationTargetNode removes the async replication target node for a shard.
RemoveAsyncReplicationTargetNode(ctx context.Context, hostName, indexName, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride) error
}
type RemoteIndexIncoming ¶
type RemoteIndexIncoming struct {
// contains filtered or unexported fields
}
func NewRemoteIndexIncoming ¶
func NewRemoteIndexIncoming(repo RemoteIncomingRepo, schema RemoteIncomingSchema, modules interface{}) *RemoteIndexIncoming
func (*RemoteIndexIncoming) AddAsyncReplicationTargetNode ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) AddAsyncReplicationTargetNode( ctx context.Context, indexName, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride, schemaVersion uint64, ) error
func (*RemoteIndexIncoming) Aggregate ¶
func (rii *RemoteIndexIncoming) Aggregate(ctx context.Context, indexName, shardName string, params aggregation.Params, ) (*aggregation.Result, error)
func (*RemoteIndexIncoming) BatchAddReferences ¶
func (rii *RemoteIndexIncoming) BatchAddReferences(ctx context.Context, indexName, shardName string, refs objects.BatchReferences, schemaVersion uint64, ) []error
func (*RemoteIndexIncoming) BatchPutObjects ¶
func (*RemoteIndexIncoming) CreateShard ¶
func (rii *RemoteIndexIncoming) CreateShard(ctx context.Context, indexName, shardName string, ) error
func (*RemoteIndexIncoming) DeleteObject ¶
func (*RemoteIndexIncoming) DeleteObjectBatch ¶
func (*RemoteIndexIncoming) DigestObjects ¶ added in v1.18.0
func (rii *RemoteIndexIncoming) DigestObjects(ctx context.Context, indexName, shardName string, ids []strfmt.UUID, ) ([]types.RepairResponse, error)
func (*RemoteIndexIncoming) DigestObjectsInRange ¶ added in v1.28.5
func (rii *RemoteIndexIncoming) DigestObjectsInRange(ctx context.Context, indexName, shardName string, initialUUID, finalUUID strfmt.UUID, limit int, ) ([]types.RepairResponse, error)
func (*RemoteIndexIncoming) FilePutter ¶
func (rii *RemoteIndexIncoming) FilePutter(ctx context.Context, indexName, shardName, filePath string, ) (io.WriteCloser, error)
func (*RemoteIndexIncoming) FindUUIDs ¶ added in v1.22.8
func (rii *RemoteIndexIncoming) FindUUIDs(ctx context.Context, indexName, shardName string, filters *filters.LocalFilter, ) ([]strfmt.UUID, error)
func (*RemoteIndexIncoming) GetFile ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) GetFile(ctx context.Context, indexName, shardName, relativeFilePath string, ) (io.ReadCloser, error)
GetFile see adapters/clients.RemoteIndex.GetFile
func (*RemoteIndexIncoming) GetFileMetadata ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) GetFileMetadata(ctx context.Context, indexName, shardName, relativeFilePath string, ) (file.FileMetadata, error)
GetFileMetadata see adapters/clients.RemoteIndex.GetFileMetadata
func (*RemoteIndexIncoming) GetObject ¶
func (rii *RemoteIndexIncoming) GetObject(ctx context.Context, indexName, shardName string, id strfmt.UUID, selectProperties search.SelectProperties, additional additional.Properties, ) (*storobj.Object, error)
func (*RemoteIndexIncoming) GetShardQueueSize ¶ added in v1.22.0
func (*RemoteIndexIncoming) GetShardStatus ¶
func (*RemoteIndexIncoming) HashTreeLevel ¶ added in v1.26.0
func (*RemoteIndexIncoming) ListFiles ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) ListFiles(ctx context.Context, indexName, shardName string, ) ([]string, error)
ListFiles see adapters/clients.RemoteIndex.ListFiles
func (*RemoteIndexIncoming) MergeObject ¶
func (rii *RemoteIndexIncoming) MergeObject(ctx context.Context, indexName, shardName string, mergeDoc objects.MergeDocument, schemaVersion uint64, ) error
func (*RemoteIndexIncoming) MultiGetObjects ¶
func (*RemoteIndexIncoming) OverwriteObjects ¶ added in v1.18.0
func (rii *RemoteIndexIncoming) OverwriteObjects(ctx context.Context, indexName, shardName string, vobjects []*objects.VObject, ) ([]types.RepairResponse, error)
func (*RemoteIndexIncoming) PauseFileActivity ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) PauseFileActivity(ctx context.Context, indexName, shardName string, schemaVersion uint64, ) error
PauseFileActivity see adapters/clients.RemoteIndex.PauseFileActivity
func (*RemoteIndexIncoming) ReInitShard ¶
func (rii *RemoteIndexIncoming) ReInitShard(ctx context.Context, indexName, shardName string, ) error
func (*RemoteIndexIncoming) RemoveAsyncReplicationTargetNode ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) RemoveAsyncReplicationTargetNode( ctx context.Context, indexName, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride, ) error
func (*RemoteIndexIncoming) ResumeFileActivity ¶ added in v1.31.0
func (rii *RemoteIndexIncoming) ResumeFileActivity(ctx context.Context, indexName, shardName string, ) error
ResumeFileActivity see adapters/clients.RemoteIndex.ResumeFileActivity
func (*RemoteIndexIncoming) Search ¶
func (rii *RemoteIndexIncoming) Search(ctx context.Context, indexName, shardName string, vectors []models.Vector, targetVectors []string, distance float32, limit int, filters *filters.LocalFilter, keywordRanking *searchparams.KeywordRanking, sort []filters.Sort, cursor *filters.Cursor, groupBy *searchparams.GroupBy, additional additional.Properties, targetCombination *dto.TargetCombination, properties []string, ) ([]*storobj.Object, []float32, error)
func (*RemoteIndexIncoming) UpdateShardStatus ¶
type RemoteIndexIncomingRepo ¶
type RemoteIndexIncomingRepo interface {
IncomingPutObject(ctx context.Context, shardName string,
obj *storobj.Object, schemaVersion uint64) error
IncomingBatchPutObjects(ctx context.Context, shardName string,
objs []*storobj.Object, schemaVersion uint64) []error
IncomingBatchAddReferences(ctx context.Context, shardName string,
refs objects.BatchReferences, schemaVersion uint64) []error
IncomingGetObject(ctx context.Context, shardName string, id strfmt.UUID,
selectProperties search.SelectProperties,
additional additional.Properties) (*storobj.Object, error)
IncomingExists(ctx context.Context, shardName string,
id strfmt.UUID) (bool, error)
IncomingDeleteObject(ctx context.Context, shardName string,
id strfmt.UUID, deletionTime time.Time, schemaVersion uint64) error
IncomingMergeObject(ctx context.Context, shardName string,
mergeDoc objects.MergeDocument, schemaVersion uint64) error
IncomingMultiGetObjects(ctx context.Context, shardName string,
ids []strfmt.UUID) ([]*storobj.Object, error)
IncomingSearch(ctx context.Context, shardName string,
vectors []models.Vector, targetVectors []string, distance float32, limit int,
filters *filters.LocalFilter, keywordRanking *searchparams.KeywordRanking,
sort []filters.Sort, cursor *filters.Cursor, groupBy *searchparams.GroupBy,
additional additional.Properties, targetCombination *dto.TargetCombination, properties []string,
) ([]*storobj.Object, []float32, error)
IncomingAggregate(ctx context.Context, shardName string,
params aggregation.Params, modules interface{}) (*aggregation.Result, error)
IncomingFindUUIDs(ctx context.Context, shardName string,
filters *filters.LocalFilter) ([]strfmt.UUID, error)
IncomingDeleteObjectBatch(ctx context.Context, shardName string,
uuids []strfmt.UUID, deletionTime time.Time, dryRun bool, schemaVersion uint64) objects.BatchSimpleObjects
IncomingGetShardQueueSize(ctx context.Context, shardName string) (int64, error)
IncomingGetShardStatus(ctx context.Context, shardName string) (string, error)
IncomingUpdateShardStatus(ctx context.Context, shardName, targetStatus string, schemaVersion uint64) error
IncomingOverwriteObjects(ctx context.Context, shard string,
vobjects []*objects.VObject) ([]types.RepairResponse, error)
IncomingDigestObjects(ctx context.Context, shardName string,
ids []strfmt.UUID) (result []types.RepairResponse, err error)
IncomingDigestObjectsInRange(ctx context.Context, shardName string,
initialUUID, finalUUID strfmt.UUID, limit int) (result []types.RepairResponse, err error)
IncomingHashTreeLevel(ctx context.Context, shardName string,
level int, discriminant *hashtree.Bitset) (digests []hashtree.Digest, err error)
// Scale-Out Replication POC
IncomingFilePutter(ctx context.Context, shardName,
filePath string) (io.WriteCloser, error)
IncomingCreateShard(ctx context.Context, className string, shardName string) error
IncomingReinitShard(ctx context.Context, shardName string) error
// IncomingPauseFileActivity See adapters/clients.RemoteIndex.IncomingPauseFileActivity
IncomingPauseFileActivity(ctx context.Context, shardName string) error
// IncomingResumeFileActivity See adapters/clients.RemoteIndex.IncomingResumeFileActivity
IncomingResumeFileActivity(ctx context.Context, shardName string) error
// IncomingListFiles See adapters/clients.RemoteIndex.IncomingListFiles
IncomingListFiles(ctx context.Context, shardName string) ([]string, error)
// IncomingGetFileMetadata See adapters/clients.RemoteIndex.GetFileMetadata
IncomingGetFileMetadata(ctx context.Context, shardName, relativeFilePath string) (file.FileMetadata, error)
// IncomingGetFile See adapters/clients.RemoteIndex.GetFile
IncomingGetFile(ctx context.Context, shardName, relativeFilePath string) (io.ReadCloser, error)
// IncomingAddAsyncReplicationTargetNode See adapters/clients.RemoteIndex.AddAsyncReplicationTargetNode
IncomingAddAsyncReplicationTargetNode(ctx context.Context, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride) error
// IncomingRemoveAsyncReplicationTargetNode See adapters/clients.RemoteIndex.RemoveAsyncReplicationTargetNode
IncomingRemoveAsyncReplicationTargetNode(ctx context.Context, shardName string, targetNodeOverride additional.AsyncReplicationTargetNodeOverride) error
}
type RemoteNode ¶
type RemoteNode struct {
// contains filtered or unexported fields
}
func NewRemoteNode ¶
func NewRemoteNode(nodeResolver nodeResolver, client RemoteNodeClient) *RemoteNode
func (*RemoteNode) GetNodeStatus ¶
func (rn *RemoteNode) GetNodeStatus(ctx context.Context, nodeName, className, shardName, output string) (*models.NodeStatus, error)
func (*RemoteNode) GetStatistics ¶ added in v1.25.0
func (rn *RemoteNode) GetStatistics(ctx context.Context, nodeName string) (*models.Statistics, error)
type RemoteNodeClient ¶
type RemoteNodeIncoming ¶
type RemoteNodeIncoming struct {
// contains filtered or unexported fields
}
func NewRemoteNodeIncoming ¶
func NewRemoteNodeIncoming(repo RemoteNodeIncomingRepo) *RemoteNodeIncoming
func (*RemoteNodeIncoming) GetNodeStatus ¶
func (rni *RemoteNodeIncoming) GetNodeStatus(ctx context.Context, className, shardName, output string) (*models.NodeStatus, error)
func (*RemoteNodeIncoming) GetStatistics ¶ added in v1.25.0
func (rni *RemoteNodeIncoming) GetStatistics(ctx context.Context) (*models.Statistics, error)
type RemoteNodeIncomingRepo ¶
type RemoteNodeIncomingRepo interface {
IncomingGetNodeStatus(ctx context.Context, className, shardName, output string) (*models.NodeStatus, error)
IncomingGetNodeStatistics() (*models.Statistics, error)
}
type ReplicasSearchResult ¶ added in v1.24.20
type State ¶
type State struct {
IndexID string `json:"indexID"` // for monitoring, reporting purposes. Does not influence the shard-calculations
Config config.Config `json:"config"`
Physical map[string]Physical `json:"physical"`
Virtual []Virtual `json:"virtual"`
PartitioningEnabled bool `json:"partitioningEnabled"`
ReplicationFactor int64 `json:"replicationFactor"`
// contains filtered or unexported fields
}
func StateFromJSON ¶
func StateFromJSON(in []byte, nodes cluster.NodeSelector) (*State, error)
func (*State) AddPartition ¶ added in v1.20.0
AddPartition to physical shards
func (*State) AddReplicaToShard ¶ added in v1.31.0
func (*State) AllLocalPhysicalShards ¶
func (*State) AllPhysicalShards ¶
func (*State) AllPhysicalShardsAndReplicas ¶ added in v1.31.0
func (*State) ApplyNodeMapping ¶ added in v1.22.0
ApplyNodeMapping replaces node names with their new value form nodeMapping in s. If s.LegacyBelongsToNodeForBackwardCompat is non empty, it will also perform node name replacement if present in nodeMapping.
func (*State) CountPhysicalShards ¶
CountPhysicalShards return a count of physical shards
func (*State) DeletePartition ¶ added in v1.20.0
DeletePartition to physical shards. Return `true` if given partition is actually deleted.
func (*State) DeleteReplicaFromShard ¶ added in v1.31.0
func (State) GetPartitions ¶ added in v1.20.0
func (s State) GetPartitions(nodes []string, shards []string, replFactor int64) (map[string][]string, error)
GetPartitions based on the specified shards, available nodes, and replFactor It doesn't change the internal state TODO-RAFT: Ensure this function is higherorder, if the repartition result is changed, this will result in inconsistency when applying old log entry for add tenants
func (*State) IsLocalShard ¶ added in v1.20.0
func (*State) MigrateFromOldFormat ¶
func (s *State) MigrateFromOldFormat()
MigrateFromOldFormat checks if the old (pre-v1.17) format was used and migrates it into the new format for backward-compatibility with all classes created before v1.17
func (*State) MigrateShardingStateReplicationFactor ¶ added in v1.31.0
MigrateShardingStateReplicationFactor sets the ReplicationFactor field if it is unset (zero). For partitioned states, it defaults to 1. For non-partitioned states, it checks that all shards have a consistent number of physical replicas and uses that as the replication factor.
Returns:
- error: if physical shards are missing in a non-partitioned state or if shard replica counts are inconsistent
func (*State) NumberOfReplicas ¶ added in v1.31.0
func (*State) PhysicalShard ¶
func (*State) SetLocalName ¶
func (*State) Shard ¶ added in v1.20.0
Shard returns the shard name if it exits and empty string otherwise
func (*State) VirtualByName ¶ added in v1.26.0
uses linear search, but should only be used during shard init and update operations, not in regular