Documentation
¶
Index ¶
- Variables
- func ReadFull(path string, data []byte) ([]byte, error)
- type Audit
- type Compact
- type Convert
- type Diff
- type Generate
- type Get
- type Hashstore
- type HashstoreReport
- type HistogramItem
- type List
- type LogRead
- type LogReport
- type Logs
- type PieceStat
- type Recover
- type Report
- type RestoreTime
- type Stat
- type TTLReport
- type TimeHistogram
- type WithHashstore
- type WithHashtable
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMMapcfg = hashstore.MmapCfg{}
Functions ¶
Types ¶
type Audit ¶ added in v1.9.0
type Compact ¶
type Compact struct {
WithHashstore
AliveFraction float64 `help:"Fraction of alive data to keep" default:"0.25"`
DeleteTrashImmediately bool `help:"Delete trash segments immediately" default:"true"`
RewriteMultiple float64 `help:"Limit data size to be rewritten in one cycle" default:"2.0"`
}
type Convert ¶
func (*Convert) Copy ¶
func (i *Convert) Copy(ctx context.Context, store blobstore.Blobs, op *piecestore.HashStoreBackend, info blobstore.BlobInfo, buf []byte, header *pb.PieceHeader) (err error)
type Diff ¶ added in v1.4.0
type Generate ¶ added in v1.1.0
type Generate struct {
load.PieceIDStream
Dir string `help:"directory of the store (not the db!)" default:"/tmp/store"`
Samples int `help:"number of pieces to be written" default:"1"`
Size int64 `help:"size of the pieces to be written" default:"100000"`
TTL time.Duration `help:"TTL to be used"`
TTLModulo int `help:"modulo for TTL. Only the selected pieces with this modulo will be TTLed" default:"1"`
MinTableSize uint64 `help:"minimum table size for the store" default:"20"`
MetaPath string `help:"path to the meta file" default:""`
}
type Get ¶ added in v1.4.0
type Get struct {
WithHashtable
ID string `arg:"" help:"the id of the record to get"`
}
type Hashstore ¶
type Hashstore struct {
Convert Convert `cmd:"" help:"import data to the hashtable"`
List List `cmd:"" help:"list content of a hashtable"`
Stat Stat `cmd:"" help:"list content of a hashtable stat"`
//Generate Generate `cmd:"" help:"generate data to a hashtable store"`
Compact Compact `cmd:"" help:"compact a hashtable store"`
Report Report `cmd:"" help:"show additional reports on a hashtable store"`
Logs Logs `cmd:"" help:"show current log file load"`
TTLReport TTLReport `cmd:"" help:"print out ttl expiration per file"`
Recover Recover `cmd:"" help:"recover hashtable (metadata) from a hashstore log files"`
RestoreTime RestoreTime `cmd:"" help:"get/set restore time for a satellite"`
Get Get `cmd:"" help:"get a record from a hashtable"`
Diff Diff `cmd:"" help:"diff two hashstore"`
Audit Audit `cmd:"" help:"audit a hashstore: check if pieces are included"`
LogRead LogRead `cmd:"" help:"find record in hashstore log files without using metadata"`
}
type HashstoreReport ¶ added in v1.7.0
type HashstoreReport struct {
Table string
Stat PieceStat
Sum struct {
NonTTL PieceStat
TTL PieceStat
Trash PieceStat
}
Trash []HistogramItem
TTL []HistogramItem
}
type HistogramItem ¶ added in v1.7.0
type List ¶
type List struct {
WithHashtable
Expired bool `help:"list expired records" default:"true"`
Trash bool `help:"list trashed records" default:"true"`
ValidAt string `help:"list records only if valid at this time (created before, expired after)"`
Key bool `help:"print only keys in PieceID format"`
}
type LogRead ¶ added in v1.9.0
type LogRead struct {
Dir string `default:"." help:"the directory to recover"`
Piece string `arg:"" help:"the piece to read from the logs"`
}
func (*LogRead) RecoverOne ¶ added in v1.9.0
type LogReport ¶ added in v1.5.0
type Logs ¶ added in v1.3.0
type Logs struct {
WithHashstore
AliveFraction float64 `help:"the fraction of live data in a log file to consider it for compaction" default:"0.25"`
ProbabilityPower float64 `help:"the power to raise the compaction probability to" default:"2.0"`
}
type Recover ¶ added in v1.3.0
type Recover struct {
Dir string `default:"." help:"the directory to recover"`
MetaDir string `help:"the directory to create the recovered hashtable"`
Size int `default:"26" help:"size of the new hashtable (power of 2)"`
Kind int `default:"1" help:"kind of the hashtable, 0 hashtbl, 1 memtbl"`
}
func (*Recover) RecoverOne ¶ added in v1.3.0
type Report ¶ added in v1.1.0
type Report struct {
WithHashtable
JSON bool `help:"Output in JSON format"`
}
type RestoreTime ¶ added in v1.3.0
type RestoreTime struct {
NewValue time.Time `cmd:"arg"`
Dir string `default:"" help:"the directory to recover"`
SatelliteID storj.NodeID `default:"12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S"`
}
func (*RestoreTime) Run ¶ added in v1.3.0
func (r *RestoreTime) Run() error
type Stat ¶ added in v1.1.0
type Stat struct {
WithHashtable
}
type TTLReport ¶ added in v1.3.0
type TTLReport struct {
WithHashtable
}
type TimeHistogram ¶ added in v1.4.0
type TimeHistogram struct {
// contains filtered or unexported fields
}
func NewTimeHistogram ¶ added in v1.4.0
func NewTimeHistogram() *TimeHistogram
func (*TimeHistogram) Count ¶ added in v1.4.0
func (t *TimeHistogram) Count() (res int)
func (*TimeHistogram) Increment ¶ added in v1.4.0
func (t *TimeHistogram) Increment(idx int, size int)
func (*TimeHistogram) Print ¶ added in v1.4.0
func (t *TimeHistogram) Print(minLimit int, maxLimit int)
type WithHashstore ¶ added in v1.12.0
type WithHashstore struct {
LogDir string `help:"directory of the store" `
MetaDir string `help:"directory of the hashtable files"`
Path string `arg:"" help:"the path to the hashtable file (or directory with one hashtbl file)" optional:"true"`
Logs string `arg:"" optional:"true"`
}
func (WithHashstore) GetPath ¶ added in v1.12.0
func (w WithHashstore) GetPath() (string, string)
GetPath returns the meta path and log path based on the WithHashstore configuration.
Click to show internal directories.
Click to hide internal directories.