Documentation ¶
Index ¶
- Constants
- type Config
- type GCFilewalkerRequest
- type GCFilewalkerResponse
- type Supervisor
- func (fw *Supervisor) TestingSetGCCmd(cmd execwrapper.Command)
- func (fw *Supervisor) TestingSetTrashCleanupCmd(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) WalkCleanupTrash(ctx context.Context, satelliteID storj.NodeID, dateBefore time.Time) (bytesDeleted int64, keysDeleted []storj.PieceID, err error)
- func (fw *Supervisor) WalkSatellitePiecesToTrash(ctx context.Context, satelliteID storj.NodeID, createdBefore time.Time, ...) (pieceIDs []storj.PieceID, piecesCount, piecesSkipped int64, err error)
- type TrashCleanupRequest
- type TrashCleanupResponse
- 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" // TrashCleanupFilewalkerCmdName is the name of the trash-cleanup-filewalker subcommand. TrashCleanupFilewalkerCmdName = "trash-cleanup-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"` Completed bool `json:"completed"` }
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) TestingSetTrashCleanupCmd ¶ added in v1.100.2
func (fw *Supervisor) TestingSetTrashCleanupCmd(cmd execwrapper.Command)
TestingSetTrashCleanupCmd sets the command for the trash cleanup 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) WalkCleanupTrash ¶ added in v1.100.2
func (fw *Supervisor) WalkCleanupTrash(ctx context.Context, satelliteID storj.NodeID, dateBefore time.Time) (bytesDeleted int64, keysDeleted []storj.PieceID, err error)
WalkCleanupTrash deletes per-day trash directories which are older than the given time.
func (*Supervisor) WalkSatellitePiecesToTrash ¶ added in v1.79.1
func (fw *Supervisor) WalkSatellitePiecesToTrash(ctx context.Context, satelliteID storj.NodeID, createdBefore time.Time, filter *bloomfilter.Filter, trashFunc func(pieceID storj.PieceID) error) (pieceIDs []storj.PieceID, piecesCount, piecesSkipped int64, err error)
WalkSatellitePiecesToTrash walks the satellite pieces and moves the pieces that are trash to the trash using the trashFunc provided.
type TrashCleanupRequest ¶ added in v1.100.2
type TrashCleanupRequest struct { SatelliteID storj.NodeID `json:"satelliteID"` DateBefore time.Time `json:"dateBefore"` }
TrashCleanupRequest is the request struct for the trash-cleanup-filewalker process.
type TrashCleanupResponse ¶ added in v1.100.2
type TrashCleanupResponse struct { BytesDeleted int64 `json:"bytesDeleted"` KeysDeleted []storj.PieceID `json:"keysDeleted"` }
TrashCleanupResponse is the response struct for the trash-cleanup-filewalker process.
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.