Documentation ¶
Index ¶
- type Deduplicator
- type Differ
- type Reduplicator
- type SegmentHandler
- type SegmentStat
- type SegmentTracker
- func (s SegmentTracker) PrintMostFrequentSegStats(out io.Writer, n int) error
- func (s SegmentTracker) PrintSegLengthHistogram(out io.Writer) error
- func (s SegmentTracker) PrintSegLengths(out io.Writer, sep string) error
- func (s SegmentTracker) PrintStats(out io.Writer) error
- func (s *SegmentTracker) Track(segment, seghash []byte) SegmentStat
- type Segmenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deduplicator ¶
type Deduplicator struct {
// contains filtered or unexported fields
}
Deduplicator performs deduplication of the specified file
func NewDeduplicator ¶
func NewDeduplicator(winsz, mask uint64) *Deduplicator
NewDeduplicator returns a Deduplicator
func (*Deduplicator) PrintStats ¶
func (d *Deduplicator) PrintStats(out io.Writer) error
PrintStats prints stats to the given writer
type Differ ¶
type Differ struct {
// contains filtered or unexported fields
}
Differ performs diff computation (and resuscitation)
func (*Differ) ApplyPatch ¶
ApplyPatch applies the patch file to the 'old' and writes the result to 'new'
type Reduplicator ¶
type Reduplicator struct {
// contains filtered or unexported fields
}
Reduplicator performs reduplication of the specified file
type SegmentHandler ¶
SegmentHandler is something capable of processing the segments handed to it
type SegmentStat ¶
type SegmentStat struct { ID uint64 // ID is a (unique) numeric identifier for this segment Length int // Length of segment Freq int // How many times this segment occurred in the file }
SegmentStat holds stats for a single segment
type SegmentTracker ¶
type SegmentTracker struct { SegHashes map[string]SegmentStat // map[crypto hash of seg] -> SegmentStat // contains filtered or unexported fields }
SegmentTracker tracks segments
func NewSegmentTracker ¶
func NewSegmentTracker() *SegmentTracker
NewSegmentTracker returns an initialized SegmentTracker struct
func (SegmentTracker) PrintMostFrequentSegStats ¶
func (s SegmentTracker) PrintMostFrequentSegStats(out io.Writer, n int) error
PrintMostFrequentSegStats prints 'n' "hottest" segments (SegmentStat)
func (SegmentTracker) PrintSegLengthHistogram ¶
func (s SegmentTracker) PrintSegLengthHistogram(out io.Writer) error
PrintSegLengthHistogram prints histogram (bars in csv) to out
func (SegmentTracker) PrintSegLengths ¶
func (s SegmentTracker) PrintSegLengths(out io.Writer, sep string) error
PrintSegLengths prints segment lengths to the specified output separated by the specified separator
func (SegmentTracker) PrintStats ¶
func (s SegmentTracker) PrintStats(out io.Writer) error
PrintStats prints the segment stats on the given output (io.Writer)
func (*SegmentTracker) Track ¶
func (s *SegmentTracker) Track(segment, seghash []byte) SegmentStat
Track records the stats for the specified segment
type Segmenter ¶
Segmenter segments a file or stream
func (Segmenter) SegmentFile ¶
func (s Segmenter) SegmentFile(file io.Reader, handler SegmentHandler) error
SegmentFile does the actual work of segmenting the specified file as per the params configure in the Segmenter struct. It reads the io.Reader till EOF, calling the specified handler each time it finds a segment