Documentation ¶
Index ¶
- type DagNode
- func (d DagNode) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (d *DagNode) Close()
- func (d DagNode) DeleteBlock(ctx context.Context, cid cid.Cid) (err error)
- func (d DagNode) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)
- func (d DagNode) GetSize(ctx context.Context, cid cid.Cid) (int, error)
- func (d DagNode) Has(ctx context.Context, cid cid.Cid) (bool, error)
- func (d DagNode) HashOnRead(enabled bool)
- func (d DagNode) Put(ctx context.Context, block blocks.Block) (err error)
- func (d DagNode) PutMany(ctx context.Context, blocks []blocks.Block) (err error)
- func (d *DagNode) RepairDisk(ip, port string) error
- func (d *DagNode) RepairHost(oldIp, newIp, oldPort, newPort string) error
- type DataNodeClient
- type Erasure
- func (e *Erasure) DecodeDataAndParityBlocks(data [][]byte) error
- func (e *Erasure) DecodeDataBlocks(data [][]byte) error
- func (e *Erasure) EncodeData(data []byte) ([][]byte, error)
- func (e *Erasure) ShardFileOffset(startOffset, length, totalLength int64) int64
- func (e *Erasure) ShardFileSize(totalLength int64) int64
- func (e *Erasure) ShardSize() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DagNode ¶
type DagNode struct { Nodes []*DataNodeClient // contains filtered or unexported fields }
DagNode Implemented the Blockstore interface
func NewDagNode ¶
func NewDagNode(cfg config.DagNodeConfig) (*DagNode, error)
NewDagNode creates a new DagNode
func (DagNode) AllKeysChan ¶
AllKeysChan returns a channel that will yield every key in the dag
func (DagNode) DeleteBlock ¶
DeleteBlock deletes a block from the DagNode
func (DagNode) HashOnRead ¶
HashOnRead tells the dag node to calculate the hash of the block
func (*DagNode) RepairDisk ¶
RepairDisk prepare disk repair
func (*DagNode) RepairHost ¶
RepairHost prepare host repair
type DataNodeClient ¶
type DataNodeClient struct { Client proto.DataNodeClient HeartClient healthpb.HealthClient Ip string Port string Conn *grpc.ClientConn }
DataNodeClient is a node that stores erasure-coded sharded data
func NewDataNodeClient ¶
func NewDataNodeClient(cfg config.DataNodeConfig) (datanode *DataNodeClient, err error)
NewDataNodeClient creates a grpc connection to a slice
type Erasure ¶
type Erasure struct {
// contains filtered or unexported fields
}
Erasure - erasure encoding details.
func NewErasure ¶
NewErasure creates a new ErasureStorage.
func (*Erasure) DecodeDataAndParityBlocks ¶
DecodeDataAndParityBlocks decodes the given erasure-coded data and verifies it. It returns an error if the decoding failed.
func (*Erasure) DecodeDataBlocks ¶
DecodeDataBlocks decodes the given erasure-coded data. It only decodes the data blocks but does not verify them. It returns an error if the decoding failed.
func (*Erasure) EncodeData ¶
EncodeData encodes the given data and returns the erasure-coded data. It returns an error if the erasure coding failed.
func (*Erasure) ShardFileOffset ¶
ShardFileOffset - returns the effective offset where erasure reading begins.
func (*Erasure) ShardFileSize ¶
ShardFileSize - returns final erasure size from original size.