Documentation ¶
Index ¶
- Constants
- type Config
- type GCFilewalkerRequest
- type GCFilewalkerResponse
- type Supervisor
- func (fw *Supervisor) TestingSetGCCmd(cmd execwrapper.Command)
- func (fw *Supervisor) TestingSetUsedSpaceCmd(cmd execwrapper.Command)
- func (fw *Supervisor) WalkAndComputeSpaceUsedBySatellite(ctx context.Context, satelliteID storj.NodeID) (piecesTotal int64, piecesContentSize int64, err error)
- func (fw *Supervisor) WalkSatellitePiecesToTrash(ctx context.Context, satelliteID storj.NodeID, createdBefore time.Time, ...) (pieceIDs []storj.PieceID, piecesCount, piecesSkipped int64, err error)
- type UsedSpaceRequest
- type UsedSpaceResponse
Constants ¶
const ( // UsedSpaceFilewalkerCmdName is the name of the used-space-filewalker subcommand. UsedSpaceFilewalkerCmdName = "used-space-filewalker" // GCFilewalkerCmdName is the name of the gc-filewalker subcommand. GCFilewalkerCmdName = "gc-filewalker" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // TODO: just trying to match the names in storagenodedb.Config. Change these to be more descriptive. Storage string `help:"path to the storage database directory"` Info string `help:"path to the piecestore db"` Info2 string `help:"path to the info database"` Driver string `help:"database driver to use" default:"sqlite3"` Pieces string `help:"path to store pieces in"` Filestore filestore.Config LowerIOPriority bool `help:"if true, the process will run with lower IO priority" default:"true"` }
Config is the config for lazyfilewalker process.
type GCFilewalkerRequest ¶ added in v1.79.1
type GCFilewalkerRequest struct { SatelliteID storj.NodeID `json:"satelliteID"` BloomFilter []byte `json:"bloomFilter"` CreatedBefore time.Time `json:"createdBefore"` }
GCFilewalkerRequest is the request struct for the gc-filewalker process.
type GCFilewalkerResponse ¶ added in v1.79.1
type GCFilewalkerResponse struct { PieceIDs []storj.PieceID `json:"pieceIDs"` PiecesSkippedCount int64 `json:"piecesSkippedCount"` PiecesCount int64 `json:"piecesCount"` }
GCFilewalkerResponse is the response struct for the gc-filewalker process.
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
Supervisor manages the lazyfilewalker subprocesses.
TODO: we should keep track of the number of subprocesses we have running and limit it to a configurable number, and queue them, since they are run per satellite.
func NewSupervisor ¶
func NewSupervisor(log *zap.Logger, config Config, executable string) *Supervisor
NewSupervisor creates a new lazy filewalker Supervisor.
func (*Supervisor) TestingSetGCCmd ¶ added in v1.79.1
func (fw *Supervisor) TestingSetGCCmd(cmd execwrapper.Command)
TestingSetGCCmd sets the command for the gc-filewalker subprocess. The cmd acts as a replacement for the subprocess.
func (*Supervisor) TestingSetUsedSpaceCmd ¶ added in v1.79.1
func (fw *Supervisor) TestingSetUsedSpaceCmd(cmd execwrapper.Command)
TestingSetUsedSpaceCmd sets the command for the used-space-filewalker subprocess. The cmd acts as a replacement for the subprocess.
func (*Supervisor) WalkAndComputeSpaceUsedBySatellite ¶
func (fw *Supervisor) WalkAndComputeSpaceUsedBySatellite(ctx context.Context, satelliteID storj.NodeID) (piecesTotal int64, piecesContentSize int64, err error)
WalkAndComputeSpaceUsedBySatellite returns the total used space by satellite.
func (*Supervisor) WalkSatellitePiecesToTrash ¶ added in v1.79.1
func (fw *Supervisor) WalkSatellitePiecesToTrash(ctx context.Context, satelliteID storj.NodeID, createdBefore time.Time, filter *bloomfilter.Filter) (pieceIDs []storj.PieceID, piecesCount, piecesSkipped int64, err error)
WalkSatellitePiecesToTrash returns a list of pieceIDs that need to be trashed for the given satellite.
type UsedSpaceRequest ¶
UsedSpaceRequest is the request struct for the used-space-filewalker process.
type UsedSpaceResponse ¶
type UsedSpaceResponse struct { PiecesTotal int64 `json:"piecesTotal"` PiecesContentSize int64 `json:"piecesContentSize"` }
UsedSpaceResponse is the response struct for the used-space-filewalker process.