Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain interface { PublishFile(file *blockchain.PublishFileOptions) error ListFiles(opt *blockchain.ListFileOptions) ([]blockchain.File, error) GetFileByID(id string) (blockchain.File, error) ListFileNs(opt *blockchain.ListNsOptions) ([]blockchain.Namespace, error) UpdateFilePublicSliceMeta(opt *blockchain.UpdateFilePSMOptions) error SliceMigrateRecord(opt *blockchain.SliceMigrateOptions) error ListNodes() (blockchain.Nodes, error) GetNode(id []byte) (blockchain.Node, error) GetNodeHealth(id []byte) (string, error) GetHeartbeatNum(id []byte, timestamp int64) (int, error) }
type Challenger ¶
type Copier ¶
type Copier interface { Push(ctx context.Context, id, sourceID string, r io.Reader, node *blockchain.Node) (string, error) Pull(ctx context.Context, id, storIndex, fileID string, node *blockchain.Node) (io.ReadCloser, error) ReplicaExpansion(ctx context.Context, opt *copier.ReplicaExpOptions, enc common.CommonEncryptor, challengeAlgorithm, sourceID, fileID string) ([]blockchain.PublicSliceMeta, []encryptor.EncryptedSlice, error) }
type Encryptor ¶
type Encryptor interface { Encrypt(r io.Reader, opt *encryptor.EncryptOptions) (encryptor.EncryptedSlice, error) Recover(r io.Reader, opt *encryptor.RecoverOptions) ([]byte, error) }
type FileMaintainer ¶
type FileMaintainer struct {
// contains filtered or unexported fields
}
FileMaintainer runs if local node is dataOwner-node, and its main work is to check storage-nodes health conditions
and migrate slices from bad nodes to healthy nodes.
func New ¶
func New(conf *config.MonitorConf, opt *NewFileMaintainerOptions, interval int64) (*FileMaintainer, error)
func (*FileMaintainer) Migrate ¶
func (m *FileMaintainer) Migrate(ctx context.Context)
Migrate starts file migration
func (*FileMaintainer) StopMigrate ¶
func (m *FileMaintainer) StopMigrate()
StopMigrate stops file migration
type NewFileMaintainerOptions ¶
type NewFileMaintainerOptions struct { LocalNode peer.Local Blockchain Blockchain Copier Copier Encryptor Encryptor Challenger Challenger }
Click to show internal directories.
Click to hide internal directories.