Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSeqFileInode ¶
NewSeqFileInode returns an Inode with SeqFile InodeOperations.
Types ¶
type SeqData ¶
type SeqData struct {
// The data to be returned to the user.
Buf []byte
// A seek handle used to find the next valid unit in ReadSeqFiledata.
Handle SeqHandle
}
SeqData holds the data for one unit in the file.
type SeqFile ¶
SeqFile is used to provide dynamic files that can be ordered by record.
func NewSeqFile ¶
NewSeqFile returns a seqfile suitable for use by external consumers.
func (*SeqFile) DeprecatedPreadv ¶
func (s *SeqFile) DeprecatedPreadv(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error)
DeprecatedPreadv reads from the file at the given offset.
func (*SeqFile) DeprecatedPwritev ¶
DeprecatedPwritev is always denied.
func (*SeqFile) UnstableAttr ¶
UnstableAttr returns unstable attributes of the SeqFile.
type SeqGenerationCounter ¶
type SeqGenerationCounter struct {
// contains filtered or unexported fields
}
SeqGenerationCounter is a counter to keep track if the SeqSource should be updated. SeqGenerationCounter is not thread-safe and should be protected with a mutex.
func (*SeqGenerationCounter) Generation ¶
func (s *SeqGenerationCounter) Generation() int64
Generation returns the current generation counter.
func (*SeqGenerationCounter) IsCurrent ¶
func (s *SeqGenerationCounter) IsCurrent(generation int64) bool
IsCurrent returns whether the given generation is current or not.
func (*SeqGenerationCounter) SetGeneration ¶
func (s *SeqGenerationCounter) SetGeneration(generation int64)
SetGeneration sets the generation to the new value, be careful to not set it to a value less than current.
func (*SeqGenerationCounter) Update ¶
func (s *SeqGenerationCounter) Update()
Update increments the current generation.
type SeqSource ¶
type SeqSource interface {
// NeedsUpdate returns true if the consumer of SeqData should call
// ReadSeqFileData again. Generation is the generation returned by
// ReadSeqFile or 0.
NeedsUpdate(generation int64) bool
// Returns a slice of SeqData ordered by unit and the current
// generation. The first entry in the slice is greater than the handle.
// If handle is nil then all known records are returned. Generation
// must always be greater than 0.
ReadSeqFileData(handle SeqHandle) ([]SeqData, int64)
}
SeqSource is a data source for a SeqFile file.