Documentation
¶
Index ¶
- Constants
- type Batch
- type CrawlState
- type DealCountStats
- type DealMeta
- type DealSummary
- type ExternalStorageProvider
- type GroupDesc
- type GroupIOStats
- type GroupKey
- type GroupMeta
- type GroupState
- type GroupStats
- type GroupSub
- type GroupUploadStats
- type Index
- type Libp2pInfo
- type OffloadLoader
- type ProviderInfo
- type ProviderMeta
- type RBS
- type RBSDiag
- type RBSExternalStorage
- type RBSStagingStorage
- type RIBS
- type RIBSDiag
- type RepairJob
- type RepairJobState
- type RepairQueueStats
- type RetrCheckerStats
- type RetrStats
- type Session
- type StagingStats
- type StagingStorageProvider
- type Storage
- type TopIndexStats
- type UploadStats
- type Wallet
- type WalletInfo
- type WorkerStats
Constants ¶
View Source
const UndefGroupKey = GroupKey(-1)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch interface {
// Put queues writes to the blockstore
Put(ctx context.Context, b []blocks.Block) error
// Unlink makes a blocks not retrievable from the blockstore
// NOTE: this method is best-effort. Data may not be removed immediately,
// and it may be retrievable even after the operation is committed
// In case of conflicts, Put operation will be preferred over Unlink
Unlink(ctx context.Context, c []multihash.Multihash) error
// Delete deletes block from the blockstore
// NOTE: this method is best-effort. Might be better solutions for this.
Delete(ctx context.Context, c []multihash.Multihash) error
// Flush commits data to the blockstore. The batch can be reused after commit
Flush(ctx context.Context) error
}
Batch groups operations, NOT thread safe
type CrawlState ¶
type DealCountStats ¶
type DealSummary ¶
type ExternalStorageProvider ¶
type GroupIOStats ¶
type GroupState ¶
type GroupState int // todo move to rbstore?
const ( GroupStateWritable GroupState = iota GroupStateFull GroupStateVRCARDone GroupStateLocalReadyForDeals GroupStateOffloaded GroupStateReload )
type GroupStats ¶
type GroupSub ¶
type GroupSub func(group GroupKey, from, to GroupState)
type GroupUploadStats ¶
type Index ¶
type Index interface {
// GetGroups gets group ids for the multihashes
GetGroups(ctx context.Context, mh []multihash.Multihash, cb func(cidx int, gk GroupKey) (more bool, err error)) error
GetSizes(ctx context.Context, mh []multihash.Multihash, cb func([]int32) error) error
AddGroup(ctx context.Context, mh []multihash.Multihash, sizes []int32, group GroupKey) error
Sync(ctx context.Context) error
DropGroup(ctx context.Context, mh []multihash.Multihash, group GroupKey) error
DropGroupForceDelete(ctx context.Context, mh []multihash.Multihash, group GroupKey) error
EstimateSize(ctx context.Context) (int64, error)
io.Closer
}
Index is the top level index, thread safe
type Libp2pInfo ¶
type OffloadLoader ¶
type ProviderInfo ¶
type ProviderInfo struct {
Meta ProviderMeta
RecentDeals []DealMeta
}
type ProviderMeta ¶
type ProviderMeta struct {
ID int64
PingOk bool
BoostDeals bool
BoosterHttp bool
BoosterBitswap bool
IndexedSuccess int64
IndexedFail int64
DealStarted int64
DealSuccess int64
DealFail int64
DealRejected int64
MostRecentDealStart int64
// price in fil/gib/epoch
AskPrice float64
AskVerifiedPrice float64
AskMinPieceSize float64
AskMaxPieceSize float64
RetrievDeals, UnretrievDeals int64
}
type RBS ¶
type RBS interface {
Start() error
Session(ctx context.Context) Session
Storage() Storage
StorageDiag() RBSDiag
// ExternalStorage manages offloaded data
ExternalStorage() RBSExternalStorage
// StagingStorage manages staged data (full non-replicated data)
StagingStorage() RBSStagingStorage
io.Closer
}
type RBSDiag ¶
type RBSDiag interface {
Groups() ([]GroupKey, error)
GroupMeta(gk GroupKey) (GroupMeta, error)
TopIndexStats(context.Context) (TopIndexStats, error)
GetGroupStats() (*GroupStats, error)
GroupIOStats() GroupIOStats
WorkerStats() WorkerStats
}
type RBSExternalStorage ¶
type RBSExternalStorage interface {
InstallProvider(ExternalStorageProvider)
}
type RBSStagingStorage ¶
type RBSStagingStorage interface {
InstallStagingProvider(StagingStorageProvider)
}
type RIBSDiag ¶
type RIBSDiag interface {
CarUploadStats() UploadStats
DealSummary() (DealSummary, error)
GroupDeals(gk GroupKey) ([]DealMeta, error)
ProviderInfo(id int64) (ProviderInfo, error)
CrawlState() CrawlState
ReachableProviders() []ProviderMeta
RetrStats() (RetrStats, error)
StagingStats() (StagingStats, error)
Filecoin(context.Context) (api.Gateway, jsonrpc.ClientCloser, error)
P2PNodes(ctx context.Context) (map[string]Libp2pInfo, error)
RetrChecker() RetrCheckerStats
RetrievableDealCounts() ([]DealCountStats, error)
SealedDealCounts() ([]DealCountStats, error)
RepairQueue() (RepairQueueStats, error)
RepairStats() (map[int]RepairJob, error)
}
type RepairJob ¶
type RepairJob struct {
GroupKey GroupKey
State RepairJobState
FetchProgress, FetchSize int64
FetchUrl string
}
type RepairJobState ¶
type RepairJobState string
const ( RepairJobStateFetching RepairJobState = "fetching" RepairJobStateVerifying RepairJobState = "verifying" RepairJobStateImporting RepairJobState = "importing" )
type RepairQueueStats ¶
type RepairQueueStats struct {
Total, Assigned int
}
type RetrCheckerStats ¶
type Session ¶
type Session interface {
// View attempts to read a list of cids
// NOTE:
// * Callback calls can happen out of order
// * Callback calls can happen in parallel
// * Callback will not be called for indexes where data is not found
// * Callback `data` must not be referenced after the function returns
// If the data is to be used after returning from the callback, it MUST be copied.
View(ctx context.Context, c []multihash.Multihash, cb func(cidx int, data []byte)) error
// -1 means not found
GetSize(ctx context.Context, c []multihash.Multihash, cb func([]int32) error) error
Batch(ctx context.Context) Batch
}
Session groups correlated IO operations; thread safa
type StagingStats ¶
type StagingStats struct {
UploadBytes, UploadStarted, UploadDone, UploadErr, Redirects, ReadReqs, ReadBytes int64
}
type StagingStorageProvider ¶
type Storage ¶
type Storage interface {
FindHashes(ctx context.Context, hashes multihash.Multihash) ([]GroupKey, error)
ReadCar(ctx context.Context, group GroupKey, sz func(int64), out io.Writer) error
// HashSample returns a sample of hashes from the group saved when the group was finalized
HashSample(ctx context.Context, group GroupKey) ([]multihash.Multihash, error)
DescibeGroup(ctx context.Context, group GroupKey) (GroupDesc, error)
Offload(ctx context.Context, group GroupKey) error
LoadFilCar(ctx context.Context, group GroupKey, f io.Reader, sz int64) error
Subscribe(GroupSub)
}
type TopIndexStats ¶
type UploadStats ¶
type UploadStats struct {
ByGroup map[GroupKey]*GroupUploadStats
LastTotalBytes int64
}
type WalletInfo ¶
type WorkerStats ¶
Click to show internal directories.
Click to hide internal directories.


