gofmt
This commit is contained in:
parent
24ed43d541
commit
7175b1dd65
@ -355,10 +355,10 @@ type MinerSectors struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Import struct {
|
type Import struct {
|
||||||
Key int64
|
Key int64
|
||||||
Err string
|
Err string
|
||||||
|
|
||||||
Root *cid.Cid
|
Root *cid.Cid
|
||||||
Source string
|
Source string
|
||||||
FilePath string
|
FilePath string
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31)
|
var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31)
|
||||||
|
|
||||||
const dealStartBuffer abi.ChainEpoch = 10000 // TODO: allow setting
|
const dealStartBuffer abi.ChainEpoch = 10000 // TODO: allow setting
|
||||||
|
|
||||||
type API struct {
|
type API struct {
|
||||||
@ -306,13 +307,13 @@ func (a *API) ClientImportLocal(ctx context.Context, f io.Reader) (cid.Cid, erro
|
|||||||
prefix.MhType = DefaultHashFunction
|
prefix.MhType = DefaultHashFunction
|
||||||
|
|
||||||
params := ihelper.DagBuilderParams{
|
params := ihelper.DagBuilderParams{
|
||||||
Maxlinks: build.UnixfsLinksPerLevel,
|
Maxlinks: build.UnixfsLinksPerLevel,
|
||||||
RawLeaves: true,
|
RawLeaves: true,
|
||||||
CidBuilder: cidutil.InlineBuilder{
|
CidBuilder: cidutil.InlineBuilder{
|
||||||
Builder: prefix,
|
Builder: prefix,
|
||||||
Limit: 126,
|
Limit: 126,
|
||||||
},
|
},
|
||||||
Dagserv: bufferedDS,
|
Dagserv: bufferedDS,
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize)))
|
db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize)))
|
||||||
@ -594,13 +595,13 @@ func (a *API) clientImport(ctx context.Context, ref api.FileRef, store *importmg
|
|||||||
prefix.MhType = DefaultHashFunction
|
prefix.MhType = DefaultHashFunction
|
||||||
|
|
||||||
params := ihelper.DagBuilderParams{
|
params := ihelper.DagBuilderParams{
|
||||||
Maxlinks: build.UnixfsLinksPerLevel,
|
Maxlinks: build.UnixfsLinksPerLevel,
|
||||||
RawLeaves: true,
|
RawLeaves: true,
|
||||||
CidBuilder: cidutil.InlineBuilder{
|
CidBuilder: cidutil.InlineBuilder{
|
||||||
Builder: prefix,
|
Builder: prefix,
|
||||||
Limit: 126,
|
Limit: 126,
|
||||||
},
|
},
|
||||||
Dagserv: bufDs,
|
Dagserv: bufDs,
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize)))
|
db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize)))
|
||||||
|
@ -238,4 +238,4 @@ func (fsr *fsLockedRepo) DeleteDatastore(ns string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -12,24 +12,25 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Mgr struct {
|
type Mgr struct {
|
||||||
mds *MultiStore
|
mds *MultiStore
|
||||||
ds datastore.Batching
|
ds datastore.Batching
|
||||||
|
|
||||||
Blockstore blockstore.Blockstore
|
Blockstore blockstore.Blockstore
|
||||||
}
|
}
|
||||||
|
|
||||||
type Label string
|
type Label string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LSource = "source" // Function which created the import
|
LSource = "source" // Function which created the import
|
||||||
LRootCid = "root" // Root CID
|
LRootCid = "root" // Root CID
|
||||||
LFileName = "filename" // Local file path
|
LFileName = "filename" // Local file path
|
||||||
LMTime = "mtime" // File modification timestamp
|
LMTime = "mtime" // File modification timestamp
|
||||||
)
|
)
|
||||||
|
|
||||||
func New(mds *MultiStore, ds datastore.Batching) *Mgr {
|
func New(mds *MultiStore, ds datastore.Batching) *Mgr {
|
||||||
return &Mgr{
|
return &Mgr{
|
||||||
mds: mds,
|
mds: mds,
|
||||||
Blockstore: &multiReadBs{
|
Blockstore: &multiReadBs{
|
||||||
mds: mds,
|
mds: mds,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -99,4 +100,4 @@ func (m *Mgr) Info(id int64) (*StoreMeta, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// m.Info
|
// m.Info
|
||||||
// m.Delete
|
// m.Delete
|
||||||
|
@ -19,7 +19,7 @@ type dsProvider interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MultiStore struct {
|
type MultiStore struct {
|
||||||
provider dsProvider
|
provider dsProvider
|
||||||
namespace string
|
namespace string
|
||||||
|
|
||||||
open map[int64]*Store
|
open map[int64]*Store
|
||||||
|
@ -37,15 +37,15 @@ func openStore(ds datastore.Batching) (*Store, error) {
|
|||||||
dag := merkledag.NewDAGService(bsvc)
|
dag := merkledag.NewDAGService(bsvc)
|
||||||
|
|
||||||
return &Store{
|
return &Store{
|
||||||
ds: ds,
|
ds: ds,
|
||||||
|
|
||||||
fm: fm,
|
fm: fm,
|
||||||
Fstore: fstore,
|
Fstore: fstore,
|
||||||
|
|
||||||
Bstore: ibs,
|
Bstore: ibs,
|
||||||
|
|
||||||
bsvc: bsvc,
|
bsvc: bsvc,
|
||||||
DAG: dag,
|
DAG: dag,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,16 +150,16 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, deadline
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("checking unrecovered sectors: %w", err)
|
return xerrors.Errorf("checking unrecovered sectors: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if all sectors failed to recover, don't declare recoveries
|
// if all sectors failed to recover, don't declare recoveries
|
||||||
sbfCount, err := sbf.Count()
|
sbfCount, err := sbf.Count()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("counting recovered sectors: %w", err)
|
return xerrors.Errorf("counting recovered sectors: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if sbfCount == 0 {
|
if sbfCount == 0 {
|
||||||
log.Warnw("No recoveries to declare", "deadline", deadline, "faulty", uc)
|
log.Warnw("No recoveries to declare", "deadline", deadline, "faulty", uc)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
params := &miner.DeclareFaultsRecoveredParams{
|
params := &miner.DeclareFaultsRecoveredParams{
|
||||||
|
Loading…
Reference in New Issue
Block a user