Skip to content

Commit

Permalink
rename inverted index to piece index
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Nov 17, 2021
1 parent 37dda67 commit 992942a
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ type StorageMiner interface {
// so they can download its index
IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error //perm:admin

// DagstoreInvertedIndexSize returns the size of the inverted index.
DagstoreInvertedIndexSize(ctx context.Context) (int64, error) //perm:admin
// DagstorePieceIndexSize returns the size of the piece index.
DagstorePieceIndexSize(ctx context.Context) (int64, error) //perm:admin

// DagstoreLookupPieces returns information about shards that contain the given CID.
DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]DagstoreShardInfo, error) //perm:admin
Expand Down
26 changes: 13 additions & 13 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
10 changes: 5 additions & 5 deletions cmd/lotus-miner/dagstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var dagstoreCmd = &cli.Command{
dagstoreRecoverShardCmd,
dagstoreInitializeAllCmd,
dagstoreGcCmd,
dagstoreInvertedIndexSizeCmd,
dagstorePieceIndexSizeCmd,
dagstoreLookupPiecesCmd,
},
}
Expand Down Expand Up @@ -273,9 +273,9 @@ func printTableShards(shards []api.DagstoreShardInfo) error {
return tw.Flush(os.Stdout)
}

var dagstoreInvertedIndexSizeCmd = &cli.Command{
Name: "inverted-index-size",
Usage: "Inspect the dagstore inverted index size",
var dagstorePieceIndexSizeCmd = &cli.Command{
Name: "piece-index-size",
Usage: "Inspect the dagstore piece index size",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Expand All @@ -296,7 +296,7 @@ var dagstoreInvertedIndexSizeCmd = &cli.Command{

ctx := lcli.ReqContext(cctx)

size, err := marketsApi.DagstoreInvertedIndexSize(ctx)
size, err := marketsApi.DagstorePieceIndexSize(ctx)
if err != nil {
return err
}
Expand Down
22 changes: 11 additions & 11 deletions documentation/en/api-v0-methods-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* [DagstoreGC](#DagstoreGC)
* [DagstoreInitializeAll](#DagstoreInitializeAll)
* [DagstoreInitializeShard](#DagstoreInitializeShard)
* [DagstoreInvertedIndexSize](#DagstoreInvertedIndexSize)
* [DagstoreListShards](#DagstoreListShards)
* [DagstoreLookupPieces](#DagstoreLookupPieces)
* [DagstorePieceIndexSize](#DagstorePieceIndexSize)
* [DagstoreRecoverShard](#DagstoreRecoverShard)
* [Deals](#Deals)
* [DealsConsiderOfflineRetrievalDeals](#DealsConsiderOfflineRetrievalDeals)
Expand Down Expand Up @@ -435,16 +435,6 @@ Inputs:

Response: `{}`

### DagstoreInvertedIndexSize
DagstoreInvertedIndexSize returns the size of the inverted index.


Perms: admin

Inputs: `null`

Response: `9`

### DagstoreListShards
DagstoreListShards returns information about all shards known to the
DAG store. Only available on nodes running the markets subsystem.
Expand Down Expand Up @@ -473,6 +463,16 @@ Inputs:

Response: `null`

### DagstorePieceIndexSize
DagstorePieceIndexSize returns the size of the piece index.


Perms: admin

Inputs: `null`

Response: `9`

### DagstoreRecoverShard
DagstoreRecoverShard attempts to recover a failed shard.

Expand Down
22 changes: 11 additions & 11 deletions documentation/en/cli-lotus-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,14 +1031,14 @@ USAGE:
lotus-miner dagstore command [command options] [arguments...]
COMMANDS:
list-shards List all shards known to the dagstore, with their current status
initialize-shard Initialize the specified shard
recover-shard Attempt to recover a shard in errored state
initialize-all Initialize all uninitialized shards, streaming results as they're produced; only shards for unsealed pieces are initialized by default
gc Garbage collect the dagstore
inverted-index-size Inspect the dagstore inverted index size
lookup-pieces Lookup pieces that a given CID belongs to
help, h Shows a list of commands or help for one command
list-shards List all shards known to the dagstore, with their current status
initialize-shard Initialize the specified shard
recover-shard Attempt to recover a shard in errored state
initialize-all Initialize all uninitialized shards, streaming results as they're produced; only shards for unsealed pieces are initialized by default
gc Garbage collect the dagstore
piece-index-size Inspect the dagstore piece index size
lookup-pieces Lookup pieces that a given CID belongs to
help, h Shows a list of commands or help for one command
OPTIONS:
--help, -h show help (default: false)
Expand Down Expand Up @@ -1117,13 +1117,13 @@ OPTIONS:
```

### lotus-miner dagstore inverted-index-size
### lotus-miner dagstore piece-index-size
```
NAME:
lotus-miner dagstore inverted-index-size - Inspect the dagstore inverted index size
lotus-miner dagstore piece-index-size - Inspect the dagstore piece index size
USAGE:
lotus-miner dagstore inverted-index-size [command options] [arguments...]
lotus-miner dagstore piece-index-size [command options] [arguments...]
OPTIONS:
--color use color in display output (default: depends on output being a TTY)
Expand Down
4 changes: 2 additions & 2 deletions node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,14 +836,14 @@ func (sm *StorageMinerAPI) IndexerAnnounceDeal(ctx context.Context, proposalCid
return sm.StorageProvider.AnnounceDealToIndexer(ctx, proposalCid)
}

func (sm *StorageMinerAPI) DagstoreInvertedIndexSize(ctx context.Context) (int64, error) {
func (sm *StorageMinerAPI) DagstorePieceIndexSize(ctx context.Context) (int64, error) {
if sm.DAGStore == nil {
return 0, fmt.Errorf("dagstore not available on this node")
}

res, err := sm.DAGStore.TopLevelIndex.Size()
if err != nil {
return 0, fmt.Errorf("failed to get dagstore inverted index size: %w", err)
return 0, fmt.Errorf("failed to get dagstore piece index size: %w", err)
}

return res, nil
Expand Down

0 comments on commit 992942a

Please sign in to comment.